JSON protocol:
IO Configuration Command Set Controller IO
The Gen 4 quantity and classification are as follows:
| Type | Description |
|---|---|
| Digital IO: DO/DI multiplexing | 4 channels, 0 V-24 V available |
Set the digital IO mode set_IO_mode
- Input parameter
| Parameter | Type | Description |
|---|---|---|
set_IO_mode | string | Set the digital IO mode. |
IO_Num | int | IO port number, range: 1−4. |
IO_mode | int | Mode select. 0: general-purpose input mode. 1: general-purpose output mode. 2: input start function multiplexing mode. 3: input pause function multiplexing mode. 4: input resumption function multiplexing mode. 5: input emergency stop function multiplexing mode. 6: input to current loop drag multiplexing mode. 7: input to position-only drag mode (available for the 6-DoF force version). 8: input to orientation-only drag mode (available for the 6-DoF force version). 9: input to position-orientation drag multiplexing mode (available for the 6-DoF force version). 10: input maximum external axis soft limit multiplexing mode (available for external axis mode of expansion joints). 11: input minimum external axis soft limit multiplexing mode (available for external axis mode of expansion joints). 12: input initial pose function multiplexing mode (triggered by low level). 13: output collision function multiplexing mode (normal output: low level, error output: high level). 14: Real-Time Speed Adjustment Function Multiplexing Mode. |
realtime_speed | string | Optional parameter, set this parameter when IO_mode is set to 14 (Real-Time Speed Adjustment Function Multiplexing Mode). |
speed | int | Speed setting, value range 0-100. |
mode | int | Mode selection. 1-Single Trigger Mode, in single trigger mode, when IO is pulled low, the speed is set to the value of the speed parameter, and when the IO returns to a high level, the speed is set to the initial value; 2-Continuous Trigger Mode, in continuous trigger mode, when IO is pulled low, the speed is set to the value of the speed parameter, and when the IO returns to a high level, the speed maintains the current value. 3-Customize Level Speed Mode allows you to set the low-level speed and high-level speed independently. When enabled, the IO low-level speed is set to the value of the speed parameter, and the IO high-level speed is set to the value of the heightSpeed parameter. |
- Code demo
Input
Set the digital IO mode.
{"command":"set_IO_mode","IO_Num":1,"IO_mode":14,"realtime_speed":{"speed":50,"mode":1}}Output
Setting succeeded:
{
"command": "set_IO_mode",
"set_state": true
}Setting failed:
{
"command": "set_IO_mode",
"set_state": false
}Set the digital IO output stateset_DO_state
- Input parameter
| Parameter | Type | Description |
|---|---|---|
set_DO_state | string | Set the digital IO output state. |
IO_Num | int | IO port number, range: 1−4. |
state | int | IO state, 1: high output, 0: low output. |
- Code demo
Input
{"command":"set_DO_state","IO_Num":1,"state":1}Output
Setting succeeded:
{
"command": "set_DO_state",
"set_state": true
}Setting failed:
{
"command": "set_DO_state",
"set_state": false
}Get the digital IO state get_IO_state
- Input parameter
| Parameter | Type | Description |
|---|---|---|
get_IO_state | string | Get the digital IO output state. |
IO_Num | int | IO port number, range: 1−4. |
- Output parameter
| Parameter | Type | Description |
|---|---|---|
IO_Num | int | IO port number, range: 1−4. |
IO_mode | int | Output setting mode. 0 - General Purpose Input Mode; 1 - General Purpose Output Mode; 2 - Input Start Function Multiplexing Mode; 3 - Input Pause Function Multiplexing Mode; 4 - Input Resume Function Multiplexing Mode; 5 - Input Emergency Stop Function Multiplexing Mode; 6 - Input Current Loop Drag Multiplexing Mode; 7 - Input Force-Only Position Drag Mode; 8 - Input Force-Only Posture Drag Mode; 9 - Input Force-Position Hybrid Drag Multiplexing Mode; 10 - Input External Axis Maximum Soft Limit Multiplexing Mode; 11 - Input External Axis Minimum Soft Limit Multiplexing Mode; 12 - Input Initial Pose Function Multiplexing Mode; 13 - Output Collision Function Multiplexing Mode; 14 - Real-Time Speed Adjustment Function Multiplexing Mode. |
IO_State | int | IO status, 1 for high output, 0 for low output. |
realtime_speed | object | Optional parameter, returned when IO_mode is set to 14 (Real-Time Speed Adjustment Function Multiplexing Mode). |
speed | int | Output setting speed, value range 0-100. |
mode | int | Output setting mode. 1 - Single Trigger Mode, in single trigger mode, when the IO is pulled low, the speed is set to the value of the speed parameter, and when the IO returns to a high level, the speed is set to the initial value. 2 - Continuous Trigger Mode, in continuous trigger mode, when the IO is pulled low, the speed is set to the value of the speed parameter, and when the IO returns to a high level, the speed maintains the current value. 3-Customize Level Speed Mode allows you to set the low-level speed and high-level speed independently. When enabled, the IO low-level speed is set to the value of the speed parameter, and the IO high-level speed is set to the value of the heightSpeed parameter. |
- Code demo
Input
Get the digital IO output state
{"command":"get_IO_state","IO_Num":1}Output
{
"command":"get_IO_state",
"IO_Num": 1,
"IO_Mode": 14,
"IO_state": 1,
"realtime_speed":
{
"speed":50,
"mode":1
}
}Get all IO input statesget_IO_input
- Input parameter
| Parameter | Type | Description |
|---|---|---|
get_IO_input | string | Get all IO input states. |
- Output parameter
| Parameter | Type | Description |
|---|---|---|
DI | int | Digital input state, 1: high, 0: low. |
- Code demo
Input
Get all IO input states.
{"command":"get_IO_input"}Output
{
"command":"get_IO_input",
"DI": [
1,
1,
1
]
}Get all IO output statesget_IO_output
- Input parameter
| Parameter | Type | Description |
|---|---|---|
get_IO_output | string | Get all IO output states. |
- Output parameter
| Parameter | Type | Description |
|---|---|---|
DO | int | Digital output state, 1: high, 0: low. |
- Code demo
Input Get all IO output states.
{"command":"get_IO_output"}Output
{
"command":"get_IO_output",
"DO": [
1,
1,
1,
1
]
}Set the power output set_voltage
- Input parameter
| Parameter | Type | Description |
|---|---|---|
set_voltage | string | Set the power output. |
voltage_type | int | Power output type, range: 0-3. |
start_enable | bool | true means that the configured voltage will be output at startup, false means that the configured voltage at startup will be disabled. |
- Code demo
Input
Set the power output.
{"command":"set_voltage","voltage_type":2,"start_enable":true}Output
Setting succeeded:
{
"command": "set_voltage",
"state": true
}Setting failed:
{
"command": "set_voltage",
"state": false
}Get the power output get_voltage
- Input parameter
| Parameter | Type | Description |
|---|---|---|
get_voltage | string | Get the power output. |
- Output parameter
| Parameter | Type | Description |
|---|---|---|
voltage_type | int | Power output type, 0: 0 V, 2: 12 V, 3: 24 V. |
- Code demo
Input Get the controller power output type.
{"command":"get_voltage"}Output
{
"command": "voltage_state",
"voltage_type": 2
}End Effector IO
The end effector is equipped with IO ports, categorized and quantified as follows:
| Type | Description |
|---|---|
| Power output | One channel, 0 V/12 V/24 V available. |
| Digital IO | Two channels, input/output available. |
| Communication port | One channel, RS485 available. |
Set the tool-end digital IO output stateset_tool_DO_state
- Input parameter
| Parameter | Type | Description |
|---|---|---|
set_tool_DO_state | string | Set the digital IO output state. |
IO_Num | int | IO port number, range: 1−2. |
state | int | IO state, 1: high output, 0: low output. |
- Code demo
Input Set the tool-end digital IO output state.
{"command":"set_tool_DO_state","IO_Num":1,"state":1}Output Setting succeeded:
{
"command": "set_tool_DO_state",
"set_state": true
}Setting failed:
{
"command": "set_tool_DO_state",
"set_state": false
}Set the tool-end digital IO modeset_tool_IO_mode
- Input parameter
| Parameter | Type | Description |
|---|---|---|
set_tool_IO_mode | string | Set the digital IO mode. |
IO_Num | int | IO port number, range: 1−2. |
state | int | IO state, 0: input mode, 1: output mode. |
- Code demo
Input Set the digital IO mode
{"command":"set_tool_IO_mode","IO_Num":1,"state":0}Output Setting succeeded:
{
"command": "set_tool_IO_mode",
"set_state": true
}Setting failed:
{
"command": "set_tool_IO_mode",
"set_state": false
}Get the tool-end digital IO stateget_tool_IO_state
- Input parameter
| Parameter | Type | Description |
|---|---|---|
get_tool_IO_state | string | Get the digital IO state. |
- Output parameter
| Parameter | Type | Description |
|---|---|---|
IO_Mode | int | 0: input mode, 1: output mode. |
IO_State | int | IO state, 1: high output, 0: low output. |
- Code demo
Input Get the digital IO state.
{"command":"get_tool_IO_state"}Output
{
"command":"get_tool_IO_state",
"IO_Mode": [
0,
1
],
"IO_State": [
0,
1
]
}Set the tool-end power outputset_tool_voltage
- Input parameter
| Parameter | Type | Description |
|---|---|---|
set_tool_voltage | string | Set the power output. |
voltage_type | int | Power output type, 0: 0 V, 2: 12 V, 3: 24 V. |
- Code demo
Input Set the power output
{"command":"set_tool_voltage","voltage_type":2}Output Setting succeeded
{
"command": "set_tool_voltage",
"state": true
}Setting failed
{
"command": "set_tool_voltage",
"state": false
}Get the tool-end power outputget_tool_voltage
- Input parameter
| Parameter | Type | Description |
|---|---|---|
get_tool_voltage | string | Get the power output. |
- Output parameter
| Parameter | Type | Description |
|---|---|---|
get_tool_voltage | int | Power output type, 0: 0 V, 2: 12 V, 3: 24 V. |
- Code demo
Input Get the power output type
{"command":"get_tool_voltage"}Output
{
"command":"get_tool_voltage",
"voltage_type": 2
}
