--- description: Understand the shared Operation Handshake control nodes used by Track In, Track Out, and Abort. alias: userguide-equipment-integration-opcua-standard-operation-handshake --- # Operation Handshake ## Control Nodes **Track In**, **Track Out**, and **Abort** use the same three-bit contract. | Node | Owner | Meaning | | --------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | `MachineOperationRequest` | Machine | Requests that Connect IoT execute the MES operation | | `MESOperationPerformed` | Connect IoT | Indicates that MES performed the operation within the current transaction and starts the machine-confirmation phase | | `MachineOperationConfirmed` | Machine | Confirms that the machine consumed the MES result, allowing the MES transaction to complete | All three bits are `Boolean` and are normally `false` while the operation is idle. ## Communication Flows ### Machine-Initiated ```mermaid --8<-- "docs/userguide/equipmentintegration/opcua-standard/_includes/mermaid-sequence-theme.txt" sequenceDiagram autonumber participant M as Machine / PLC participant S as OPC UA Server participant I as Connect IoT participant E as Critical Manufacturing MES M->>S: Write Material M->>S: MachineOperationRequest = true S->>I: Request and payload change notification I->>I: Validate Resource, request, and Material Name I->>E: Execute MES operation E->>E: Validate and perform within transaction alt MES validation and processing succeed E-->>I: Operation performed, awaiting machine confirmation I->>S: MESOperationPerformed = true S-->>M: Performed signal available M->>M: Consume result alt Confirmation before MachineReplyTimeout M->>S: MachineOperationConfirmed = true S-->>I: Confirmation change notification I-->>E: Machine confirmed E->>E: Commit transaction E-->>I: Operation succeeded I->>S: MESOperationPerformed = false M->>S: Request and confirmation = false else MachineReplyTimeout expires I-->>E: Machine confirmation timeout E->>E: Roll back transaction I->>S: MESOperationPerformed = false I-->>I: Record failure diagnostic end else MES validation or processing fails E-->>I: Failure and rollback I-->>I: Record diagnostic, performed remains false end ``` Step by step: 1. The machine writes the operation payload, including `Material.Name` when available. 2. The machine sets `MachineOperationRequest = true` once. 3. **Connect IoT** resolves the applicable Resource and Material. 4. **Connect IoT** invokes the corresponding MES operation. 5. MES applies its normal preconditions and performs the operation within the current transaction. 6. **Connect IoT** sets `MESOperationPerformed = true` and starts waiting for the machine confirmation. 7. The machine consumes the result and sets `MachineOperationConfirmed = true`. 8. When confirmation arrives before `MachineReplyTimeout`, MES commits the transaction. 9. **Connect IoT** resets `MESOperationPerformed`. 10. The machine resets its request and confirmation bits. 11. If the confirmation does not arrive in time, the command fails and the MES transaction rolls back. ### Operator-Initiated and Hybrid ```mermaid --8<-- "docs/userguide/equipmentintegration/opcua-standard/_includes/mermaid-sequence-theme.txt" sequenceDiagram autonumber actor O as Operator participant U as MES UI participant E as Critical Manufacturing MES participant I as Connect IoT participant S as OPC UA Server participant M as Machine / PLC O->>U: Perform Track In, Track Out, or Abort U->>E: Execute standard MES operation E->>E: Validate and perform within transaction E-->>I: Operation event, awaiting machine confirmation I->>S: MESOperationPerformed = true S-->>M: Performed signal available M->>M: Consume MES-originated result alt Confirmation before MachineReplyTimeout M->>S: MachineOperationConfirmed = true S-->>I: Confirmation change notification I-->>E: Machine confirmed E->>E: Commit transaction E-->>U: Operation succeeded U-->>O: Success I->>S: MESOperationPerformed = false M->>S: MachineOperationConfirmed = false else MachineReplyTimeout expires I-->>E: Machine confirmation timeout E->>E: Roll back transaction E-->>U: Operation failed U-->>O: Failure I->>S: MESOperationPerformed = false end ``` In this path: - The operator acts through the MES UI. - MES validates and performs the standard operation within its transaction. - `MachineOperationRequest` remains `false`. - The affected Material is taken from the MES operation context, not from the OPC UA Material node. - The machine must monitor `MESOperationPerformed` even when it did not issue a request. - MES commits the operation only after the machine confirms within `MachineReplyTimeout`. ## Material Resolution For a machine-initiated request, Connect IoT resolves the Material in this order: 1. If `Operation..Material.Name` is non-empty, resolve that exact MES Material. 2. Otherwise, read `IndEqAutomationOperationAllowFIFO` from the Resource attribute. 3. If FIFO is disabled, reject the request. 4. If FIFO is enabled, select the first eligible Material for the operation. | Operation | FIFO source when enabled | | ------------- | -------------------------------------------------------------------- | | **Track In** | First eligible queued/dispatched Material for the Resource and Step | | **Track Out** | First eligible in-process Material at the Resource and Step | | **Abort** | First eligible in-process Material at the Resource and Step | FIFO does not mean an arbitrary Material. The selected Material must still satisfy the normal MES operation rules. ## Missing Acknowledgement and Recovery After setting `MESOperationPerformed = true`, Connect IoT waits for `MachineOperationConfirmed = true` for the period configured by `/IndEq/Automation/OpcUaServer/MachineReplyTimeout/`. - If confirmation is received in time, the MES operation completes and its transaction commits. - If the timeout expires first, the command fails, the MES operation is not successful, and its transaction rolls back. - A rollback restores the MES transaction, but it cannot prove that the physical machine did not already react to the performed signal. - Recovery must reconcile MES, handshake values, and the physical machine state before resetting or retrying. See [Automation Timeout Settings](../configuration/opcua-connection.md#automation-timeout-settings) for configuration guidance. ## Reset Contract The idle state is: ```text MachineOperationRequest = false MESOperationPerformed = false MachineOperationConfirmed = false ``` The machine must not raise a new request until the previous cycle has returned to idle. Connect IoT must not interpret a bit that remained high from the preceding cycle as a new request.