Read and trigger I/Os on the robot controller
The 4.10 version of Fuzzy RTOS added the ability to read & trigger I/Os from the robot controller.
This feature is only available on ABB and Fanuc controllers (more to come).
I/O requests are handled asynchronously from the Fuzzy RTOS runtime’s realtime control loop and typically execute within in a few milliseconds.
warning
🚧 This feature is considered as beta. It is subject to changes between the next version to stabilize the API. Your feedback is important !
Configure I/Os on ABB controllers
- Underlying API: Robot Web Services
- I/Os must be configured in RobotStudio
- The full name of an I/O is
{network}/{device}/{name}
(eg:IntBus/EPanel/EStopStatus
). Slashes must be encoded as%2F
when used in URLs of single-io endpoints.
Configure I/Os on Fanuc controllers
- Underlying API: Modbus TCP
- Modbus must be enabled on the controller (
$SNPX_PARAM.$NUM_MODBUS=1
and$SNPX_PARAM .$MODBUS_PORT=502
) - All controller I/Os are available
I/O API
The following REST endpoints are now available:
- /ios (GET): get the list of available I/Os
Curl request
curl --location --request GET 'http://fuzzy-rtos:8000/ios'
Possible response
{
"header": { "timestamp": "2024-02-26T14:54:38.542577400Z" },
"ios": [
{
"firstIo": {
"name": "DI",
"ioType": "IOTYPE_INPUT",
"valueType": "IODATATYPE_BOOL",
"value": "",
"index": 1
},
"quantity": 10000
},
{
"firstIo": {
"name": "RI",
"ioType": "IOTYPE_INPUT",
"valueType": "IODATATYPE_BOOL",
"value": "",
"index": 1
},
"quantity": 10000
},
{
"firstIo": {
"name": "UI",
"ioType": "IOTYPE_INPUT",
"valueType": "IODATATYPE_BOOL",
"value": "",
"index": 1
},
"quantity": 10000
},
{
"firstIo": {
"name": "UO",
"ioType": "IOTYPE_OUTPUT",
"valueType": "IODATATYPE_BOOL",
"value": "",
"index": 1
},
"quantity": 1000
},
// etc...
]
}
- /ios/read (GET): read ranges of I/Os
Sample body to read DI[2-3] and RI[1]
{
"ioRanges": [
{
"firstIo": {
"name": "DI",
"index": 2
},
"quantity": 2
},
{
"firstIo": {
"name": "RI",
"index": 1
},
"quantity": 1
}
]
}
Curl request to read DI[2-3] and RI[1]
curl --location --request GET 'http://fuzzy-rtos:8000/ios/read' \
--header 'Content-Type: application/json' \
--data '{
"ioRanges": [
{
"firstIo": {
"name": "DI",
"index": 2
},
"quantity": 2
},
{
"firstIo": {
"name": "RI",
"index": 1
},
"quantity": 1
}
]
}'
Possible response
{
"header": { "timestamp": "2024-02-26T14:57:41.568520500Z" },
"ios": [
{
"name": "DI",
"ioType": "IOTYPE_INPUT",
"valueType": "IODATATYPE_BOOL",
"value": "0",
"index": 2
},
{
"name": "DI",
"ioType": "IOTYPE_INPUT",
"valueType": "IODATATYPE_BOOL",
"value": "0",
"index": 3
},
{
"name": "RI",
"ioType": "IOTYPE_INPUT",
"valueType": "IODATATYPE_BOOL",
"value": "0",
"index": 1
}
]
}
- /ios/write (POST): Write ranges of I/Os
Sample body to set DO[4] to 1 and RO[2] to 0
{
"ios": [
{
"name": "DO",
"value": "1",
"index": 4
},
{
"name": "RO",
"value": "0",
"index": 2
}
]
}
Curl request to set DO[4] to 1 and RO[2] to 0
curl --location --request POST 'http://fuzzy-rtos:8000/ios/write' \
--header 'Content-Type: application/json' \
--data '{
"ios": [
{
"name": "DO",
"index": 4,
"value": "1"
},
{
"name": "RO",
"index": 2,
"value": "0"
}
]
}'
We also provide single-io endpoints for convenience
- /ios/{io-name}?index={index} (GET): read a single I/O value
Curl request to read RI[3]
curl --location --request GET 'http://fuzzy-rtos:8000/ios/RI?index=3'
Possible response
{
"header": { "timestamp": "2024-02-26T15:06:36.057323200Z" },
"io": {
"name": "RI",
"ioType": "IOTYPE_INPUT",
"valueType": "IODATATYPE_BOOL",
"value": "0",
"index": 3
}
}
- /ios/{io-name}?index={index}&value={value} (POST): set a single I/O
Curl request to set GO[5] = 1
curl --location --request POST 'http://fuzzy-rtos:8000/ios/GO?index=5&value=1'