!RT                Set event after a wait time

Syntax                        

!RT value32

! if RelativeTime >= value32

!RT VAR32

! if RelativeTime >= VAR32

 

OperandsVAR32: long variable

value32: 32-bit long immediate value

PlaceTMLOnline

Binary code

DescriptionSets the event condition when the relative time is equal or greater than the 32-bit value or the value of the specified long variable. The relative time RTIME is computed with formula: RTIME = ATIME – TIME0, where ATIME is a 32-bit absolute time counter, incremented by 1 at each slow loop sampling period and

TIME0 is the ATIME value when the wait event was set. After power on, TIME0 is set to 0. RTIME is updated together with ATIME, at each slow loop sampling period.  

Remark: ATIME and RTIME start ONLY after the execution of the ENDINIT (end of initialization) command. Therefore you should not set wait events before executing this command

After you have programmed an event monitoring you need to wait until the programmed event occurs, using the TML command WAIT!. Otherwise, the program will continue with the next instructions that may override the event monitoring.

 

ExecutionActivates the monitoring of the event when system relative time >= value32, respectively VAR32. This operation erases a previous programmed event that has occurred.

 

Example                

//Introduce a 100 ms delay

!RT 100;        // set event: After a wait of 100 slow-loop periods

// 1 slow-loop period = 1ms

WAIT!;        // wait the event to occur