--- alias: user-guide-driver-panacim tags: - connect iot description: "This documentation details the PanaCIM protocol for connecting to Panasonic equipment, utilizing a TCP-IP server and XML messaging" --- # Connect IoT - PanaCIM Panasonic PanaCIM is one of the leading softwares in the world of SMT, for interfacing with equipments that are part of the Panasonic portfolio. PanaCIM is a protocol that requires Connect IoT to work as a TCP-IP Server and then the machine will open client connections. All communication is done through a particular message format, where the body is XML. !!! note The PanaCIM driver connects, by default, all interfaces to the same port. We recommend distributing the load by configuring each interface with its own instance, on its own port. ## Data Types These are the supported specific data types: | Name | Description | | -------- | --------------------------------------------- | | Integer | Integer number | | Numeric | Decimal number | | String | String value | | Boolean | Boolean value | | DateTime | Date/Time value | | Object | Json formatted value | | List | Json formatted array of values | | Header | Object Representing the Header of the Message | | Body | Object Representing the Body of the Message | Most of these datatypes are common throughout other drivers. We will focus on the one's that aren't. The `List` datatype will be used to represent cases where we intend to send or receive a list. When receiving an event with a List, choose device type `List`. For example, consider this message body (this is just an example, this message in particular according to the specification should only be sent by PanaCIM and not ConnectIoT): ```xml
``` In order to send this message from Connect IoT as a command we will need to reproduce the `products` list in a certain fashion. The `List` datatype resolves that issue (only applies to commands). We would select the `List` as our deviceType, in the extended data we will fill the `path` with the path to our list, so in this case `Body.Products` and in the `objectDefinition` we will define our list, giving for each member a `path` a `type` and a `name`. The path of the member of the list will match with the attribute that element of the list will match. ```json { "name": "products", "deviceType": "List", "extendedData": { "path": "Body.Products", "objectDefinition": [ { "path": "Product.Name", "name": "Name", "type": "String" }, { "path": "Product.Side", "name": "Side", "type": "String" }, { "path": "Product.SetupId", "name": "SetupId", "type": "String" }, { "path": "Product.MixID", "name": "MixId", "type": "String" } ] } } ``` The `Header` datatype will be used to represent cases where we don't need to map all the elements of the message header, and want to receive simply an object. Consider these two representations of the same event: ```json { "name": "PCB-ID Request", "deviceId": "500", "isEnabled": true, "extendedData": { "eventType": "Request" }, "properties": [ { "name": "header", "deviceId": "header", "dataType": "Object", "deviceType": "Header", "extendedData": {}, "isReadable": true, "isWritable": true }, { "name": "barcode", "deviceId": "Body.Pcb.Barcode", "dataType": "String", "deviceType": "String", "extendedData": {}, "isReadable": true, "isWritable": true }, { "name": "modelCode", "deviceId": "Body.Pcb.ModelCode", "dataType": "String", "deviceType": "String", "extendedData": {}, "isReadable": true, "isWritable": true }, { "name": "serialNo", "deviceId": "Body.Pcb.SerialNo", "dataType": "String", "deviceType": "String", "extendedData": {}, "isReadable": true, "isWritable": true }, { "name": "pcbSide", "deviceId": "Body.Pcb.Side", "dataType": "String", "deviceType": "String", "extendedData": {}, "isReadable": true, "isWritable": true }, { "name": "scannerMountSide", "deviceId": "Body.Pcb.ScannerMountSide", "dataType": "String", "deviceType": "String", "extendedData": {}, "isReadable": true, "isWritable": true } ], } ``` ```json { "name": "PCB-ID Request", "deviceId": "500", "isEnabled": true, "extendedData": { "eventType": "Request" }, "properties": [ { "name": "routeId", "deviceId": "Header.Location.RouteID", "dataType": "String", "deviceType": "String", "extendedData": {}, "isReadable": true, "isWritable": true }, { "name": "routeName", "deviceId": "Header.Location.RouteName", "dataType": "String", "deviceType": "String", "extendedData": {}, "isReadable": true, "isWritable": true }, { "name": "equipmentID", "deviceId": "Header.Location.EquipmentID", "dataType": "String", "deviceType": "String", "extendedData": {}, "isReadable": true, "isWritable": true }, { "name": "equipmentName", "deviceId": "Header.Location.EquipmentName", "dataType": "String", "deviceType": "String", "extendedData": {}, "isReadable": true, "isWritable": true }, { "name": "zoneId", "deviceId": "Header.Location.ZoneID", "dataType": "String", "deviceType": "String", "extendedData": {}, "isReadable": true, "isWritable": true }, { "name": "zonePos", "deviceId": "Header.Location.ZonePos", "dataType": "String", "deviceType": "String", "extendedData": {}, "isReadable": true, "isWritable": true }, { "name": "zoneName", "deviceId": "Header.Location.ZoneName", "dataType": "String", "deviceType": "String", "extendedData": {}, "isReadable": true, "isWritable": true }, { "name": "laneNo", "deviceId": "Header.Location.LaneNo", "dataType": "String", "deviceType": "String", "extendedData": {}, "isReadable": true, "isWritable": true }, { "name": "barcode", "deviceId": "Body.Pcb.Barcode", "dataType": "String", "deviceType": "String", "extendedData": {}, "isReadable": true, "isWritable": true }, { "name": "modelCode", "deviceId": "Body.Pcb.ModelCode", "dataType": "String", "deviceType": "String", "extendedData": {}, "isReadable": true, "isWritable": true }, { "name": "serialNo", "deviceId": "Body.Pcb.SerialNo", "dataType": "String", "deviceType": "String", "extendedData": {}, "isReadable": true, "isWritable": true }, { "name": "pcbSide", "deviceId": "Body.Pcb.Side", "dataType": "String", "deviceType": "String", "extendedData": {}, "isReadable": true, "isWritable": true }, { "name": "scannerMountSide", "deviceId": "Body.Pcb.ScannerMountSide", "dataType": "String", "deviceType": "String", "extendedData": {}, "isReadable": true, "isWritable": true } ], } ``` As you can see the `Header` type allows us to have much simpler definitions that focus on what we really want to retrieve. The `Body` datatype will be used to represent cases where we want to receive simply the body as an object. In the event define the automation property as a `Body` device type. ## Extended Data See [Extended Data](../index.md#extended-data) for the concept behind these protocol-specific attributes. The PanaCIM driver declares extended data for events, event properties, commands, and command parameters. Properties have no extended data. ### Event | Name | Type | Possible Values | Default Value | Description | | --------- | ---- | -------------------- | ------------- | ---------------------------------------------------------------------------------------------------------- | | eventType | Enum | `Event`
`Request` | `Event` | Type of event received from PanaCIM. `Event` is a notification. `Request` expects a reply for the request. | Table: PanaCIM specific extended event attributes ### Event Property | Name | Type | Possible Values | Default Value | Description | | ---- | ------ | --------------- | ------------- | -------------------------------------------------------------------------------------------- | | path | String | | | Optional event-specific path used to retrieve the property value from the received message. | Table: PanaCIM specific extended event property attributes The device ID of a property is the path that describes the property in the message XML, for example `Body.Pcb.Barcode`. When an event occurs, the driver retrieves the value of each event property using the `path` extended data of the event property, if it is set. Otherwise, the driver uses the device ID of the property. Use the event-specific `path` when one property is shared by events with different message layouts. In the following example, the `barcode` property keeps the device ID `Body.Pcb.Barcode` for the other events, and the driver reads the value from `Body.Result.Barcode` for this event: ```json { "name": "barcode", "deviceId": "Body.Pcb.Barcode", "dataType": "String", "deviceType": "String", "extendedData": { "path": "Body.Result.Barcode" }, "isReadable": true, "isWritable": true } ``` ### Command | Name | Type | Possible Values | Default Value | Description | | ------------- | ---- | -------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | executionMode | Enum | `Publish`
`SendRequest` | `SendRequest` | Defines the mode of the execute command. `Publish` publishes the message as an event. `SendRequest` sends a request and expects a reply. | Table: PanaCIM specific extended command attributes ### Command Parameter | Name | Type | Possible Values | Default Value | Description | | ---------------- | ------ | --------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | path | String | | | Path to the parameter in the XML structure, for example `Header.Location.RouteID`. When empty, a parameter with the `Header` or `Body` device type maps to the whole message header or body. | | objectDefinition | Object | | | Applies to the `List` device type. Expects an array of objects with `path`, `name`, and `type`, for example `[{ "path": "Product.Name", "name": "Name", "type": "String" }]`. See the `List` data type in [Data Types](#data-types). | Table: PanaCIM specific extended command parameter attributes ## Supported Functionalities The PanaCIM tasks package (`controller-engine-panacim-tasks`) has direct support for the following tasks/functionalities: | Task | PanaCIM Functionality | Description | | ---------------------------------- | --------------------- | ------------------------------------------------------------- | | onPanacimRequest, sendPanacimReply | PCB-ID Request | PCB Interlocking | | executeCommand | Request Message | Request Message '553' - Total Placement data, '601' - PCB End | ## Protocol Parameters The protocol supports the following parameters, used to define the communication parameters, as well as the expected behavior of the driver: | Name | Type | Possible Values | Default Value | Description | | ------------------------ | ------- | --------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | address | String | | `"0.0.0.0"` | Address where the PanaCim interface will be connecting to. | | port | Integer | | `0` | Port where PanaCim interface will be connecting to. | | family | Enum | `IPV4, IPV6` | `IPV4` | Version of IP stack, can be either 4 or 6. Default: 4. | | keepAliveTime | Integer | | `10000` | Time interval to send the for the server to consider the client connected (ms). | | keepAliveTimeout | Integer | | `150000` | The PanaCIM issues a connection check request (PING) to the host computer at regular intervals (default: 120 seconds). PING timeout (ms) - timeout to receive a PING from equipment (default: 150 seconds). | | maxClients | Integer | | `10` | Maximum Number of concurrent clients the server can have connected at the same time. | | equipmentRequestTimeout | Integer | | `10000` | Timeout to Requests sent to controller (ms). | | controllerRequestTimeout | Integer | | `10000` | Timeout to Requests sent to equipment (ms). | ## Driver Extensions {% include-markdown 'includes/pages/iot_driver_extensions_deprecated.md' %} This protocol driver provides a set of extension that allow the customization to perform actions that are independent of the Driver Definitions associated. This means you can, using customization, register events that are not present in the Driver Definition. > This is particularly useful when accessing equipment data that is shared/too complex to access using the regular mechanisms. Also useful when needing to access data whose naming convention may vary from device to device. ### Objects The objects are structures that are either passed as parameters or returned as result values. #### RegisterHandler | Name | Type | Description | | ----- | ------- | ------------------------------------ | | event | `Event` | Event to register (full information) | #### UnregisterHandler | Name | Type | Description | | ----- | ------- | ------------------------------------------------------------------- | | event | `Event` | Event to unregister (at least the property `name` must be supplied) | ### Methods #### Register Event Notifies the protocol driver to raise the occurrences of a specific PanaCIM message type when it occurs. **Signature** ```ts void connect.iot.driver.panacim.registerEvent(data: Event) ``` **Example** Notify `connect.iot.driver.panacim.registerEvent` #### Unregister Event Notifies the protocol driver to stop raising the occurrences of a specific message when it occurs. **Signature** ```ts void connect.iot.driver.panacim.unregisterEvent(data: Event) ``` **Example** Notify `connect.iot.driver.panacim.unregisterEvent` ```json { "name": "EventName" } ``` #### Execute Command Executes a custom command. **Signature** ```ts any connect.iot.driver.panacim.executeCommand(data: ExecuteCommand) ``` **Example** SendRequest `connect.iot.driver.panacim.executeCommand`