5. IO

5.1. Set Control Box Digital Output

1/**
2@brief Set control box digital output
3@param [in] id IO number, range [0~15]
4@param [in] status 0-off, 1-on
5@param [in] smooth 0-non-smooth, 1-smooth
6@param [in] block 0-blocking, 1-non-blocking
7@return Error code
8*/
9errno_t SetDO(int id, uint8_t status, uint8_t smooth, uint8_t block);

5.2. Set Tool Digital Output

1/**
2@brief Set tool digital output
3@param [in] id IO number, range [0~1]
4@param [in] status 0-off, 1-on
5@param [in] smooth 0-non-smooth, 1-smooth
6@param [in] block 0-blocking, 1-non-blocking
7@return Error code
8*/
9errno_t SetToolDO(int id, uint8_t status, uint8_t smooth, uint8_t block);

5.3. Set Control Box Analog Output

1/**
2@brief Set control box analog output
3@param [in] id IO number, range [0~1]
4@param [in] value Current or voltage percentage, range [0~100] corresponding to current [0~20mA] or voltage [0~10V]
5@param [in] block 0-blocking, 1-non-blocking
6@return Error code
7*/
8errno_t SetAO(int id, float value, uint8_t block);

5.4. Set Tool Analog Output

1/**
2@brief Set tool analog output
3@param [in] id IO number, range [0]
4@param [in] value Current or voltage percentage, range [0~100] corresponding to current [0~20mA] or voltage [0~10V]
5@param [in] block 0-blocking, 1-non-blocking
6@return Error code
7*/
8errno_t SetToolAO(int id, float value, uint8_t block);

5.5. Code Example for Setting Digital and Analog Outputs

 1int TestAODO(void)
 2{
 3ROBOT_STATE_PKG pkg = {};
 4FRRobot robot;
 5robot.LoggerInit();
 6robot.SetLoggerLevel(1);
 7int rtn = robot.RPC("192.168.58.2");
 8if (rtn != 0)
 9{
10return -1;
11}
12robot.SetReConnectParam(true, 30000, 500);
13uint8_t status = 1;
14uint8_t smooth = 0;
15uint8_t block = 0;
16for (int i = 0; i < 16; i++)
17{
18robot.SetDO(i, status, smooth, block);
19robot.Sleep(300);
20}
21status = 0;
22for (int i = 0; i < 16; i++)
23{
24robot.SetDO(i, status, smooth, block);
25robot.Sleep(300);
26}
27status = 1;
28for (int i = 0; i < 2; i++)
29{
30robot.SetToolDO(i, status, smooth, block);
31robot.Sleep(1000);
32}
33status = 0;
34for (int i = 0; i < 2; i++)
35{
36robot.SetToolDO(i, status, smooth, block);
37robot.Sleep(1000);
38}
39for (int i = 0; i < 100; i++)
40{
41robot.SetAO(0, i * 40.96, block);
42robot.Sleep(30);
43}
44for (int i = 0; i < 100; i++)
45{
46robot.SetToolAO(0, i * 40.96, block);
47robot.Sleep(30);
48}
49robot.CloseRPC();
50return 0;
51}

5.6. Get Control Box Digital Input

1/**
2@brief Get control box digital input
3@param [in] id IO number, range [0~15]
4@param [in] block 0-blocking, 1-non-blocking
5@param [out] result 0-low level, 1-high level
6@return Error code
7*/
8errno_t GetDI(int id, uint8_t block, uint8_t *result);

5.7. Get Tool Digital Input

1/**
2@brief Get tool digital input
3@param [in] id IO number, range [0~1]
4@param [in] block 0-blocking, 1-non-blocking
5@param [out] result 0-low level, 1-high level
6@return Error code
7*/
8errno_t GetToolDI(int id, uint8_t block, uint8_t *result);

5.8. Get Control Box Analog Input

1/**
2@brief Get control box analog input
3@param [in] id IO number, range [0~1]
4@param [in] block 0-blocking, 1-non-blocking
5@param [out] result Input current or voltage percentage, range [0~100] corresponding to current [0~20mS] or voltage [0~10V]
6@return Error code
7*/
8errno_t GetAI(int id, uint8_t block, float *result);

5.9. Get Tool Analog Input

1/**
2@brief Get tool analog input
3@param [in] id IO number, range [0]
4@param [in] block 0-blocking, 1-non-blocking
5@param [out] result Input current or voltage percentage, range [0~100] corresponding to current [0~20mS] or voltage [0~10V]
6@return Error code
7*/
8errno_t GetToolAI(int id, uint8_t block, float *result);

5.10. Get Robot End Point Record Button Status

1/**
2@brief Get robot end point record button status
3@param [out] state Button status, 0-pressed, 1-released
4@return Error code
5*/
6errno_t GetAxlePointRecordBtnState(uint8_t *state);

5.11. Get Robot End DO Output Status

1/**
2@brief Get robot end DO output status
3@param [out] do_state DO output status, do0~do1 correspond to bit1~bit2, starting from bit0
4@return Error code
5*/
6errno_t GetToolDO(uint8_t *do_state);

5.12. Get Robot Controller DO Output Status

1/**
2@brief Get robot controller DO output status
3@param [out] do_state_h DO output status, co0~co7 correspond to bit0~bit7
4@param [out] do_state_l DO output status, do0~do7 correspond to bit0~bit7
5@return Error code
6*/
7errno_t GetDO(uint8_t *do_state_h, uint8_t *do_state_l);

5.13. Code Example for Getting Robot DI and DO Status

 1int TestGetDIAI(void)
 2{
 3ROBOT_STATE_PKG pkg = {};
 4FRRobot robot;
 5robot.LoggerInit();
 6robot.SetLoggerLevel(1);
 7int rtn = robot.RPC("192.168.58.2");
 8if (rtn != 0)
 9{
10return -1;
11}
12robot.SetReConnectParam(true, 30000, 500);
13uint8_t status = 1;
14uint8_t smooth = 0;
15uint8_t block = 0;
16uint8_t di = 0, tool_di = 0;
17float ai = 0.0, tool_ai = 0.0;
18float value = 0.0;
19robot.GetDI(0, block, &di);
20printf("di0:%u\n", di);
21tool_di = robot.GetToolDI(1, block, &tool_di);
22printf("tool_di1:%u\n", tool_di);
23robot.GetAI(0, block, &ai);
24printf("ai0:%f\n", ai);
25tool_ai = robot.GetToolAI(0, block, &tool_ai);
26printf("tool_ai0:%f\n", tool_ai);
27uint8_t _button_state = 0;
28robot.GetAxlePointRecordBtnState(&_button_state);
29printf("_button_state is: %u\n", _button_state);
30uint8_t tool_do_state = 0;
31robot.GetToolDO(&tool_do_state);
32printf("tool DO state is: %u\n", tool_do_state);
33uint8_t do_state_h = 0;
34uint8_t do_state_l = 0;
35robot.GetDO(&do_state_h, &do_state_l);
36printf("DO state high is: %u \n DO state low is: %u\n", do_state_h, do_state_l);
37robot.CloseRPC();
38return 0;
39}

5.14. Wait for Control Box Digital Input

1/**
2@brief Wait for control box digital input
3@param [in] id IO number, range [0~15]
4@param [in] status 0-off, 1-on
5@param [in] max_time Maximum wait time, unit ms
6@param [in] opt Strategy after timeout, 0-stop program and prompt timeout, 1-ignore timeout and continue, 2-wait indefinitely
7@return Error code
8*/
9errno_t WaitDI(int id, uint8_t status, int max_time, int opt);

5.15. Wait for Control Box Multi-Channel Digital Input

 1/**
 2@brief Wait for control box multi-channel digital input
 3@param [in] mode 0-multi AND, 1-multi OR
 4@param [in] id IO number, bit0~bit7 correspond to DI0~DI7, bit8~bit15 correspond to CI0~CI7
 5@param [in] status 0-off, 1-on
 6@param [in] max_time Maximum wait time, unit ms
 7@param [in] opt Strategy after timeout, 0-stop program and prompt timeout, 1-ignore timeout and continue, 2-wait indefinitely
 8@return Error code
 9*/
10errno_t WaitMultiDI(int mode, int id, uint8_t status, int max_time, int opt);

5.16. Wait for Tool Digital Input

1/**
2@brief Wait for tool digital input
3@param [in] id IO number, range [0~1]
4@param [in] status 0-off, 1-on
5@param [in] max_time Maximum wait time, unit ms
6@param [in] opt Strategy after timeout, 0-stop program and prompt timeout, 1-ignore timeout and continue, 2-wait indefinitely
7@return Error code
8*/
9errno_t WaitToolDI(int id, uint8_t status, int max_time, int opt);

5.17. Wait for Control Box Analog Input

 1/**
 2@brief Wait for control box analog input
 3@param [in] id IO number, range [0~1]
 4@param [in] sign 0-greater than, 1-less than
 5@param [in] value Input current or voltage percentage, range [0~100] corresponding to current [0~20mS] or voltage [0~10V]
 6@param [in] max_time Maximum wait time, unit ms
 7@param [in] opt Strategy after timeout, 0-stop program and prompt timeout, 1-ignore timeout and continue, 2-wait indefinitely
 8@return Error code
 9*/
10errno_t WaitAI(int id, int sign, float value, int max_time, int opt);

5.18. Wait for Tool Analog Input

 1/**
 2@brief Wait for tool analog input
 3@param [in] id IO number, range [0]
 4@param [in] sign 0-greater than, 1-less than
 5@param [in] value Input current or voltage percentage, range [0~100] corresponding to current [0~20mS] or voltage [0~10V]
 6@param [in] max_time Maximum wait time, unit ms
 7@param [in] opt Strategy after timeout, 0-stop program and prompt timeout, 1-ignore timeout and continue, 2-wait indefinitely
 8@return Error code
 9*/
10errno_t WaitToolAI(int id, int sign, float value, int max_time, int opt);

5.19. Code Example for Waiting for Control Box Digital and Analog Input Signals

Changed in version C++SDK-v2.1.2.0.

 1int TestWaitDIAI(void)
 2{
 3ROBOT_STATE_PKG pkg = {};
 4FRRobot robot;
 5robot.LoggerInit();
 6robot.SetLoggerLevel(1);
 7int rtn = robot.RPC("192.168.58.2");
 8if (rtn != 0)
 9{
10return -1;
11}
12robot.SetReConnectParam(true, 30000, 500);
13uint8_t status = 1;
14uint8_t smooth = 0;
15uint8_t block = 0;
16uint8_t di = 0, tool_di = 0;
17float ai = 0.0, tool_ai = 0.0;
18float value = 0.0;
19rtn = robot.WaitDI(0, 1, 1000, 1);
20cout << "WaitDI over; rtn is: " << rtn << endl;
21robot.WaitMultiDI(1, 3, 3, 1000, 1);
22cout << "WaitDI over; rtn is: " << rtn << endl;
23robot.WaitToolDI(1, 1, 1000, 1);
24cout << "WaitDI over; rtn is: " << rtn << endl;
25robot.WaitAI(0, 0, 50, 1000, 1);
26cout << "WaitDI over; rtn is: " << rtn << endl;
27robot.WaitToolAI(0, 0, 50, 1000, 1);
28cout << "WaitDI over; rtn is: " << rtn << endl;
29robot.CloseRPC();
30return 0;
31}

5.20. Set Whether to Reset Control Box DO Output After Stop/Pause

New in version C++SDK-v2.1.5.0.

1/**
2* @brief Set whether to reset control box DO output after stop/pause
3* @param [in] resetFlag 0-do not reset; 1-reset
4* @param [in] reloadFlag Whether to reload after pause recovery, 0-do not load; 1-load
5* @return Error code
6*/
7errno_t SetOutputResetCtlBoxDO(int resetFlag, int reloadFlag = 0);

5.21. Set Whether to Reset Control Box AO Output After Stop/Pause

New in version C++SDK-v2.1.5.0.

1/**
2* @brief Set whether to reset control box AO output after stop/pause
3* @param [in] resetFlag  0-do not reset; 1-reset
4* @param [in] reloadFlag Whether to reload after pause recovery, 0-do not load; 1-load
5* @return Error code
6*/
7errno_t SetOutputResetCtlBoxAO(int resetFlag, int reloadFlag = 0);

5.22. Set Whether to Reset End Tool DO Output After Stop/Pause

New in version C++SDK-v2.1.5.0.

1/**
2* @brief Set whether to reset end tool DO output after stop/pause
3* @param [in] resetFlag  0-do not reset; 1-reset
4* @param [in] reloadFlag Whether to reload after pause recovery, 0-do not load; 1-load
5* @return Error code
6*/
7errno_t SetOutputResetAxleDO(int resetFlag, int reloadFlag = 0);

5.23. Set Whether to Reset End Tool AO Output After Stop/Pause

New in version C++SDK-v2.1.5.0.

1/**
2* @brief Set whether to reset end tool AO output after stop/pause
3* @param [in] resetFlag  0-do not reset; 1-reset
4* @param [in] reloadFlag Whether to reload after pause recovery, 0-do not load; 1-load
5* @return  Error code
6*/
7errno_t SetOutputResetAxleAO(int resetFlag, int reloadFlag = 0);

5.24. Set Whether to Reset Extension DO Output After Stop/Pause

New in version C++SDK-v2.1.5.0.

1/**
2* @brief Set whether to reset extension DO output after stop/pause
3* @param [in] resetFlag  0-do not reset; 1-reset
4* @param [in] reloadFlag Whether to reload after pause recovery, 0-do not load; 1-load
5* @return  Error code
6*/
7errno_t SetOutputResetExtDO(int resetFlag, int reloadFlag = 0);

5.25. Set Whether to Reset Extension AO Output After Stop/Pause

New in version C++SDK-v2.1.5.0.

1/**
2* @brief Set whether to reset extension AO output after stop/pause
3* @param [in] resetFlag  0-do not reset; 1-reset
4* @param [in] reloadFlag Whether to reload after pause recovery, 0-do not load; 1-load
5* @return  Error code
6*/
7errno_t SetOutputResetExtAO(int resetFlag, int reloadFlag = 0);

5.26. Set Whether to Reset SmartTool Output After Stop/Pause

New in version C++SDK-v2.1.5.0.

1/**
2* @brief Set whether to reset SmartTool output after stop/pause
3* @param [in] resetFlag  0-do not reset; 1-reset
4* @param [in] reloadFlag Whether to reload after pause recovery, 0-do not load; 1-load
5* @return  Error code
6*/
7errno_t SetOutputResetSmartToolDO(int resetFlag, int reloadFlag = 0);

5.27. Example Code for Setting LUA Program Output Reset After Stop/Pause

New in version C++SDK-v2.1.5.0.

 1int TestDOReset(void)
 2{
 3ROBOT_STATE_PKG pkg = {};
 4FRRobot robot;
 5robot.LoggerInit();
 6robot.SetLoggerLevel(3);
 7int rtn = robot.RPC("192.168.58.2");
 8if (rtn != 0)
 9{
10    return -1;
11}
12robot.SetReConnectParam(true, 30000, 500);
13for (int i = 0; i < 16; i++)
14{
15    robot.SetDO(i, 1, 0, 0);
16    robot.Sleep(200);
17}
18int resetFlag = 0;
19int resumeReloadFlag = 0;
20rtn = robot.SetOutputResetCtlBoxDO(resetFlag, resumeReloadFlag);
21robot.SetOutputResetCtlBoxAO(resetFlag, resumeReloadFlag);
22robot.SetOutputResetAxleDO(resetFlag, resumeReloadFlag);
23robot.SetOutputResetAxleAO(resetFlag, resumeReloadFlag);
24robot.SetOutputResetExtDO(resetFlag, resumeReloadFlag);
25robot.SetOutputResetExtAO(resetFlag, resumeReloadFlag);
26robot.SetOutputResetSmartToolDO(resetFlag, resumeReloadFlag);
27robot.ProgramLoad("/fruser/test.lua");
28robot.ProgramRun();
29robot.Sleep(2000);
30robot.PauseMotion();
31robot.Sleep(2000);
32robot.ResumeMotion();
33robot.Sleep(2000);
34robot.CloseRPC();
35return 0;
36}

5.28. Set Configurable CI Port Functions of the Control Box

 1/**
 2* @brief Set configurable CI port functions of the control box
 3* @param [in] config CI0-CI7 function codes;
 4* 0-None;1-Arc start success;2-Welder ready;3-Conveyor detection;4-Pause;5-Resume;6-Start;7-Stop;
 58-Pause/Resume;9-Start/Stop;10-Pedal drag;11-Move to home position;12-Manual/Auto switch;
 613-Wire search success;14-Motion interrupt;15-Start main program;16-Start rewind;17-Start confirmation;
 718-Photoelectric detection signal X;19-Photoelectric detection signal Y;20-External emergency stop input signal 1;21-External emergency stop input signal 2;
 822-Level 1 reduction mode;23-Level 2 reduction mode;24-Level 3 reduction mode (Stop);25-Resume welding;26-Terminate welding;
 927-Assist drag enable;28-Assist drag disable;29-Assist drag enable/disable;30-Clear all errors;
1031-Manual/Auto switch (high/low level);32-Enable;33-Disable;34-Enable/Disable (rising/falling edge);35-Fixed-point tracking start/end
11* @return Error code
12*/
13errno_t SetDIConfig(int config[8]);

5.29. Get Configurable CI Port Functions of the Control Box

 1/**
 2* @brief Get configurable CI port functions of the control box
 3* @param [in] config CI0-CI7 function codes;
 4* 0-None;1-Arc start success;2-Welder ready;3-Conveyor detection;4-Pause;5-Resume;6-Start;7-Stop;
 58-Pause/Resume;9-Start/Stop;10-Pedal drag;11-Move to home position;12-Manual/Auto switch;
 613-Wire search success;14-Motion interrupt;15-Start main program;16-Start rewind;17-Start confirmation;
 718-Photoelectric detection signal X;19-Photoelectric detection signal Y;20-External emergency stop input signal 1;21-External emergency stop input signal 2;
 822-Level 1 reduction mode;23-Level 2 reduction mode;24-Level 3 reduction mode (Stop);25-Resume welding;26-Terminate welding;
 927-Assist drag enable;28-Assist drag disable;29-Assist drag enable/disable;30-Clear all errors;
1031-Manual/Auto switch (high/low level);32-Enable;33-Disable;34-Enable/Disable (rising/falling edge);35-Fixed-point tracking start/end
11* @return Error code
12*/
13errno_t GetDIConfig(int config[8]);

5.30. Set Configurable CO Port Functions of the Control Box

 1/**
 2* @brief Set configurable CO port functions of the control box
 3* @param [out] config CO0-CO7 function codes;
 4* 0-None;1-Robot error;2-Robot in motion;3-Spray start/stop;4-Spray gun cleaning;5-Gas supply signal;6-Arc start signal;7-Jog wire feed;
 58-Reverse wire feed;9-JOB input port 1;10-JOB input port 2;11-JOB input port 3;12-Conveyor start/stop control;13-Robot paused;14-Reached home position;
 615-Reached interference area;16-Wire search start/stop control;17-Robot start completed;18-Program start/stop;19-Auto/Manual mode;20-Emergency stop output signal 1-Safety;
 721-Emergency stop output signal 2-Safety;22-Lua script program running/stopped;23-Safety status output-Safety;24-Protective stop status output-Safety;
 825-Robot in motion-Safety;26-Robot reduced mode-Safety;27-Robot non-reduced mode-Safety;28-Robot non-stopped;29-Robot error-Instruction point error;
 930-Robot error-Driver error;31-Robot error-Soft limit exceeded error;32-Robot error-Collision error;33-Robot error-Active slave count error;
1034-Robot error-Slave error;35-Robot error-IO error;36-Robot error-Gripper error;37-Robot error-File error;38-Robot error-Singular pose error;
1139-Robot error-Driver communication error;40-Robot error-Parameter error;41-Robot error-External axis soft limit exceeded error;42-Robot warning-Warning;
1243-Robot warning-Safety door warning;44-Robot warning-Motion warning;45-Robot warning-Interference area warning;46-Robot warning-Safety wall warning;
1347-Enable status;48-Auto lift during disconnection;49-Cube 1 interference warning;50-Cube 2 interference warning;51-Cube 3 interference warning;52-Cube 4 interference warning;
14* @return Error code
15*/
16errno_t SetDOConfig(int config[8]);

5.31. Get Configurable CO Port Functions of the Control Box

 1/**
 2* @brief Get configurable CO port functions of the control box
 3* @param [out] config CO0-CO7 function codes;
 4* 0-None;1-Robot error;2-Robot in motion;3-Spray start/stop;4-Spray gun cleaning;5-Gas supply signal;6-Arc start signal;7-Jog wire feed;
 58-Reverse wire feed;9-JOB input port 1;10-JOB input port 2;11-JOB input port 3;12-Conveyor start/stop control;13-Robot paused;14-Reached home position;
 615-Reached interference area;16-Wire search start/stop control;17-Robot start completed;18-Program start/stop;19-Auto/Manual mode;20-Emergency stop output signal 1-Safety;
 721-Emergency stop output signal 2-Safety;22-Lua script program running/stopped;23-Safety status output-Safety;24-Protective stop status output-Safety;
 825-Robot in motion-Safety;26-Robot reduced mode-Safety;27-Robot non-reduced mode-Safety;28-Robot non-stopped;29-Robot error-Instruction point error;
 930-Robot error-Driver error;31-Robot error-Soft limit exceeded error;32-Robot error-Collision error;33-Robot error-Active slave count error;
1034-Robot error-Slave error;35-Robot error-IO error;36-Robot error-Gripper error;37-Robot error-File error;38-Robot error-Singular pose error;
1139-Robot error-Driver communication error;40-Robot error-Parameter error;41-Robot error-External axis soft limit exceeded error;42-Robot warning-Warning;
1243-Robot warning-Safety door warning;44-Robot warning-Motion warning;45-Robot warning-Interference area warning;46-Robot warning-Safety wall warning;
1347-Enable status;48-Auto lift during disconnection;49-Cube 1 interference warning;50-Cube 2 interference warning;51-Cube 3 interference warning;52-Cube 4 interference warning;
14* @return Error code
15*/
16errno_t GetDOConfig(int config[8]);

5.32. Set Configurable End-CI Port Functions of the End-Effector

 1/**
 2* @brief Set configurable End-CI port functions of the end-effector
 3* @param [in] config End CI0-CI1 function codes;
 4* 0-None;1-Drag teaching tool switch;2-Point recording signal;3-Manual/Auto switch (pulse signal);4-TPD recording start/stop;5-Pause motion;
 56-Resume motion;7-Start;8-Stop;9-Pause/Resume;10-Start/Stop;11-Force sensor assist drag enable;12-Force sensor assist drag disable;
 613-Force sensor assist drag enable/disable;14-Laser detection signal X;15-Laser detection signal Y;16-PTP motion to home position;17-Motion interrupt, stop current motion based on signal;
 718-Start main program;19-Start rewind;20-Start confirmation;21-Resume welding;22-Terminate welding;23-Clear error;24-Manual/Auto switch (high/low level);
 825-Enable;26-Disable;27-Enable/Disable;28-Laser servo tracking start/stop signal;
 9* @return Error code
10*/
11errno_t SetToolDIConfig(int config[2]);

5.33. Get Configurable End-CI Port Functions of the End-Effector

 1/**
 2* @brief Get configurable End-CI port functions of the end-effector
 3* @param [out] config End CI0-CI1 function codes;
 4* 0-None;1-Drag teaching tool switch;2-Point recording signal;3-Manual/Auto switch (pulse signal);4-TPD recording start/stop;5-Pause motion;
 56-Resume motion;7-Start;8-Stop;9-Pause/Resume;10-Start/Stop;11-Force sensor assist drag enable;12-Force sensor assist drag disable;
 613-Force sensor assist drag enable/disable;14-Laser detection signal X;15-Laser detection signal Y;16-PTP motion to home position;17-Motion interrupt, stop current motion based on signal;
 718-Start main program;19-Start rewind;20-Start confirmation;21-Resume welding;22-Terminate welding;23-Clear error;24-Manual/Auto switch (high/low level);
 825-Enable;26-Disable;27-Enable/Disable;28-Laser servo tracking start/stop signal;
 9* @return Error code
10*/
11errno_t GetToolDIConfig(int config[2]);

5.34. Set Configurable CI Active State of the Control Box

1/**
2* @brief Set configurable CI active state of the control box
3* @param [in] config CI0-CI7 port active state; 0-active high; 1-active low
4* @return Error code
5*/
6errno_t SetDIConfigLevel(int config[8]);

5.35. Get Configurable CI Active State of the Control Box

1/**
2* @brief Get configurable CI active state of the control box
3* @param [out] config CI0-CI7 port active state; 0-active high; 1-active low
4* @return Error code
5*/
6errno_t GetDIConfigLevel(int config[8]);

5.36. Set Configurable CO Active State of the Control Box

1/**
2* @brief Set configurable CO active state of the control box
3* @param [in] config CO0-CO7 port active state; 0-active high; 1-active low
4* @return Error code
5*/
6errno_t SetDOConfigLevel(int config[8]);

5.37. Get Configurable CO Active State of the Control Box

1/**
2* @brief Get configurable CO active state of the control box
3* @param [out] config CO0-CO7 port active state; 0-active high; 1-active low
4* @return Error code
5*/
6errno_t GetDOConfigLevel(int config[8]);

5.38. Set Configurable CI Active State of the End-Effector

1/**
2* @brief Set configurable CI active state of the end-effector
3* @param [in] config CI0-CI1 port active state; 0-active high; 1-active low
4* @return Error code
5*/
6errno_t SetToolDIConfigLevel(int config[2]);

5.39. Get Configurable CI Active State of the End-Effector

1/**
2* @brief Get configurable CI active state of the end-effector
3* @param [out] config CI0-CI1 port active state; 0-active high; 1-active low
4* @return Error code
5*/
6errno_t GetToolDIConfigLevel(int config[2]);

5.40. Set Standard DI Active State of the Control Box

1/**
2* @brief Set standard DI active state of the control box
3* @param [in] config DI0-DI7 port active state; 0-active high; 1-active low
4* @return Error code
5*/
6errno_t SetStandardDILevel(int config[8]);

5.41. Get Standard DI Active State of the Control Box

1/**
2* @brief Get standard DI active state of the control box
3* @param [out] config DI0-DI7 port active state; 0-active high; 1-active low
4* @return Error code
5*/
6errno_t GetStandardDILevel(int config[8]);

5.42. Set Standard DO Active State of the Control Box

1/**
2* @brief Set standard DO active state of the control box
3* @param [in] config DO0-DO7 port active state; 0-active high; 1-active low
4* @return Error code
5*/
6errno_t SetStandardDOLevel(int config[8]);

5.43. Get Standard DO Active State of the Control Box

1/**
2* @brief Get standard DO active state of the control box
3* @param [out] config DO0-DO7 port active state; 0-active high; 1-active low
4* @return Error code
5*/
6errno_t GetStandardDOLevel(int config[8]);

5.44. Robot IO Configuration Code Example

 1int TestIOConfig()
 2{
 3    ROBOT_STATE_PKG pkg = {};
 4    FRRobot robot;
 5    robot.LoggerInit();
 6    robot.SetLoggerLevel(1);
 7    int rtn = robot.RPC("192.168.58.2");
 8    if (rtn != 0)
 9    {
10        return -1;
11    }
12    robot.SetReConnectParam(true, 30000, 500);
13    int setDIConfig[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
14    int getDIConfig[8] = { 0 };
15    rtn = robot.SetDIConfig(setDIConfig);
16    printf("SetDIConfig rtn is %d\n", rtn);
17    rtn = robot.GetDIConfig(getDIConfig);
18    printf("GetDIConfig rtn is %d, value is %d %d %d %d %d %d %d %d \n", rtn,
19        getDIConfig[0], getDIConfig[1], getDIConfig[2], getDIConfig[3], getDIConfig[4], getDIConfig[5], getDIConfig[6], getDIConfig[7]);
20    int setDOConfig[8] = { 9, 10, 11, 12, 13, 14, 15, 16 };
21    int getDOConfig[8] = { 0 };
22    rtn = robot.SetDOConfig(setDOConfig);
23    printf("SetDOConfig rtn is %d\n", rtn);
24    rtn = robot.GetDOConfig(getDOConfig);
25    printf("GetDOConfig rtn is %d, value is %d %d %d %d %d %d %d %d \n", rtn,
26        getDOConfig[0], getDOConfig[1], getDOConfig[2], getDOConfig[3], getDOConfig[4], getDOConfig[5], getDOConfig[6], getDOConfig[7]);
27    int setToolDIConfig[2] = { 17, 18 };
28    int getToolDIConfig[2] = { 0 };
29    rtn = robot.SetToolDIConfig(setToolDIConfig);
30    printf("SetToolDIConfig rtn is %d\n", rtn);
31    rtn = robot.GetToolDIConfig(getToolDIConfig);
32    printf("GetToolDIConfig rtn is %d, value is %d %d \n", rtn, getToolDIConfig[0], getToolDIConfig[1]);
33    int setDIConfigLevel[8] = { 1, 1, 1, 1, 0, 0, 0, 0 };
34    int getDIConfigLevel[8] = { 0 };
35    rtn = robot.SetDIConfigLevel(setDIConfigLevel);
36    printf("SetDIConfigLevel rtn is %d\n", rtn);
37    rtn = robot.GetDIConfigLevel(getDIConfigLevel);
38    printf("GetDIConfigLevel rtn is %d, value is %d %d %d %d %d %d %d %d \n", rtn,
39        getDIConfigLevel[0], getDIConfigLevel[1], getDIConfigLevel[2], getDIConfigLevel[3], getDIConfigLevel[4], getDIConfigLevel[5], getDIConfigLevel[6], getDIConfigLevel[7]);
40    int setDOConfigLevel[8] = { 0, 0, 0, 0, 1, 1, 1, 1 };
41    int getDOConfigLevel[8] = { 0 };
42    rtn = robot.SetDOConfigLevel(setDOConfigLevel);
43    printf("SetDOConfigLevel rtn is %d\n", rtn);
44    rtn = robot.GetDOConfigLevel(getDOConfigLevel);
45    printf("GetDOConfigLevel rtn is %d, value is %d %d %d %d %d %d %d %d \n", rtn,
46        getDOConfigLevel[0], getDOConfigLevel[1], getDOConfigLevel[2], getDOConfigLevel[3], getDOConfigLevel[4], getDOConfigLevel[5], getDOConfigLevel[6], getDOConfigLevel[7]);
47    int setToolDIConfigLevel[2] = { 1, 0 };
48    int getToolDIConfigLevel[2] = { 0 };
49    rtn = robot.SetToolDIConfigLevel(setToolDIConfigLevel);
50    printf("SetToolDIConfigLevel rtn is %d\n", rtn);
51    rtn = robot.GetToolDIConfigLevel(getToolDIConfigLevel);
52    printf("GetToolDIConfigLevel rtn is %d, value is %d %d \n", rtn, getToolDIConfigLevel[0], getToolDIConfigLevel[1]);
53    int setStandardDILevel[8] = { 1, 1, 1, 1, 0, 0, 0, 0 };
54    int getStandardDILevel[8] = { 0 };
55    rtn = robot.SetStandardDILevel(setStandardDILevel);
56    printf("SetStandardDILevel rtn is %d\n", rtn);
57    rtn = robot.GetStandardDILevel(getStandardDILevel);
58    printf("GetStandardDILevel rtn is %d, value is %d %d %d %d %d %d %d %d \n", rtn,
59        getStandardDILevel[0], getStandardDILevel[1], getStandardDILevel[2], getStandardDILevel[3], getStandardDILevel[4], getStandardDILevel[5], getStandardDILevel[6], getStandardDILevel[7]);
60    int setStandardDOLevel[8] = { 0, 0, 0, 0, 1, 1, 1, 1 };
61    int getStandardDOLevel[8] = { 0 };
62    rtn = robot.SetStandardDOLevel(setStandardDOLevel);
63    printf("SetStandardDOLevel rtn is %d\n", rtn);
64    rtn = robot.GetStandardDOLevel(getStandardDOLevel);
65    printf("GetStandsrdDOLevel rtn is %d, value is %d %d %d %d %d %d %d %d \n", rtn,
66        getStandardDOLevel[0], getStandardDOLevel[1], getStandardDOLevel[2], getStandardDOLevel[3], getStandardDOLevel[4], getStandardDOLevel[5], getStandardDOLevel[6], getStandardDOLevel[7]);
67    robot.Sleep(2000);
68    robot.CloseRPC();
69    robot.Sleep(1000);
70    return 0;
71}