Customize Robot Drivers

Robot drivers are in the folder /RoboDK/api/Robot/ by default. RoboDK links to a specific driver in the robot connection settings:

1.Right click a robot

2.Select Robot Drivers - Image 8 Connect to robot…

3.Select More options…

4.Locate or enter the path of the driver path in the Driver path section

One robot driver is a standalone console application. Robot drivers can be developed using any programming platform, for example, they can be a Python module (PY format) or any executable programs built under any development environment.

Robot Drivers - Image 9

The robot driver allows communicating with a robot through the command line. The same commands that can be manually executed are also used by RoboDK to drive the robot from the PC. Each robot driver can be run in console mode to test it.

A sample Python driver (apimecademic.py) with its source code to control Mecademic robots is available in C:/RoboDK/bin/robot/.

Double click the apimecademic.py file to run the module in console mode (Python must be installed). The driver will wait for any new commands. For example, we can type the following command to connect to the robot provided an IP and a communication port:

CONNECT 192.168.100.1 10000

If the connection succeeds we should see a SMS:Ready message. Then, we can type the following command to retrieve the current robot joints:

CJNT

We can also type other commands such as MOVJ, MOVL or SETTOOL to move the robot or update the TCP:

MOVJ 10 20 30 40 50 60

Robot Drivers - Image 10

Some robots support monitoring the joint position in real time. In this case it is possible to provide joint position feedback as the robot moves by sending the JNTS_MOVING command. When the driver is run from RoboDK, the virtual robot will follow the movement of the real robot in real time. A new command will not be processed until the Ready message is sent.

The interaction with the console and the connection to the robot are managed by the one Python module for the Mecademic driver. The interaction with the console should be the same for all robots, as described in this section. However, the interaction with each robot depends on the robot manufacturer, in this case we referred to the Meca 500 programming manual to send the appropriate commands. These commands allow moving and monitor the Meca 500 robot.