Connect IoT - IPC-CFX Driver#
IPC-CFX is an industry-developed open international standard forming the foundation/backbone of Factory of the Future applications. IPC-CFX is a plug-and-play solution that simplifies and standardizes machine-to-machine communication while also facilitating machine-to-business and business-to-machine applications.
IPC-CFX is based on IPC-2591, Connected Factory Exchange (CFX), and both are managed by the IPC 2-17 Connected Factory Initiative Subcommittee. The subcommittee ensures IPC-2591 and the IPC-CFX SDK continue to meet the growing needs of industry by releasing regular version updates.
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 |
Table: IPC-CFX specific data types.
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 |
|---|---|---|---|---|
| netCoreSdkVersion | String | 6.0.407 | \ | Set the .net core SDK version to use, when multiple are installed in the system where the driver is running. Leave empty to ignore this setting. |
| transportProtocol | Enum | AMQP | AMQP | Transport protocol used to communicate with the endpoints. |
| driverHandle | String | "" | Driver's CFX Handle (e.g. <maker>.<model>.<serial>). | |
| driverEndpoint | String | "" | Driver's CFX EndPoint URI (e.g. amqp://127.0.0.1:5673/). | |
| driverAddress | String | "" | Driver CFX Message Source (e.g. /queue/CFXHandle). Internal queue for sending messages. | |
| brokerEndpoint | String | "" | Broker EndPoint to connect to (e.g. amqp://127.0.0.1:5672/). | |
| brokerExchange | String | "" | The Broker exchange we are going to be publish to. (e.g. /exchange/CFXExchange). | |
| brokerQueue | String | "" | The Broker queue to be used to subscribe messages. (e.g. /queue/CFXQueue) | |
| targetHandle | String | "" | Target CFX Handle (e.g. <maker>.<model>.<serial>) - machine CFX Handle to communicate with. | |
| targetEndPoint | String | "" | Target CFX EndPoint (e.g. amqp://127.0.0.1:6000/) - machine CFX EndPoint to communicate with. | |
| targetAddress | String | "" | Target Address (e.g. /queue/Machine) - machine CFX Address to communicate with. | |
| username | String | "" | Username to use for authentication. | |
| password | String | "" | Password to use for authentication. | |
| certificatesRootFolder?? | String | ${temp}/ConnectIoT/IPC-CFX/Certificates/${id} | Absolute path of the root folder for the Public Key Infrastructure. Allows the use of tokens ${temp} or ${tmp} for the OS temporary folder and token ${id} for replacing with the respective driver instance id. | |
| certificate?? | Text | "" | Own certificate - can be either a path to a file or the contents of the file in plain text. Format should be pem. | |
| private key?? | Text | "" | Own private key - can be either a path to a file or the contents of the file in plain text. Format should be pem. | |
| connectionReconnectInterval | Integer | 30 | The time interval between attempts to reconnect to publish or subscriber channels after a network interruption, in seconds. | |
| connectionRequestTimeout | Integer | 30 | When executing a point to point request/response call to another CFX endpoint, this time span specifies the maximum amount of time that this endpoint will wait for the other endpoint to respond before timing out, in seconds. | |
| useLowLevelLogging | Boolean | false | Whether or not to use low level logging (transport layer logging). | |
| eventsExpiration | Integer | 30 | Time before an event is considered expired, in seconds. | |
| onRequestReceivedTimeoutReply | Integer | 30 | Internal time to wait for a reply to an external request, by the controller. | |
| messagesToIgnore | Text | "" | List of messages that are to be ignored and discarded. | |
| logMessagesFromOtherSources | Boolean | false | Whether or not to log messages from other sources (different from the TargetHandle). |
Table: IPC-CFX specific parameters.
.net Core SDK#
This driver requires minimal version .net core sdk 2.x to work, recommended is 6.x.
Note
If you have multiple versions of .net core installed, the driver will not know exactly which to use, so this setting is required to pinpoint exactly what to use.
Identify the installed versions#
Run the following command in a terminal/command prompt window:
and you should get a result. This one is just an example:
dotnet --list-sdks
2.2.207 [C:\Program Files\dotnet\sdk]
5.0.103 [C:\Program Files\dotnet\sdk]
6.0.407 [C:\Program Files\dotnet\sdk]
if you have multiple results, select the one that starts with "6." and enter it in the netCoreSdkVersion communication parameter. Using the above result as reference, the value set would be "6.0.407". The next time the driver starts, a control file global.json will be created at the base directory of the driver with the following content:
This will indicate the exact version of the .net core sdk to use when instancing a version of the driver.
Extended Parameters#
Event#
All Automation Events defined in the Driver Definition that use this protocol will have the following extended (extra) attributes available to customize
| Name | Type | Possible Values | Default Value | Description |
|---|---|---|---|---|
| eventType | Enum | EventRequest | Event | Type of event received from CFX network. Event - Notification, Request - Expects a reply for the request. |
Table: IPC-CFX specific extended events.
Command#
All Automation Command defined in the Driver Definition that use this protocol will have the following extended (extra) attributes available to customize
| Name | Type | Possible Values | Default Value | Description |
|---|---|---|---|---|
| executionMode | Enum | PublishSendRequest | SendRequest | Defines the mode of the execute command. Publish - publishes message as event, SendRequest - sends a request and expects a reply. |
| destination | Enum | ExchangeTargetHandleMessageSource | Exchange | Defines the destination of the command. It's only applied to the execution mode 'Publish'. |
Table: IPC-CFX specific command.
Driver Extensions#
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) |
Table: IPC-CFX specific handler registration.
UnregisterHandler#
| Name | Type | Description |
|---|---|---|
| event | Event | Event to unregister (at least the property name must be supplied) |
Table: IPC-CFX specific handler unregistration.
Methods#
Register Event#
Notifies the protocol driver to raise the occurrences of a specific IPC-CFX message type when it occurs.
void connect.iot.driver.ipccfx.registerEvent(data: Event)
Example#
Notify connect.iot.driver.ipccfx.registerEvent
{
"name": "EventName",
"deviceId": "CFX.ResourcePerformance.StationStateChanged",
"isEnabled": true,
"properties": [
{
"name": "oldState",
"deviceId": "OldState",
"deviceType": "Integer",
"dataType": "Integer"
},
{
"name": "oldStateDuration",
"deviceId": "OldStateDuration",
"deviceType": "String",
"dataType": "String"
},
{
"name": "newState",
"deviceId": "NewState",
"deviceType": "Integer",
"dataType": "Integer"
},
{
"name": "relatedFault",
"deviceId": "RelatedFault",
"deviceType": "String",
"dataType": "String"
}
]
}
Unregister Event#
Notifies the protocol driver to stop raising the occurrences of a specific message when it occurs.
void connect.iot.driver.ipccfx.unregisterEvent(data: Event)
Example#
Notify connect.iot.driver.ipccfx.unregisterEvent
Execute Command#
Executes a custom command.
any connect.iot.driver.ipccfx.executeCommand(data: ExecuteCommand)
Example#
SendRequest connect.iot.driver.ipccfx.executeCommand
{
"command": {
"name": "ActivateRecipeResponse",
"deviceId": "CFX.Production.ActivateRecipeResponse",
"extendedData": {
"executionMode": "SendRequest",
"destination": "TargetHandle"
},
"parameters": [
{
"name": "result",
"deviceId": "Result",
"dataType": "Object",
"deviceType": "Object",
"extendedData": {}
}
]
},
"parameters": {
"result": {
"Message": "OK",
"Result": "Success",
"ResultCode": 0
}
}
}