User Guide

8. Interfacing
8.1 Command „External Motion“
Using the „External Motion“ command is an easy way to integrate external control,
e.g. a vision system.
<ExMotion Nr="1" IP="127.0.0.1" Port="1234" Scale="10" Descr="" />
When the robot reaches this command in program replay he hands control over to
the external program. He gets connected defined by IP address and port. The scale
parameter adapts the velocity.
The steps are:
When starting the robot program CPRog connects as client at the server at
IP:Port. CPRog needs to have the necessary rights to do so!
When the ExternalMotion command is reached CPRog sends the current
position in 20 Hz cycles to the server and expects the XYZABC set point
velocity as answer.
o From the robot:
„Pos 234.0 123.1 987.3 0.0 90.0 0.0 8\n“
o
Pos: Keyword
o
234.0 123.1 … Position as xyzabc
o
8 An int with the binary coded Din at the base
o Answer:
„Dir 95.0 14.1 -30.0 0.0 0.0 0.0 open 8\n“
o
Dir Keyword
o
95.0 14.1 … Relative velocites [-100.0 .. 100.0]
o
open Gripper state, „open“ or „closed“
o
8 An int with the binary coded Dout at the robot
base
Both messages have to end with the character Newline ( „\n“ or 0x0A).
When finished the external control sends
„Done \n“ (with blank). Then the
robot proceeds in replaying the program.