CRI Ethernet Interface
The CRI interface allows remote applications to connect to a CPR robot controller (CPRog or TinyCtrl).
The remote application can request the following operations:
- Jog the robot arm in joint space or cartesian space (base or tool coordinate system xyzabc)
- Send commands: joint motion, linear motion, digital outputs, ...
- Start and stop programs. These can be stored programs or the commands just send.
- CPRog version V902-08-013 or higher (Updates can be found here: CPRog Updates) or a TinyCtrl embedded robot controller
Documentation and Example
- Documentation: CRI Interface Documentation
- Example code CRI client: C# source code in Visual Studio Express 2012 and the 2015 Visual Studio Community Edition. Other versions untested. The code shows how to connect, how to send the control commands and how to parse the robots answers. For a stable operation of course more means regarding e.g. fault detection and error recovery have to be taken. Do read the documentation in the link above.
CProg specific settings
These settings do not replace the Documentation in the link above, they merely allow you to get started quickly.
- Find the Project file for your robot and change the line starting with CRIServer Active to this:
<CRIServer Active="True" ServerIP="127.0.0.1" Definitions=" " Debug="True"/>
- Save and Start CPRog, ensure that the correct Project file is loaded.
- Compile and start the Example program. In the example Program, enter the IP 127.0.0.1 and click on "Connect to CRI server".
- The example code does not have a button connects CPRog to the Robot. This can be done by hand in CPRog. Alternatively the Project file can be edited, so that CPRog auto-connects on startup. This is accomplished by enabling the PLC Interface. As a side effect this configures the DIO module as described on the page PLC Interface. In order to free up the DIO channels, you could set them to numbers outside of your DIO channel range, e.g. if you have a single DIO module, you could use channels 30, 31 and 32 so the the PLC interface section looks like this:
<PLCInterface Active="True" AutoConnect="True"/> <PLCInterfaceIn EnableNumber="30" RequestReferenceNumber="31" PlayNumber="32"/> <PLCInterfaceOut NoFaultNumber="31" ProgramRunningNumber="32" RobotIsReferenced="30"/>
- Start the Robot, the CPROg Software, and then the Example code. CPRog will now connect to the robot automatically.
- In the Example Program, enter 127.0.0.1 at the top left under Remote Control
- Now hit "Connect" to Establish a connection between the Example Program and CPRog.
- Click "Reset" and "Enable" to reset all errors and enable the motors.
- Now you can move the robot using the A1, A2,... buttons.