7 real time enhancements – Rockwell Automation 57C610 Enhanced Basic Language, AutoMax User Manual

Page 62

Advertising
background image

6Ć22

Tasks do not have to call the variables by the same names when

reading and writing to the channel; they simply write an integer

quantity (for an integer position in the template) and read an integer

quantity into an integer variable. Note that, just like the normal print

operation, the print list of items may contain any kind of expression,

which will be evaluated first and then printed. The number of items

and their data types used in a print or input to a channel must match

the OPEN CHANNEL definition; otherwise, an error will occur.
A CLOSE statement is not used with a channel because once it is

opened, it remains open. There is no provision to open and then

close channels.

6.7

Real Time Enhancements

BASIC provides two statements that allow specified sections of

tasks to be executed at a known time.
1. DELAY statement
2. START statement

6.7.1

DELAY Statement

The DELAY statement provides for a simple time delay in a task.
The following is the DELAY statement format:

DELAY n time_units

where:

n = any arithmetic expression or constant that evaluates to

an integer result

time_units = unit of time to be delayed

The possible time units for both the DELAY and the START

statement are TICKS, SECONDS, MINUTES, and HOURS. The tick

rate is userĆdefinable for each Processor being used. The range is

0.5 milliseconds to 10 milliseconds. The default tick rate is 5.5

milliseconds. The plural form of the time unit must always be used,

even when referring to one unit, e.g., DELAY 1 HOURS.
The following are valid DELAY statements:

30 DELAY 255 TICKS
80 DELAY ((OLD_TICKS%-2)*5) SECONDS
15 DELAY (1ST_SHIFT_LNG%) HOURS
40 DELAY 1 HOURS

In each of the above examples, when the DELAY statement

executes, the task will be suspended at that point for the specified

amount of time and then be eligible to run when the time interval

expires. At that time, the task begins execution at the line following

the DELAY statement.

Advertising
This manual is related to the following products: