Sn: tmrm, S n : tmr m, Words – 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 285: Scanned event

Advertising
background image

Language Reference • Reference

263

Publication 1398-PM601A-EN-P — October 2000

WORDS

Sn: TMRm

Scanned Event

Scanned Event

Purpose

A timer may also be used to determined the elapsed time between two events. In this
case two conditions are specified. The timer starts counting up when the first event
occurs and stops when the second event occurs.

Syntax

Sn: TMRm start_condition, stop_condition action

n

The number of the scanned event. There are eight scanned
events: n = 1, 2, 3, .... , 8.

m

The number of the timer used: m = 1 or 2.

start_condition

The condition that must be satisfied to start the timer. The condi-
tion may be a comparison, an input being ON or OFF, or a flag
being ON or OFF.

Comparisons compare the values of two operands and determine
if the condition is TRUE or FALSE. A comparison may be
greater than (>), less than (<), equal to ( = ), not equal to (<>),
less than or equal to (< = ), or greater than or equal to (> = ). The
operands of a comparison may be user variables, system vari-
ables, analog input values (ADC), or constants.

I1 ON

;an input

F1 ON

;a user flag

INPOSN

;system flag

G1 > G2

;comparison user variable

G1 > POS1

;comparison system variable

POS2 <= 7.00

;comparison constant

stop_condition

The condition that must be satisfied to stop the timer. Same type
of conditions as start condition.

action

The program statements in a scanned event routine can be any
legal program statement(s) except CALL, RETURN, JUMP,
MOVD, MOVP, DV, DIF, DELAY, DWELL, PRINT, READ,
ENABLE, and DISABLE statements. Multiple statements can be
enclosed in curly braces {}.

Remarks

An action such as setting a flag or turning an output ON is then taken. The elapsed
time between the two events is then available in the TIMERn variable. The timer can
be enabled or disabled in this mode also using the Sn ON/OFF/CONT statement.

See Also

Sn: IF, Sn ON/OFF/CONT, TIMERm

Example

S1: TMR1 POS2 > G1, POS2 > G2

{

F3 = ON

O1 = OFF

}

Advertising