52
Rockwell Automation Publication 1756-PM004D-EN-P - September 2012
Chapter 2
Organizing Tags
The following example loads a series of preset values into a timer, one value (array
element) at a time.
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.
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.)
42358
Move
Source timer_presets[north_tank.step]
60000
Dest
north_tank.step_time.PRE
60000
MOV
/
north_tank.step_time.DN
EN
DN
Timer On Delay
Timer
north_tank.step_time
Preset
60000
Accum
0
TON
north_tank.step_time.DN
Add
Source A
1
Source B north_tank.step
0
Dest
north_tank.step
0
ADD
Equal
Source A north_tank.step
0
Source B
4
EQU
Move
Source
0
Dest north_tank.step
0
MOV
Summary of Contents for 1756-L65 ControlLogix 5565
Page 4: ...2 Rockwell Automation Publication 1756 PM004D EN P September 2012 Summary of Changes Notes...
Page 8: ...6 Rockwell Automation Publication 1756 PM004D EN P September 2012 Preface Notes...
Page 66: ...64 Rockwell Automation Publication 1756 PM004D EN P September 2012 Chapter 3 Force I O Notes...
Page 88: ...86 Rockwell Automation Publication 1756 PM004D EN P September 2012 Index...
Page 89: ......