State Synchronization#
Overview#
State Synchronization keeps the MES Resource state aligned with the current machine state. The machine publishes its state through OPC UA, Connect IoT reads the values, and MES applies the corresponding Resource state.
State synchronization is independent from the operation handshakes used by Track In, Track Out, and Abort.
State signal conditioning
MES Resource states should represent operationally meaningful equipment conditions rather than every raw signal fluctuation. The PLC, machine application, or another lower automation layer remains responsible for filtering contact bounce, unstable signals, and other high-frequency changes before publishing states through OPC UA.
As an additional safeguard, the OPC UA Standard Controller waits two seconds before synchronizing a new state with MES. If the state changes again during that interval, the short-lived state is treated as a microstop and is not reported as an MES Resource state transition. This safeguard protects MES from rapid state oscillations, but it does not replace the signal conditioning expected from the lower automation layers.
Retain short-duration events or high-frequency machine data through an appropriate process-data mechanism, such as the Critical Manufacturing Data Platform ↗, instead of representing every transient as an MES Resource state change.
OPC UA Nodes#
| Relative node | OPC UA type | Direction | Purpose |
|---|---|---|---|
State.MainState | String | Machine → MES | Provides the machine main state. The value can be an MES state name or a machine-specific value resolved through the state mapping |
State.SubState | String | Machine → MES | Optionally provides additional detail used to select a more specific state mapping |
State.Reason | String | Machine → MES | Optionally provides the reason to apply to the MES state change |
Communication Flow#
sequenceDiagram
autonumber
participant M as Machine / PLC
participant S as OPC UA Server
participant I as Connect IoT
participant E as Critical Manufacturing MES
alt Initial synchronization when Connect IoT starts
I->>S: Read MainState, SubState, and Reason
S-->>I: Current machine state values
I->>E: Synchronize Resource state without transition validation
E->>E: Resolve target state and align the Resource
E-->>I: Initial synchronization completed
else State change during normal operation
M->>S: Update MainState, SubState, and Reason
S-->>I: State value change notification
I->>E: Request Resource state change
E->>E: Resolve target state and validate the transition
E-->>I: State change completed
end State Resolution#
MES resolves the target state in this order:
- If
State.MainStateexactly matches a state in the Resource state model, that state is used. - Otherwise, MES resolves the machine values through
IndEqResourceStateResolution. - The resolved target must exist in the Resource state model.
See State Mappings for the Smart Table settings and examples.
Initial Synchronization#
When Connect IoT starts, the MES Resource may not yet reflect the physical machine state. For this first synchronization, the State Model transition is not considered so MES can align the Resource with the current machine state without requiring a normal transition from the previously recorded state.
This behavior is limited to startup synchronization. State changes received after startup follow the Resource state model and require a valid transition.
Reason Behavior#
If State.Reason contains a value, that value is applied as the reason for the MES state change. If State.Reason is empty, MES uses the default reason configured for the selected state transition.
Runtime Process#
- At connection startup, Connect IoT reads the current machine state and MES aligns the Resource without validating the previous transition.
- Subsequent stable state changes are subscribed, resolved, and validated against the Resource state model; MES applies the supplied reason or the transition's default reason.
- If the mapping, or transition is invalid, the Resource state will still be changed as long as the state is defined in the resource state model.
Error Conditions#
State synchronization fails when:
- the Resource does not have a state model.
State.MainStatedoes not directly match an MES state and no mapping is found.- the mapped target is not part of the Resource state model.
Validation and Assumptions#
- Initial synchronization aligns MES with the current machine state.
- A direct main-state match resolves correctly.
- Main-state and main-state-plus-substate mappings resolve correctly.
- Runtime changes follow valid Resource state transitions.
- Lower automation layers condition raw state signals, and the controller suppresses state changes that last less than two seconds.
- A supplied reason is applied to the state change.
- An empty reason uses the transition's default reason.
- Missing or invalid mappings produce a clear diagnostic.