- No category
advertisement
TMCM-1110 TMCL™ Firmware V1.03 Manual (Ref. 1.07 / 2012-APR-11) 15
4.3.1 Testing with a Simple TMCL™ Program
Open the file test2.tmc of the TMCL-IDE. The test program is written for three motors. Change the motor numbers into 0, if only one motor is connected.
Now, the test program looks as follows:
//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
Assemble Stop
Download Run
1.
2.
3.
4.
Click on Icon Assemble to convert the TMCL™ into machine code.
Then download the program to the TMCM-1110 module via the icon Download.
Press icon Run. The desired program will be executed.
Click Stop button to stop the program.
4.4 TMCL™ Command Overview
In this section a short overview of the TMCL™ commands is given.
4.4.1 TMCL™ Commands
Command Number Parameter
ROR
ROL
1
2
<motor number>, <velocity>
<motor number>, <velocity>
MST
MVP
SAP
3
4
5
<motor number>
ABS|REL|COORD, <motor number>,
<position|offset>
<parameter>, <motor number>, <value>
GAP
STAP
RSAP
SGP
6
7
8
9
<parameter>, <motor number>
<parameter>, <motor number>
<parameter>, <motor number>
<parameter>, <bank number>, value
Description
Rotate right with specified velocity
Rotate left with specified velocity
Stop motor movement
Move to position (absolute or relative)
Set axis parameter (motion control specific settings)
Get axis parameter (read out motion control specific settings)
Store axis parameter permanently (non volatile)
Restore axis parameter
Set global parameter (module specific settings e.g. communication settings or TMCL™ user variables) www.trinamic.com
advertisement
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Related manuals
advertisement
Table of contents
- 4 Features
- 5 Overview
- 6 Putting the Module into Operation
- 7 Basic Set-up
- 7 Connecting the Module
- 9 Start the TMCL-IDE Software Development Environment
- 10 Using TMCL™ Direct Mode
- 11 Important Motor Settings
- 13 TMCL™ and TMCL-IDE
- 13 Binary Command Format
- 14 Reply Format
- 14 Status Codes
- 14 Standalone Applications
- 15 Testing with a Simple TMCL™ Program
- 15 TMCL™ Command Overview
- 15 TMCL™ Commands
- 16 Commands Listed According to Subject Area
- 20 Commands
- 20 ROR (rotate right)
- 21 ROL (rotate left)
- 22 MST (motor stop)
- 23 MVP (move to position)
- 25 SAP (set axis parameter)
- 26 GAP (get axis parameter)
- 27 STAP (store axis parameter)
- 28 RSAP (restore axis parameter)
- 29 SGP (set global parameter)
- 30 GGP (get global parameter)
- 31 STGP (store global parameter)
- 32 RSGP (restore global parameter)
- 33 RFS (reference search)
- 34 SIO (set output)
- 35 GIO (get input/output)
- 37 CALC (calculate)
- 38 COMP (compare)
- 39 JC (jump conditional)
- 40 JA (jump always)
- 41 CSUB (call subroutine)
- 42 RSUB (return from subroutine)
- 43 WAIT (wait for an event to occur)
- 44 STOP (stop TMCL™ program execution)
- 45 SCO (set coordinate)
- 46 GCO (get coordinate)
- 47 CCO (capture coordinate)
- 48 ACO (accu to coordinate)
- 49 CALCX (calculate using the X register)
- 50 AAP (accumulator to axis parameter)
- 51 AGP (accumulator to global parameter)
- 52 CLE (clear error flags)
- 53 VECT (set interrupt vector)
- 54 EI (enable interrupt)
- 55 DI (disable interrupt)
- 56 RETI (return from interrupt)
- 56 Customer Specific TMCL™ Command Extension (UF0… UF7 - User Function)
- 57 Request Target Position Reached Event
- 58 TMCL™ Control Functions
- 59 Axis Parameters
- 65 stallGuard2™ Related Parameters
- 67 coolStep™ Related Parameters
- 69 Reference Search
- 70 Reference Search Modes (Axis Parameter 193)
- 72 Encoder
- 72 Changing the Prescaler Value of an Encoder
- 73 Calculation: Velocity and Acceleration vs. Microstep- and Fullstep-Frequency
- 74 Microstep Frequency
- 74 Fullstep Frequency
- 76 Global Parameters
- 80 TMCL™ Programming Techniques and Structure
- 80 Initialization
- 80 Main Loop
- 80 Using Symbolic Constants
- 81 Using Variables
- 81 Using Subroutines
- 82 Mixing Direct Mode and Standalone Mode
- 83 Life Support Policy
- 84 Revision History
- 84 Firmware Revision
- 84 Document Revision
- 85 References