10
UDP and TCP/IP Configuration
10.1
Communication
The CC320 can be configured via the Ethernet connection using UDP or TCP/IP. A
demonstration program with source code can be downloaded from www.gardasoft.com.
Communication consists of commands sent by the host (controlling PC). All output generated by
the command is returned in reply UDP or TCP/IP packets. The last character sent is “>” (“greater
than” symbol). Once this is received, the host knows that the command has been completed. It is
recommended that the host waits for the “>” symbol before sending the next command. UDP
communications are not guaranteed to arrive, so the host software must be able to cope with lost
messages.
Using the GT command, a host can request that a message is sent to it whenever an error occurs.
Commands from a host should be sent to destination port 30313. Any port number can be used
for the source port. Replies from the C320 are sent to the source port.
A TCP/IP connection timeouts and closes if it is idle for more than 10 seconds. The host must
send regular “heartbeat” commands (eg “VR”) to keep the link open.
10.2
Command Structure
Several commands can be put into one command line by separating them by a semi-colon (“;”).
A carriage return character should be sent to terminate the command line. The CC320 send any
replies to the commands and then send a ‘>’ character to indicate that the command line has been
completed.
Commands comprise a code of two letters followed by the parameters (if any) needed for the
command. Spaces in the commands are ignored.
Numeric parameters are separated by a comma (“,”). For a parameter which is a time period the
default units are milliseconds. “s”, “ms” or “us” can be added to the end of the number to
indicate seconds, milliseconds or microseconds. “K” can be used for 1000 encoder pulses and
“M” for 1000000 encoder pulses. For example:
Parameter
Meaning
0.1
0.1 milliseconds
200us
200 microseconds
0.1s
0.1 seconds
100
100 encoder pulses
15.5K
15500 encoder pulses
14.5M
14500000 encoder pulses