User manual

TMCM-1180 and PD86-1180 TMCL Firmware V4.42 Manual (Rev. 1.08 / 2012-NOV-20) 10
www.trinamic.com
4.2 Testing with a simple TMCL program
Open the file test2.tmc. Change the motor number 2 in the second paragraph in motor number 0 (because
there is only one motor involved). Now your test program looks as follows:
A description for the TMCL™ commands can be found in Appendix A.
Assemble
Download Run
Stop
1. Click on Icon Assemble to convert the TMCL™ into machine code.
2. Then download the program to the TMCM-1180 module via the icon Download.
3. Press icon Run. The desired program will be executed.
4. Click Stop button to stop the program.
//A simple example for using TMCL and TMCL-IDE
ROL 0, 500 //Rotate motor 0 with speed 500
WAIT TICKS, 0, 500
MST 0
ROR 0, 250 //Rotate motor 0 with 250
WAIT TICKS, 0, 500
MST 0
SAP 4, 0, 500 //Set max. Velocity
SAP 5, 0, 50 //Set max. Acceleration
Loop: MVP ABS, 0, 10000 //Move to Position 10000
WAIT POS, 0, 0 //Wait until position reached
MVP ABS, 0, -10000 //Move to Position -10000
WAIT POS, 0, 0 //Wait until position reached
JA Loop //Infinite Loop