beautypg.com

Rockwell Automation AutoMax Enhanced Ladder Language Reference Manual User Manual

Page 298

background image

BĆ2

Within a BASIC program, you may want to:

D determine if a timer has expired
D change a timer's preset

To change the preset value by using a BASIC statement

D Enter a statement in this format:

NAME!(2)=new_preset_value
where NAME! is the name of the global timer variable whose preset you want to

change

The value of 2 is the location of the element TPreset within a Timer data type.
Example:
TIMER1!(2)=2000
This statement sets the preset value for the variable TIMER1! to 2000.

To determine if a timer has expired by monitoring element Q in a BASIC program

D Use the BASIC function BIT_SET@ to test the value of Q.

Example:
IF BIT_SET@(TIMER1!(3),15) THEN 250
This statement examined bit 15 of element 3 in the global variable TIMER1.