# Automatic Track-In ## Overview This feature enables Automatic MES material Track-In to the current Resource. !!! note "Currently supported events Keys:" *50XPCBIDRequest * 602MachineEvent ## 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 | | IoTMaterialOperations | Service | Yes | | Service that handles Material Operations requests form equipment in MES | ### How It Works When a event that is enabled to Track-In the material into the resource is received we will: * Check Conditions * Wait for previous Track-Out (if enabled). * Wait for recipe change completion (if enabled). * When timeout is reached will continue. * Perform Track-In * Trigger the configured PanaCIM event (usePanaCIMToTrackIn). * Execute MES operation (ComplexTrackIn or ComplexDispatchAndTrackIn). * Optional Previous Track-Out * If doPreviousTrackOut is true, the system tracks out the material from the previous station before completing Track-In. The Controller will call MES DEE [IoTMaterialOperation](../../artifacts/dees.md#iotmaterialoperation) to handle the MES tracking operation. ## Assumptions SmartTable `IoTMetadataDefinition` is configured, other than the general setup keys [(check Setup for more information)](setup.md), with the following entries for each station: | Resource | ResourceType | Area | Name | Value | Description | | ------------------------------ | ------------ | ---- | ----------------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | | MES PanaCIM Station X Resource | | | usePanaCIMToTrackIn | *Supported Event String* | Track In Material with the chosen event.See List at the top of this page. | | MES PanaCIM Station X Resource | | | useWaitForPreviousTrackout | True | Activate wait for track-out to finish on previous PanaCIM module. | | MES PanaCIM Station X Resource | | | useWaitIfRecipeIsBeingChanged | True | Activate wit for Recipe Change to finish. | | MES PanaCIM Station X Resource | | | useWaitTimeout | True | Set max waiting time. (10 = 1000 ms) | | MES PanaCIM Station X Resource | | | useTrackInOperation | True | MES Track-In operation to be performed on the current Material. `ComplexDispatchAndTrackIn` or `ComplexTrackIn`. Defaults to `ComplexTrackIn` if not defined. | | MES PanaCIM Station X Resource | | | doPreviousTrackOut | True | Activate to enable tracking out from previous Resource before tracking into the current one. | ## Notes on `useWaitForPreviousTrackOut` key: Due to reduced time interval between the machine output and the input of the next machine, the message **602** with code **B01** (representing TrackIn) are eventually received **before** the Track-Out ending of the previous machine (see PP1 and PP2 example in the next picture). Setting key `useWaitForPreviousTrackOut`, the Controller will check if the previous machine has already performed the Track-Out: ![panacim_tracking_sequences](./images/panacim_tracking_sequence.png) * PP1 Track-Out will hold until Consumptions (551 Trace) ends. * PP2 Track-In will hold until previous PP1 Track-Out ends. In case of Traceability message not being received yet, and a Track-In message already received, the Controller will hold the Track-Out operation until it receives the Traceability massage, and then will hold the Track-In operation until this Track-Out performs.