# Automatic Track-In ## Overview This feature enables Automatic MES material Track-In to the current Resource. !!! note "Currently supported events:" - WorkStarted - UnitsArrived - UnitsInspected ## 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* | | | useIPCCFXToTrackIn | Supported Event Name | Enable Track-In operation with the event defined. | | *MES IPC-CFX Resource* | | | maxTransactionIDEntries | 100 | Maximum number of pairs Transaction ID/Primary Identifier which will be saved in persistency. | | *MES IPC-CFX Resource* | | | createTransactionIDonMessage | WorkStarted | Event used to store the Transaction ID/Primary Identifier pair. (Currently Only WorkStarted is supported) | | *MES IPC-CFX Resource* | | | useWaitForPreviousTrackout | SMT_Printing | Enable wait (max 5 seconds) validation for the Previous Resource (Value). | | *MES IPC-CFX Resource* | | | useTrackInOperation | ComplexTrackIn | MES Track-In operation to be performed on the current Material. `ComplexDispatchAndTrackIn` or `ComplexTrackIn`. Defaults to `ComplexTrackIn` if not defined. | | *MES IPC-CFX Resource* | | | useWorkStartedMaterialNameFrom | 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* | | | useUnitsArrivedMaterialNameFrom | 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* | | | useUnitsInspectedMaterialNameFrom | PrimaryIdentifier | Where the controller will get the Identification of the Material. Possible values are: `PrimaryIdentifier`, `UnitIdentifier` (from the first Unit) or `UniqueIdentifier` (from the first Unit's Inspection). | ### How It Works **CFX.Production.WorkStarted** 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-In into the current Resource. !!! note "TransactionId PrimaryIdentifier Persistency Handling" If `createTransactionIDonMessage` is set to **WorkStarted**, we will save the Transaction ID and **PrimaryIdentifier** in a Queue, for use in other events that don't have the **PrimaryIdentifier** defined. If another event with the same **PrimaryIdentifier** is received the old entry **will be replaced** with the new one. When `maxTransactionIDEntries` is reached the oldest entry will be deleted. ??? Example "CFX WorkStarted Example" ```JSON { "$type": "CFX.Production.WorkStarted, CFX", "PrimaryIdentifier": "MaterialName", "TransactionID": "4f4e8320-43e9-4d94-88dc-d81318bb06d8", "Lane": null, "UnitCount": 0, "Units": [] } ``` **CFX.Production.UnitsArrived** 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-In into the current Resource. ??? Example "CFX UnitsArrived 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 } ] } ``` **CFX.Production.UnitsInspected** Event from IPC-CFX standard. In the Event message we will identify the Material name from the location defined in `useMaterialNameFrom`, If not defined, it will default to **UniqueIdentifier**, of the first Inspected Unit's first Inspection, which will identify the MES Material we will Track-In into the current Resource. ??? Example "CFX UnitsInspected Example" ```JSON { "TransactionId": "493bdbe0-9c32-4ed1-b7bf-b25372386b99", "InspectionMethod": "SPI", "SamplingInformation": { "SamplingMethod": "NoSampling", "LotSize": null, "SampleSize": null }, "Inspector": { "OperatorIdentifier": "BADGE489499", "ActorType": "Human", "LastName": "Smith", "FirstName": "Joseph", "LoginName": "joseph.smith@abcdrepairs.com" }, "InspectedUnits": [ { "UnitIdentifier": "MaterialName", "UnitPositionNumber": 1, "OverallResult": "Passed", "Inspections": [ { "UniqueIdentifier": "09b88135-019d-44f0-b28d-1de766851fd1", "InspectionName": "INSPECT_PASTE_DEPOSITIONS", "InspectionStartTime": null, "InspectionEndTime": null, "TestProcedure": null, "Comments": null, "Result": "Passed", "Error": null, "DefectsFound": [], "Symptoms": null, "Measurements": [ { "$type": "CFX.Structures.SolderPasteInspection.SolderPasteMeasurement, CFX", "X": 5.62, "EX": 5.6, "Y": 8.29, "EY": 8.3, "Z": 5.01, "EZ": 5.0, "DX": 0.02, "DY": 0.03, "Vol": 5.11, "EVol": 5.1, "Image": null, "UniqueIdentifier": "9367a252-cd8b-4198-bd75-100a0ace2249", "MeasurementName": "R1.1", "TimeRecorded": null, "Sequence": 0, "Result": "Passed", "CRDs": "R1.1" }, { "$type": "CFX.Structures.SolderPasteInspection.SolderPasteMeasurement, CFX", "X": 5.62, "EX": 5.6, "Y": 8.29, "EY": 8.3, "Z": 5.01, "EZ": 5.0, "DX": 0.02, "DY": 0.03, "Vol": 5.11, "EVol": 5.1, "Image": null, "UniqueIdentifier": "db0d3ac0-b6b8-40c2-8dd4-2ca426d3373a", "MeasurementName": "R1.2", "TimeRecorded": null, "Sequence": 0, "Result": "Passed", "CRDs": "R1.1" } ] } ] }, { "UnitIdentifier": "PANEL34543535", "UnitPositionNumber": 2, "OverallResult": "Failed", "Inspections": [ { "UniqueIdentifier": "6ae0a4c5-119c-4381-8d9d-eb193345445f", "InspectionName": "INSPECT_PASTE_DEPOSITIONS", "InspectionStartTime": null, "InspectionEndTime": null, "TestProcedure": null, "Comments": null, "Result": "Passed", "Error": null, "DefectsFound": [], "Symptoms": null, "Measurements": [ { "$type": "CFX.Structures.SolderPasteInspection.SolderPasteMeasurement, CFX", "X": 5.62, "EX": 5.6, "Y": 8.29, "EY": 8.3, "Z": 5.01, "EZ": 5.0, "DX": 0.02, "DY": 0.03, "Vol": 5.11, "EVol": 5.1, "Image": null, "UniqueIdentifier": "276b031b-69aa-47de-a087-bf4f1471ff0a", "MeasurementName": "R1.1", "TimeRecorded": null, "Sequence": 0, "Result": "Passed", "CRDs": "R1.1" }, { "$type": "CFX.Structures.SolderPasteInspection.SolderPasteMeasurement, CFX", "X": 5.62, "EX": 5.6, "Y": 8.29, "EY": 8.3, "Z": 5.01, "EZ": 5.0, "DX": 0.02, "DY": 0.03, "Vol": 5.11, "EVol": 5.1, "Image": null, "UniqueIdentifier": "49e5f6cf-dd27-4ad7-aa77-469e1da576df", "MeasurementName": "R1.2", "TimeRecorded": null, "Sequence": 0, "Result": "Passed", "CRDs": "R1.1" } ] } ] } ] } ``` The Controller will call MES service `api/IoTUtilities/IoTMaterialOperation` who 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 |