beautypg.com

Expressions – Rockwell Automation Logix5000 Controllers I/O and Tag Data Programming Manual User Manual

Page 51

background image

Organize tags

Chapter 2

Example:

Step through an array.

The timer_presets array stores a series of preset values for the timer in the next rung. The north_tank.step tag points to which element of the array to use. For

example, when north_tank.step equals 0, the instruction loads timer_presets[0] into the timer (60,000 ms).

When north_tank.step_time is done, the rung increments north_tank.step to the next number and that

element of the timer_presets array loads into the timer.

When north_tank.step exceeds the size of the array, the rung resets the tag to start at the first element in the

array. (The array contains elements 0–3.)

Expressions

You can also use an expression to specify the subscript of an array.

• An expression uses operators, such as + or -, to calculate a value.
• The controller computes the result of the expression and uses it as the array

subscript.

Rock well Automati on Publication 1756- PM004E -EN-P - October 2014

51