_analytics
5 minute read
Topic structure
Work Order
Create
Use this topic to create a new work order.
This replaces the addOrder
message from our v0 data model.
Fields
external_work_order_id
(string): The work order ID from your MES or ERP system.product
(object): The product being produced.external_product_id
(string): The product ID from your MES or ERP system.cycle_time_ms
(number) (optional): The cycle time for the product in seconds. Only include this if the product has not been previously created.
quantity
(number): The quantity of the product to be produced.status
(number) (optional): The status of the work order. Defaults to0
(created).0
- Planned1
- In progress2
- Completed
start_time_unix_ms
(number) (optional): The start time of the work order. Will be set by the correspondingstart
message if not provided.end_time_unix_ms
(number) (optional): The end time of the work order. Will be set by the correspondingstop
message if not provided.
Example
{
"external_work_order_id": "1234",
"product": {
"external_product_id": "5678"
},
"quantity": 100,
"status": 0
}
Start
Use this topic to start a previously created work order.
Each work order can only be started once.
Only work orders with status 0
(planned) and no start time can be started.
Fields
external_work_order_id
(string): The work order ID from your MES or ERP system.start_time_unix_ms
(number): The start time of the work order.
Example
{
"external_work_order_id": "1234",
"start_time_unix_ms": 1719931704927
}
Stop
Use this topic to stop a previously started work order.
Stopping an already stopped work order will have no effect.
Only work orders with status 1
(in progress) and no end time can be stopped.
Fields
external_work_order_id
(string): The work order ID from your MES or ERP system.end_time_unix_ms
(number): The end time of the work order.
Example
{
"external_work_order_id": "1234",
"end_time_unix_ms": 1719931704927
}
Product Type
Create
Announce a new product type.
We recommend using the work-order/create message to create products on the fly.
Fields
external_product_type_id
(string): The product type ID from your MES or ERP system.cycle_time_ms
(number) (optional): The cycle time for the product in milliseconds.
Example
{
"external_product_type_id": "5678",
"cycle_time_ms": 60
}
Product
Add
Communicates the completion of part of a work order.
Fields
external_product_type_id
(string): The product type ID from your MES or ERP system.product_batch_id
(string) (optional): Unique identifier for the product. This could for example be a barcode or serial number.start_time_unix_ms
(number): The start time of the product.end_time_unix_ms
(number): The end time of the product.quantity
(number): The quantity of the product produced.bad_quantity
(number) (optional): The quantity of bad products produced.
Example
{
"external_product_type_id": "5678",
"product_batch_id": "1234",
"start_time_unix_ms": 1719931604927,
"end_time_unix_ms": 1719931704927,
"quantity": 100,
"bad_quantity": 5
}
Set Bad Quantity
Modify the quantity of bad products produced.
Fields
external_product_type_id
(string): The product type ID from your MES or ERP system.end_time_unix_ms
(string): The end time of the product, used to identify an existing product.bad_quantity
(number): The new quantity of bad products produced.
Example
{
"external_product_type_id": "5678",
"end_time": 1719931704927,
"bad_quantity": 10
}
Shift
Add
Announce a new shift.
Fields
start_time_unix_ms
(number): The start time of the shift.end_time_unix_ms
(number): The end time of the shift.
Example
{
"start_time_unix_ms": 1719931604927,
"end_time_unix_ms": 1719931704927
}
Delete
Delete a previously created shift.
Fields
start_time_unix_ms
(number): The start time of the shift.
Example
{
"start_time_unix_ms": 1719931604927
}
State
Add
Announce a state change.
Checkout the state documentation for a list of available states.
Fields
state
(number): The state of the machine.start_time_unix_ms
(number): The start time of the state.
Example
{
"state": 10000,
"start_time_unix_ms": 1719931604927
}
Overwrite
Overwrite one or more states between two times.
Fields
state
(number): The state of the machine.start_time_unix_ms
(number): The start time of the state.end_time_unix_ms
(number): The end time of the state.