# Automatic Resource State Change !!! info "The features handled in this integration have as base PanaCIM v8831 specification." ## Overview This feature enables the automatic change of MES Resource state according to PanaCIM state. ## How To Configure Allow the user to adjust MES Resource state in relation with PanaCIM machine state automatically. ### 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 | | IoTStateModelContext | SmartTable | Yes | | Relates the state model of the equipment to the state model of MES resource | ### How It Works We receive from PanaCIM event **540 Machine Status Notification** from this we will retrieve the Machine Status ID which we will relate to a MES state by resolving **IoTStateModelContext**. ### Assumptions SmartTable IoTMetadataDefinition is configured, other than the generic 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 | | | usePanaCIMToChangeState | 540MachineStatusNotification | Activate change state through Event data. | | MES PanaCIM Station X Resource | | | useStateChangingWait | true/false | Wait for previous state change call to finish. If not set will default to false. Max 3 seconds. | | MES PanaCIM Station X Resource | | | useUpdateResourceLaneState | true/false | Update Resource Lanes State. If not set will default to false. | SmartTable IoTStateModelContext is configured with the entries for each state. The Driver PanaCIM name is mandatory. StateModelState and Values are according to MES Definition and Equipment State Number: | StateModel | Driver | StateModelState | Values | | ---------- | ------- | --------------- | ------------- | | SEMI E10 | PanaCIM | MES State | PanaCIM State | ### PanaCIM Machine Module Status Codes Below is a list of status codes used by PanaCIM machine modules, along with their meanings: | Code | Status | Description | | ---- | ------------------- | -------------------------------------- | | `0` | Running | Actively mounting parts | | `1` | Waiting | Waiting for a command other than START | | `2` | Exhaust | | | `3` | Error | | | `4` | Reserved | | | `5` | Product Change Over | Module is in changeover status |