--- description: Collect machine process values into the MES Data Collection Instance through the OPC UA Standard. alias: userguide-equipment-integration-opcua-standard-data-collection --- # Data Collection ## Overview **Data Collection** stores process values supplied by the machine in the applicable MES Data Collection Instance. The machine may post one or more readings while a Material is in process. The parameter structure is machine-specific. The `` is used only to illustrate the pattern; production nodes must use the actual MES Parameter names. !!! note "Choose the appropriate data path" Use **Data Collection** for values that are relevant to process execution, quality, traceability, or MES decision-making, such as measurements, inspection results, and process outcomes. It is not intended to store every sample from fast-changing machine signals. When high-frequency or time-series machine data must be retained for diagnostics, trending, or analytics, publish it through an appropriate process-data mechanism, such as the [Critical Manufacturing Data Platform](https://help.criticalmanufacturing.com/userguide/data-platform/). Store only the process-relevant results or summaries in the MES Data Collection Instance. ## Nodes | Relative node | OPC UA type | Direction | Purpose | | ------------------------------------------- | ------------------ | ------------- | ------------------------------------------------------------------ | | `DataCollection.Material.Name` | `String` | Machine → MES | Material to which the values belong | | `DataCollection.PostDataReadingNumber` | `Int32` | Machine → MES | Reading number; the first reading normally uses `1` | | `DataCollection.PostDataSampleId` | `String` | Machine → MES | Optional sample or correlation identifier. Default is empty string | | `DataCollection.Parameters.` | Parameter-specific | Machine → MES | Actual process value | | `DataCollection.MachinePostDataRequest` | `Boolean` | Machine → MES | Requests that the current values be posted to MES | | `DataCollection.MESPostDataPerformed` | `Boolean` | MES → Machine | Confirms that the values were read, validated, and stored in MES | ## Parameter Tree Example ```text DataCollection ├── Material │ └── Name ├── MachinePostDataRequest ├── MESPostDataPerformed ├── PostDataReadingNumber ├── PostDataSampleId └── Parameters ├── ActualCycleTime ├── AppliedTorque └── InspectionResult ``` ## Communication Flow ```mermaid --8<-- "docs/userguide/equipmentintegration/opcua-standard/_includes/mermaid-sequence-theme.txt" sequenceDiagram autonumber participant M as Machine / OPC UA Server participant I as Connect IoT participant E as Critical Manufacturing MES M->>M: Write Material, reading, sample, and values M->>I: MachinePostDataRequest = true I->>E: Request Data Collection Instance Parameters for the Material E-->>I: Provide the resolved parameters loop Each required Parameter I->>M: Read configured Parameter node M-->>I: OPC UA value and status I->>I: Convert configured data type end I->>E: Post reading values alt MES post succeeds E-->>I: Data stored confirmation I->>M: MESPostDataPerformed = true M->>I: MachinePostDataRequest = false I->>M: MESPostDataPerformed = false else Validation or post fails E-->>I: Failure I-->>I: Record diagnostic, performed remains false end ``` ## Step-by-Step Process 1. During Track In, MES resolves `MaterialDataCollectionContext`. 2. When the context returns a valid `LongRunning` **Data Collection**, MES creates and keeps the **Data Collection Instance** open for the in-process Material. 3. The machine writes every required value below `DataCollection.Parameters`. 4. The machine writes the Material name, reading number, and optional sample identifier. 5. After all payload values are stable, the machine sets `MachinePostDataRequest = true`. 6. Connect IoT validates the Resource and resolves the Material. If the name is empty, FIFO is permitted only when `IndEqAutomationOperationAllowFIFO = true`. 7. MES resolves the open **Data Collection Instance** and the **Parameters** expected for that reading. 8. Connect IoT reads each node by its exact **Parameter** name, validates the OPC UA read status, and converts the value according to `IndEqOpcUaParameterDataType`. 9. MES validates mandatory values, limits, and reading rules, and then stores the reading. 10. Connect IoT sets `MESPostDataPerformed = true` only after MES stores the values successfully. 11. The machine resets `MachinePostDataRequest`, after which **Connect IoT** resets `MESPostDataPerformed`. ## Reading and Sample Rules - The first reading normally has number `1`. - Subsequent readings increment according to the **Data Collection** definition. - The reading number must be within the configured range. - `PostDataSampleId` is optional. - Reuse of a reading number or sample identifier must follow the configured MES **Data Collection** behavior and must be verified during commissioning. ## No-Data and Parse Failures The request fails when the machine provides no expected values or the returned values cannot be parsed. The diagnostic should indicate that the machine supplied no data to be posted or that parsing failed. `MESPostDataPerformed` remains `false`. Diagnostics should include: - Resource and Material values. - the Data Collection definition and the applicable sample and reading ranges. - the Parameter name, resolved OPC UA node, configured `IndEqOpcUaParameterDataType`, and actual OPC UA data type. ## Validation and Assumptions - [ ] Actual machine Parameter names match MES Parameter names. - [ ] Each supported data type converts correctly. - [ ] Missing mandatory values fail before `MESPostDataPerformed` is set. - [ ] Invalid reading numbers and closed/missing instances are rejected. - [ ] Multiple readings are stored under the correct reading number. - [ ] Handshake reset allows a later request to be detected again. - [ ] Resource is set as `EnableAutomationScenarios = true` - [ ] MES automation controller type is `IndEqController`