P
ar
t
2: C
omman
d
s
Moog Animatics SmartMotor™ Developer's Guide, Rev. L
Page 743 of 909
TMR(timer,time)
Timer
APPLICATION:
Program execution and flow control
DESCRIPTION:
Gets (reads) or sets one of the timers
EXECUTION:
Immediate
CONDITIONAL TO:
N/A
LIMITATIONS:
four unique timers available
READ/REPORT:
RTMR(timer)
WRITE:
Read only
LANGUAGE ACCESS:
N/A
UNITS:
Milliseconds
RANGE OF VALUES:
0 to 2147483647 milliseconds (negative values not recom-
mended)
TYPICAL VALUES:
0 to 2147483647 milliseconds (negative values not recom-
mended)
DEFAULT VALUE:
0 milliseconds
FIRMWARE VERSION:
5.x and later
COMBITRONIC:
TMR(0,1000):3
where ":3" is the motor address — use the actual address or a
variable
DETAILED DESCRIPTION:
The TMR command gets (reads) or sets the timer as follows:
l
=TMR(timer)
Get a specific timer value, e.g., a=TMR(0) gets the time value from timer #0.
l
TMR(timer,time) as a command
Set a timer ID# to a specific time value, e.g., TMR(0,1000) sets timer #0 to 1000
milliseconds.
The range of timer is from 0 to 3.
The range of time is from 0 to 2147483647. A negative number can be set; however, it is not
recommended.
The TMR command allows a count-down timer to be enabled. This is useful for triggering
interrupt routines. When a timer is running, the corresponding status bit in Status Word 4 will
be set to the value 1. When it reaches zero, the status bit will revert to 0. This bit change can
be used to trigger a subroutine through the ITR() function. For more details on ITR(), see ITR
(Int#,StatusWord,Bit#,BitState,Label#) on page 486.
Part 2: Commands: TMR(timer,time)