TMCM-1211 TMCL
™
Firmware Manual • Firmware Version V1.10 | Document Revision V1.00 • 2018-OCT-02
52 / 133
3.6.22
WAIT (Wait for an Event to occur)
This instruction interrupts the execution of the TMCL program until the specified condition is met.
This
command is intended for standalone operation only.
There are five different wait conditions that can be used:
• TICKS: Wait until the number of timer ticks specified by the <ticks> parameter has been reached.
• POS: Wait until the target position of the motor specified by the <motor> parameter has been
reached. An optional timeout value (0 for no timeout) must be specified by the <ticks> parameter.
• REFSW: Wait until the reference switch of the motor specified by the <motor> parameter has been
triggered. An optional timeout value (0 for no timeout) must be specified by the <ticks> parameter.
• LIMSW: Wait until a limit switch of the motor specified by the <motor> parameter has been triggered.
An optional timeout value (0 for no timeout) must be specified by the <ticks> parameter.
• RFS: Wait until the reference search of the motor specified by the <motor> field has been reached.
An optional timeout value (0 for no timeout) must be specified by the <ticks> parameter.
Special case for the <ticks> parameter: When this parameter is set to -1 the contents of the accumulator
register will be taken for this value. So for example WAIT TICKS, 0, -1 will wait as long as specified by the
value store in the accumulator.
The accumulator must not contain a negative value when using this option.
The timeout flag (ETO) will be set after a timeout limit has been reached. You can then use a JC ETO
command to check for such errors or clear the error using the CLE command.
Internal function:
the TMCL program counter will be held at the address of this WAIT command until the
condition is met or the timeout has expired.
Related commands:
JC, CLE.
Mnemonic:
WAIT <condition>, <motor number>, <ticks>
Binary Representation
Instruction
Type
Motor/Bank
Value
0 TICKS – timer ticks
0 (don’t care)
<no. of ticks to wait1>
1 POS – target position reached
<motor number>
<no. of ticks for timeout1>
0 for no timeout
2 REFSW – reference switch
<motor number>
<no. of ticks for timeout1>
27
0 for no timeout
3 LIMSW – limit switch
<motor number>
<no. of ticks for timeout1>
0 for no timeout
4 RFS – reference search completed
<motor number>
<no. of ticks for timeout1>
0 for no timeout
Example
1
one tick is 10 milliseconds
©2018 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at