EasyManua.ls Logo

Allen-Bradley Logix5000

Allen-Bradley Logix5000
708 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
398 Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Chapter 8 Array (File)/Misc. Instructions (FAL, FSC, COP, CPS, FLL, AVE, SRT, STD, SIZE)
Execution:
Example 1: Find the number of elements in dimension 0 (first dimension) of array_a. Store
the size in array_a_size. In this example, dimension 0 of array_a has 10 elements.
Relay Ladder
Structured Text
SIZE(array_a,0,array_a_size);
Example 2: Find the number of elements in the DATA member of string_1, which is a string.
Store the size in string_1_size. In this example, the DATA member of string_1 has
82 elements. (The string uses the default STRING data type.) Since each element
holds one character, string_1 can contain up to 82 characters.
Relay Ladder
Structured Text
SIZE(string_1.DATA[0],0,string_1_size);
Condition Relay Ladder Action Structured Text Action
Prescan The rung-condition-out is set to false. No action taken.
Rung-condition-in is false The rung-condition-out is set to false. N/A
Rung-condition-in is true The instruction executes.
The rung-condition-out is set to true.
N/A
EnableIn is set N/A EnableIn is always set.
The instruction executes.
Instruction execution The instruction finds the size of a dimension. The instruction finds the size of a dimension.
Postscan The rung-condition-out is set to false. No action taken.
Size in Elements
Source array_a[0]
255
Dim. To Vary 0
Size array_a_size
10
SIZE
Size in Elements
Source string_1.DATA[0]
'$00'
Dim. To Vary 0
Size string_1_size
82
SIZE

Table of Contents

Other manuals for Allen-Bradley Logix5000

Related product manuals