# Automatic Track-Out ## Overview This feature enables Automatic MES material Track-Out of the current Resource. !!! note "Currently supported events:" - WorkCompleted - UnitsDeparted - UnitsInspected - UnitsTested - UnitsProcessed ## How To Configure ### Relevant Artifacts The table below describes the properties for this entity type: | Name | Type | Is Mandatory | Data Type | Description | | :-------------------- | :--------- | :----------: | :-------- | :----------------------------------------------- | | IoTMetadataDefinition | SmartTable | Yes | | Metadata configuration for equipment integration | ### IoTMetadataDefinition Resource Level Configuration At the **Resource** level, there are several configuration we can make to set this feature. | Resource | Resource Type | Area | Name | Value | Description | | ---------------------- | ------------- | ---- | --------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | *MES IPC-CFX Resource* | | | useIPCCFXToTrackOut | Supported Event Name | Enable Track-Out operation with the event defined. | | *MES IPC-CFX Resource* | | | removeTransactionIDonMessage | Supported Event Name | Event used to remove the Transaction ID/Primary Identifier pair from Queue. | | *MES IPC-CFX Resource* | | | waitForTraceToDoTrackOut | true | Enable wait (max 5 seconds) for Data Collection before Tracking Out. | | *MES IPC-CFX Resource* | | | useTrackOutOperation | ComplexTrackOut | MES Track-Out operation to be performed on the current Material. `ComplexTrackOutAndMoveNext` or `ComplexTrackOut`. Defaults to `ComplexTrackOut` if not defined. | | *MES IPC-CFX Resource* | | | useWorkCompletedMaterialNameFrom | PrimaryIdentifier | Where the controller will get the Identification of the Material. Possible values are: `PrimaryIdentifier` or `UnitIdentifier` (from the first Unit). | | *MES IPC-CFX Resource* | | | useUnitsDepartedMaterialNameFrom | PrimaryIdentifier | Where the controller will get the Identification of the Material. Possible values are: `PrimaryIdentifier` or `UnitIdentifier` (from the first Unit). | ### How It Works **CFX.Production.WorkCompleted** Event from IPC-CFX standard. In the Event message we will retrieve the Material name from the location defined in `useMaterialNameFrom`, If not defined, it will default to **PrimaryIdentifier**, which will identify the MES Material we will Track-Out from the current Resource. !!! note "TransactionId PrimaryIdentifier Persistency Handling" If `removeTransactionIDonMessage` is set to WorkCompleted, we will remove the Transaction ID and Primary Identifier from Persistency queue. ??? Example "CFX WorkCompleted Example" ```JSON { "TransactionID": "2c24590d-39c5-4039-96a5-91900cecedfa", "Result": "Completed", "PrimaryIdentifier": "MaterialName", "HermesIdentifier": null, "UnitCount": 0, "Units": [] } ``` **CFX.Production.UnitsDeparted** Event from IPC-CFX standard. In the Event message we will retrieve the Material name from the location defined in `useMaterialNameFrom`, If not defined, it will will default to **PrimaryIdentifier**, which will identify the MES Material we will Track-Out from the current Resource. !!! note "TransactionId PrimaryIdentifier Persistency Handling" If `removeTransactionIDonMessage` is set to UnitsDeparted, we will remove the Transaction ID and Primary Identifier from Persistency queue. ??? Example "CFX UnitsDeparted Example" ```JSON { "PrimaryIdentifier": "MaterialName", "UnitCount": 2, "Units": [ { "UnitIdentifier": "CARRIER5566", "PositionNumber": 1, "PositionName": "CIRCUIT1", "X": 50.45, "Y": 80.66, "Rotation": 0.0, "FlipX": false, "FlipY": false }, { "UnitIdentifier": "CARRIER5566", "PositionNumber": 2, "PositionName": "CIRCUIT2", "X": 50.45, "Y": 80.66, "Rotation": 90.0, "FlipX": false, "FlipY": false } ] } ``` The Controller will call MES service `api/IoTUtilities/IoTMaterialOperation` which will handle the MES tracking operation. ??? note "IoTMaterialOperation service signature" The input object **IoTMaterialOperationInput** contains the following information: | Name | Type | Description | | :-------- | :----------------- | :-------------------------------------------------------------- | | Operation | String | MES operation to be performed on the current Material. | | Resource | Resource | Resource where the validation should take place | | Material | Material | Material to which perform the Tracking operation | | Materials | MaterialCollection | Collection of Materials to which perform the Tracking operation | The output object **IoTMaterialOperationOutput** contains the following information: | Name | Type | Description | | :----------- | :----- | :------------ | | MaterialName | String | Material name |