TMCM-142 TMCL
TM
Firmware Manual (V1.06 / 2014-JUN-24)
22
Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG
6.6
The ASCII interface
Since TMCL
TM
V3.21 there is also an ASCII interface that can be used to communicate with the module and
to send some commands as text strings.
The ASCII command line interface is entered by sending the binary command 139 (enter ASCII
mode).
Afterwards the commands are entered as in the TMCL-IDE. Please note that only those commands,
which can be used in direct mode, also can be entered in ASCII mode.
For leaving the ASCII mode and re-enter the binary mode enter the command
BIN
.
6.6.1
Format of the command line
As the first character, the address character has to be sent. The address character is
A
when the module
address is 1,
B
for modules with address 2 and so on. After the address character there may be spaces (but
this is not necessary). Then, send the command with its parameters. At the end of a command line a <CR>
character has to be sent.
Here are some examples for valid command lines:
AMVP ABS, 1, 50000
A MVP ABS, 1, 50000
AROL 2, 500
A MST 1
ABIN
These command lines would address the module with address 1. To address e.g. module 3, use address
character
C
instead of
A
. The last command line shown above will make the module return to binary mode.
6.6.2
Format of a reply
After executing the command the module sends back a reply in ASCII format. This reply consists of:
the address character of the host (host address that can be set in the module)
the address character of the module
the status code as a decimal number
the return value of the command as a decimal number
a <CR> character
So, after sending
AGAP 0, 1
the reply would be
BA 100 –5000
if the actual position of axis 1 is –5000,
the host address is set to 2 and the module address is 1. The value
100
is the status code 100 that means
command successfully executed
.
6.6.3
Commands that can be used in ASCII mode
The following commands can be used in ASCII mode: ROL, ROR, MST, MVP, SAP, GAP, STAP, RSAP, SGP, GGP,
STGP, RSGP, RFS, SIO, GIO, SAC, SCO, GCO, CCO, UF0, UF1, UF2, UF3, UF4, UF5, UF6, and UF7.
There are also special commands that are only available in ASCII mode:
BIN: This command quits ASCII mode and returns to binary TMCL
TM
mode.
RUN: This command can be used to start a TMCL
TM
program in memory.
STOP: Stops a running TMCL
TM
application.
6.6.4
Configuring the ASCII interface
The module can be configured so that it starts up either in binary mode or in ASCII mode.
Global
parameter 67 is used for this purpose
(please see also chapter 8.1). Bit 0 determines the startup mode: If
this bit is set, the module starts up in ASCII mode, else it will start up in binary mode (default). Bit 4 and
Bit 5 determine how the characters that are entered are echoed back. Normally, both bits are set to zero. In
this case every character that is entered is echoed back when the module is addressed. A Character can also