Trinamic 11-0011 TMCM-171 BLDC Output For 3-phase BLDC Motors 11-0011 Scheda Tecnica

Codici prodotto
11-0011
Pagina di 134
 
TMCL Reference Manual 
 
 
 
Trinamic Motion Control GmbH & Co KG 
Sternstraße 67 
D – 20357 Hamburg, Germany 
http://www.trinamic.com 
 
2.4.5  Calculation commands 
These commands are intended to be used for calculations within TMCL applications. Although they could also be 
used in direct mode it does not make much sense to do so. 
Mnemonic  Command 
number 
Meaning 
CALC 
19 
Calculate  using  the  accumulator  and  a 
constant value 
CALCX 
33 
Calculate  using  the  accumulator  and  the 
X register 
AAP 
34 
Copy accumulator to an axis parameter 
AGP 
35 
Copy accumulator to a global parameter 
For  calculating  purposes  there  is  an  accumulator  (or  accu  or  A  register)  and  an  X  register.  When  executed  in  a 
TMCL  program (in stand-alone  mode), all  TMCL commands that read a value store the result in the accumulator. 
The  X  register  can  be  used  as  an  additional  memory  when  doing  calculations.  It  can  be  loaded  from  the 
accumulator. 
When a command that reads a value is executed in direct mode the accumulator will not be affected. This means 
that  while  a  TMCL  program  is  running  on  the  module  (stand-alone  mode),  a  host  can  still  send  commands  like 
GAP, GGP or GIO to the module (e.g. to query the actual position of the motor) without affecting the flow of the 
TMCL program running on the module. 
2.5  The ASCII interface 
Since TMCL 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). The commands are then entered as in the TMCL IDE, but not all commands can be entered in 
ASCII mode. Only those commands that can be used in direct mode can also be entered in ASCII mode. 
To leave the ASCII mode and re-enter the binary mode enter the command “BIN”. 
2.5.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 would all 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. 
2.5.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