TMCM-142 TMCL
TM
Firmware Manual (V1.06 / 2014-JUN-24)
13
Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG
5.2
Testing with a simple TMCL
TM
program
Open the file test2.tmc. The following source code appears on the screen:
A description for the TMCL™ commands can be found in Appendix A.
Assemble
Download
Run
Stop
7.
Click on Icon
Assemble
to convert the TMCL™ into machine code.
8.
Then download the program to the TMCM-142 module via the icon
Download
.
9.
Press icon
Run
. The desired program will be executed.
10.
Click
Stop
button to stop the program.
//A simple example for using TMCL
™
and TMCL-IDE
ROL
0, 500000
//Rotate motor 0 with speed 500000
WAIT
TICKS
, 0, 500
MST
0
ROR
0, 250000
//Rotate motor 1 with 250000
WAIT
TICKS
, 0, 500
MST
0
SAP
4, 0, 500000
//Set max. Velocity
SAP
5, 0, 50000
//Set max. Acceleration
Loop:
MVP
ABS
, 0, 10000000
//Move to Position 10000
WAIT
POS
, 0, 0
//Wait until position reached
MVP
ABS
, 0, -1000000
//
Move to Position -10000
WAIT
POS
, 0, 0
//Wait until position reached
JA
Loop
//Infinite Loop