Sn:tmrm condition action, Sn:tmrm start condition, stop condition action, Sn on/off/cont – Rockwell Automation 1398-PDM-xxx IQ Master Version 3.2.4 for IA-2000 and IQ-5000 Positioning Drive Modules, IQ-55 User Manual

Page 170: Timer, Scanned event instructions summary, Xkey (xn) functions, Xkey (x n ) functions

Advertising
background image

148

IQ Programming Structure • Xkey (Xn) Functions

Publication 1398-PM601A-EN-P — October 2000

TUTORIAL

Sn:TMRm condition action

A timer (specified by TMRm where m is 1 or 2) may be set to start based on a specified condition and
run for the time loaded during program execution. Once the programmed time has elapsed, the specified
action is executed. The timer scanned event is enabled and disabled by Sn ON/OFF/CONT commands

S2:TMR1 I11 = ON F7 = ON

S4:TMR2 POS2 < G3 V1 = V1+1

Sn:TMRm start condition, stop condition action

A scanned event timer may also be used to determine the elapsed time between two events. In this case
two conditions are specified. The timer starts when the first condition is satisfied and stops when the
second condition is satisfied. An action such as setting a flag or turning ON an output is then taken. The
elapsed time between the two events is then available in the TIMERm variable. The timer scanned event
can be enabled or disabled by using the Sn ON/OFF/CONT statement.

S1: TMR1 POS2 > G1, POS2 > G2 F3 = ON

S2: TMR1 POSN > G10, POS2 > G5 {O1 = ON O2 = OFF}

Sn ON/OFF/CONT

This statement is used to enable or disable a scanned event. The Sn CONT statement will allow a
scanned event to be tested continuously, without waiting for the program to re-enable the event.

S1 ON

S2 CONT

S1 OFF

Timer

There are two timers available for use with scanned events. TIMER1 and TIMER2. These timers can be
read to determine the time between two events or they can be set to establish a time delay between a
trigger event and an action.

Scanned Event Instructions Summary

The following table contains a summary of instructions that relate to scanned events. Refer to Part 5

Language Reference for more detailed information.

Xkey (Xn) Functions

The keys on the Operator Terminal marked X1 through X4 are special purpose keys that, when pressed,
may cause the execution of a routine in parallel with a main program. To enable an Xkey, a routine must
be written for the Xkey and the program must contain an Xn ON or Xn CONT statement, where n is 1
through 4. Xkey routines are defined in the application program and are unique to that program. If you
need the same Xkey program in more than one program, the code must be duplicated in each program.
An alternative to this might be to define an Fkey function. Fkey functions can be made available to all

Name

Description

Sn ON/OFF/CONT

Enable, disable, and continuously enable scanned events

Sn:IF

Scanned event IF statement

Sn:TMR

Scanned event timer

TIMERn

Event timers

Advertising