User Manual

TMCM-3230 TMCL
Firmware Manual Firmware Version V1.07 | Document Revision V1.05 2017-OCT-10
47 / 103
3.6.20 WAIT (Wait for an Event to occur)
This instruction interrupts the execution of the TMCL program until the specied condition is met. This
command is intended for standalone operation only.
There are ve dierent wait conditions that can be used:
TICKS: Wait until the number of timer ticks specied by the <ticks> parameter has been reached.
POS: Wait until the target position of the motor specied by the <motor> parameter has been
reached. An optional timeout value (0 for no timeout) must be specied by the <ticks> parameter.
REFSW: Wait until the reference switch of the motor specied by the <motor> parameter has been
triggered. An optional timeout value (0 for no timeout) must be specied by the <ticks> parameter.
LIMSW: Wait until a limit switch of the motor specied by the <motor> parameter has been triggered.
An optional timeout value (0 for no timeout) must be specied by the <ticks> parameter.
RFS: Wait until the reference search of the motor specied by the <motor> eld has been reached.
An optional timeout value (0 for no timeout) must be specied 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 specied by the
value store in the accumulator. The accumulator must not contain a negative value when using this option.
The timeout ag (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 (dont care) <no. of ticks to wait
1
>
1 POS target position reached <motor number> <no. of ticks for timeout
1
>
0 for no timeout
2 REFSW reference switch <motor number> <no. of ticks for timeout
1
>
27 0 for no timeout
3 LIMSW limit switch <motor number> <no. of ticks for timeout
1
>
0 for no timeout
4 RFS reference search completed <motor number> <no. of ticks for timeout
1
>
0 for no timeout
Example
1
one tick is 10 milliseconds
©2017 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com