Programming manual for Meca500 (for firmware 9.2.x)
15
TCP/IP COMMUNICATION
2. TCP/IP COMMUNICATION
The Meca500 robot must be connected to a computer or to a PLC over Ethernet. Commands may be
sent through Mecademic's web interface or through a custom computer program using either the
TCP/IP protocol, which is detailed in the remainder of this Section 2, or any of three cyclic protocols,
which will be detailed in the remainder of this manual. When the Meca500 communicates using the
TCP/IP protocol, it uses null-terminated ASCII strings. The default robot IP address is
192.168.0.100
,
and its default TCP port is 10000, referred to as the
control port
. Commands to and messages from
the robot are sent over the control port. The robot will periodically send data over TCP port 10001,
referred to as the
monitoring port
, at the rate specified by the
SetMonitoringInterval
command. This
data includes the joint set and TRF
pose (only when it changes), and other optional data enabled with
the
SetRealTimeMonitoring
command. To avoid desynchonization between the data received from
both parts, it is possible to send a copy of the monitoring port data to the control port data with the
SetCtrlPortMonitoring
command.
When using the TCP/IP protocol, the Meca500 can interpret two types of instructions:
motion commands
and
request commands
. Every command must end with the ASCII NUL character (\0) or end-of-line
character (\n). Commands are not case-sensitive.
Some command descriptions refer to
default values
: these are essentially variables that are initialized
every time the robot is activated. In contrast, certain parameter values are
persistants
: they have
manufacturer's default values, but the changes you make to these are written on an SD drive and persist
even if you power off the robot.
2.1. Motion commands
Motion commands are used to construct a trajectory for the robot. When the Meca500 receives a
motion command, it places it in a
motion queue
. The command will be run once all preceding commands
have been executed.
Most motion commands have arguments, but not all have default values (e.g., the argument for the
command
Delay
). The arguments for most motion commands are IEEE-754 floating-point numbers,
separated by commas and spaces (optional).
Motion commands do not generate a direct response and the only way to know exactly when a certain
motion command has been executed is to use the command
SetCheckpoint
(a response is then sent
when the checkpoint has been reached).
The robot sends a end-of-movement message (
EOM
, code 3004) whenever it has stopped moving, if
this option is activated with
SetEom
. Example: if three
MoveJoints
commands are sent with blending
enabled, the robot will send an EOM message only after all three
MoveJoints
commands have been
executed and the robot has come to a complete stop.
Furthermore, by default, the robot sends an end-of-block message (
EOB
, code 3012) every time the robot
has stopped moving and its motion queue is empty. For example, if both EOM and EOB messages are
enabled, and you immediately send a
MoveJoints
,
SetTrf
,
MovePose
and
Delay
command one after the
other, the robot will send an EOM message when it has stopped, and then an EOB message as soon as
the delay has elapsed.
Note that EOB and EOM messages should not be used to detect whether a sequence of motion
commands has been executed: communication delays mean that the robot may send an EOB message