Difference between revisions of "CRI Ethernet Interface"

From Wiki
m (Link to Python library)
 
(25 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The CRI interface allows remote applications to connect to a CPR robot controller (CPRog or TinyCtrl).  
+
The CRI ethernet interface allows remote applications to connect to a robot controller: iRC, CPRog or the embedded control.  
 
   
 
   
[[File:CRI_Setup.PNG|CRI-Interface]]
+
[[File:CRI-robolink.JPG|600px|CRI-Interface]]
  
 
'''The remote application can request the following operations:'''
 
'''The remote application can request the following operations:'''
 
* Jog the robot arm in joint space or cartesian space (base or tool coordinate system xyzabc)
 
* Jog the robot arm in joint space or cartesian space (base or tool coordinate system xyzabc)
 
* Send commands: joint motion, linear motion, digital outputs, ...  
 
* Send commands: joint motion, linear motion, digital outputs, ...  
 +
* Change variables
 
* Start and stop programs. These can be stored programs or the commands just send.
 
* Start and stop programs. These can be stored programs or the commands just send.
  
 
==Requirements==
 
==Requirements==
* CPRog version V902-08-013 or higher (Updates can be found here: [[CPRog Updates]]) or a TinyCtrl embedded robot controller
+
* Using this interface requires programming experience in the client-server area.
 +
* iRC / CPRog version V902-11-011 or higher
 +
* Embedded Control with TinyCtrl version V980-11-087 or higher  
 +
* Updates can be found here: [[Software Updates]]
  
==Documentation and Example==
+
==Documentation and Examples==
* Documentation: [http://www.cpr-robots.com/download/CRI/CPR_RobotInterfaceCRI.pdf CRI Interface Documentation]  
+
* Video with short explanation: [https://www.youtube.com/watch?v=cxzvMmma97Q YouTube Video]
* Example code CRI client: [http://www.cpr-robots.com/download/CRI/CRI_Client.zip 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.
+
* Documentation:
<!--
+
** [[Media:CPR_RobotInterfaceCRI_V17.pdf|CRI V17 (since iRC/CPRog V14)]]
==Getting started==
+
** [[Media:CPR_RobotInterfaceCRI.pdf|CRI V16 (until iRC/CPRog V13)]]
IP addresses are:
+
** [[CRI Client Structure]] - basic guide for any programming language
*Local host:               127.0.0.1
+
** [[Transferring Robot Programs via CRI]] - advanced guide on how to send program files to the robot
*TinyCtrl on Phytec board:        192.168.3.11,  login as root without password
+
* Example code:
-->
+
** [https://github.com/CommonplaceRobotics/CRI-DemoClient CRI demo client] including source code in C#
===CProg specific settings===
+
** [[:File:Python_Minimal_Example.zip|Minimal example in Python]]
These settings do not replace the Documentation in the link above, they merely allow you to get started quickly.
+
** [https://github.com/CommonplaceRobotics/CRI-Python-Lib/ Python library]
* [[Robot Files and Project Files|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.[[file:CRI-autoconnectCPRog.png|frameless|300px]]
 
*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. [[file:CRI-connect-to-CPRog.png|frameless|300px]]
 
*Click "Reset" and "Enable" to reset all errors and enable the motors.
 
* Now you can move the robot using the A1, A2,... buttons.
 
  
[[Category:Downloads]]
+
== Controlling a simulation via CRI ==
 +
The CRI can be tested in simulation with iRC or CPRog. No real robot is needed.
 +
 
 +
=== Version 14 ===
 +
In version 14 the CRI is always available and does not need to be enabled.
 +
 
 +
Since the iRC user interface itself uses the CRI to control the simulation your CRI client will be connected passively first and must be set active before sending commands (see section "Multi client support" in the CRI documentation). This will make iRC a passive observer. Click "Reset" in iRC to make iRC become active again.
 +
 
 +
=== Version 11-13 ===
 +
In CPRog/iRC V11-007 to V13 the simulation can be controlled via CRI after enabling it in the backstage menu:
 +
* "File" -> "Configure Interfaces" -> "CRI Interface"
 +
* "Datei" -> "Schnittstellenkonfiguration" -> "CRI-Schnittstelle"
 +
 
 +
Click "Start" to enable the CRI server in CPRog/iRC. The status text will show the IP address and port that is being used. For local testing use the "Force IP address" checkbox and enter "127.0.0.1" into the text box.
 +
 
 +
[[File:CRI_Server_Config.PNG|600px]]
 +
 
 +
Unlike V14 the user interface does not use the CRI and therefore does not become passive.
 +
 
 +
==Further articles==
 +
* [[Remote Variable Access|Accessing program variables via CRI]]
 +
* [[Moving Robots via CRI]]
 +
* [[CRI Client Structure]]
 +
 
 +
[[Category:Downloads]][[Category:CPRog]][[Category:TinyCtrl]]

Latest revision as of 12:34, 1 August 2024

The CRI ethernet interface allows remote applications to connect to a robot controller: iRC, CPRog or the embedded control.

CRI-Interface

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, ...
  • Change variables
  • Start and stop programs. These can be stored programs or the commands just send.

Requirements

  • Using this interface requires programming experience in the client-server area.
  • iRC / CPRog version V902-11-011 or higher
  • Embedded Control with TinyCtrl version V980-11-087 or higher
  • Updates can be found here: Software Updates

Documentation and Examples

Controlling a simulation via CRI

The CRI can be tested in simulation with iRC or CPRog. No real robot is needed.

Version 14

In version 14 the CRI is always available and does not need to be enabled.

Since the iRC user interface itself uses the CRI to control the simulation your CRI client will be connected passively first and must be set active before sending commands (see section "Multi client support" in the CRI documentation). This will make iRC a passive observer. Click "Reset" in iRC to make iRC become active again.

Version 11-13

In CPRog/iRC V11-007 to V13 the simulation can be controlled via CRI after enabling it in the backstage menu:

  • "File" -> "Configure Interfaces" -> "CRI Interface"
  • "Datei" -> "Schnittstellenkonfiguration" -> "CRI-Schnittstelle"

Click "Start" to enable the CRI server in CPRog/iRC. The status text will show the IP address and port that is being used. For local testing use the "Force IP address" checkbox and enter "127.0.0.1" into the text box.

CRI Server Config.PNG

Unlike V14 the user interface does not use the CRI and therefore does not become passive.

Further articles