User Guide

27
8. Interfacing
8.1 Command „External Motion“
Using the „External Motion“ command it is easy to integrate and external control,
e.g. a vision system.
<ExMotion Nr="3" IP="127.0.0.1" Port="1234" Scale="5" />
When the robot reaches this command in program replay he hands control over to
the external program. He gets connected via an IP connection 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
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.