User manual

TMCM-1141 TMCL Firmware V1.19 Manual (Rev. 1.01 / 2012-JUL-27) 2
www.trinamic.com
Table of Contents
1 Features ........................................................................................................................................................................... 4
2 Putting the Module into Operation ........................................................................................................................ 6
2.1 Basic Set-Up .......................................................................................................................................................... 6
2.1.1 Start the TMCL-IDE Software Development Environment ................................................................. 8
2.2 Using TMCL Direct Mode .................................................................................................................................... 9
2.2.1 Important Motor Settings ......................................................................................................................... 10
2.3 Testing with a Simple TMCL Program ......................................................................................................... 11
3 TMCL and the TMCL-IDE: Introduction ................................................................................................................. 12
3.1 Binary Command Format ................................................................................................................................ 12
3.1.1 Checksum Calculation ................................................................................................................................ 13
3.2 Reply Format ....................................................................................................................................................... 13
3.2.1 Status Codes ................................................................................................................................................. 14
3.3 Standalone Applications .................................................................................................................................. 14
3.4 TMCL Command Overview .............................................................................................................................. 15
3.4.1 TMCL Commands ......................................................................................................................................... 15
3.4.2 Commands Listed According to Subject Area .................................................................................... 16
3.5 The ASCII Interface ........................................................................................................................................... 20
3.5.1 Format of the Command Line ................................................................................................................. 20
3.5.2 Format of a Reply ....................................................................................................................................... 20
3.5.3 Configuring the ASCII Interface ............................................................................................................. 21
3.6 Commands ........................................................................................................................................................... 22
3.6.1 ROR (rotate right) ....................................................................................................................................... 22
3.6.2 ROL (rotate left) ........................................................................................................................................... 23
3.6.3 MST (motor stop)......................................................................................................................................... 24
3.6.4 MVP (move to position) ............................................................................................................................ 25
3.6.5 SAP (set axis parameter) ........................................................................................................................... 27
3.6.6 GAP (get axis parameter) .......................................................................................................................... 28
3.6.7 STAP (store axis parameter) ..................................................................................................................... 29
3.6.8 RSAP (restore axis parameter) ................................................................................................................. 30
3.6.9 SGP (set global parameter) ...................................................................................................................... 31
3.6.10 GGP (get global parameter)...................................................................................................................... 32
3.6.11 STGP (store global parameter) ................................................................................................................ 33
3.6.12 RSGP (restore global parameter) ............................................................................................................ 34
3.6.13 RFS (reference search) ................................................................................................................................ 35
3.6.14 SIO (set output) ........................................................................................................................................... 36
3.6.15 GIO (get input/output) ............................................................................................................................... 38
3.6.16 CALC (calculate) ............................................................................................................................................ 40
3.6.17 COMP (compare)........................................................................................................................................... 41
3.6.18 JC (jump conditional) ................................................................................................................................. 42
3.6.19 JA (jump always) ......................................................................................................................................... 43
3.6.20 CSUB (call subroutine) ............................................................................................................................... 44
3.6.21 RSUB (return from subroutine) ................................................................................................................ 45
3.6.22 WAIT (wait for an event to occur) ......................................................................................................... 46
3.6.23 STOP (stop TMCL program execution) ................................................................................................... 47
3.6.24 SCO (set coordinate) ................................................................................................................................... 48
3.6.25 GCO (get coordinate) .................................................................................................................................. 49
3.6.26 CCO (capture coordinate) .......................................................................................................................... 50
3.6.27 ACO (accu to coordinate) .......................................................................................................................... 51
3.6.28 CALCX (calculate using the X register) .................................................................................................. 52
3.6.29 AAP (accumulator to axis parameter) .................................................................................................... 53
3.6.30 AGP (accumulator to global parameter) ............................................................................................... 54
3.6.31 CLE (clear error flags) ................................................................................................................................. 55
3.6.32 VECT (set interrupt vector) ........................................................................................................................ 56
3.6.33 EI (enable interrupt) ................................................................................................................................... 57
3.6.34 DI (disable interrupt) .................................................................................................................................. 58
3.6.35 RETI (return from interrupt) ..................................................................................................................... 59