ControlLogix Array Referencing

knewton

Member
Join Date
Apr 2009
Location
nottinghamshire
Posts
3
Hi All

Does anyone know if it is possible to refer to an array using an array as part of the subscript ?
Example:

I am trying to look up a part name from a value specified within an array element.

I have an array called My_Array[0] (this is an array of 100 dints containing multiple information)

I am trying to look up a part name stored in another array but wish to use the My_Array [0] array as part of the subscript for the 2nd array as shown below


Part_name[My_Array [0],0]

When I enter the data above I get an error “Invalid Subscript Specifier.

thanks in advance for any ideas

Kev
 
Rockwell said:
You cannot nest more than one pair of brackets [ ] when using indirect addressing. For example:
Address[Position] would work, but Address[Array[Position]] would not work. If you are using tags equated to arrays and you need to use the various elements of the array within the indirect address, you will have to create an alias which references that element and use that instead. As a rule just remember only one set of brackets in any address/expression

On FAL and other File type instructions, you are better off letting the FILE ADDRESS always start at word zero of the array. If you do not start at word zero you will have to use an alias point to which starting word of the file you want the instruction to access when the position is zero.

If an array of control elements are used, you will need to also have aliases pointing to which .POS element of which one this instruction is using as the tagname within the [brackets]. If individual control tags (not arrays) are used, the aliases are not necessary and you should create the desired tag as a control element while programming the instruction. If the control tags are created first in the tag editor, the SW may get confused and think what you are entering is a new tag name not one that already exists.

As rockwell says, use an alias to the element in the array you wish to use as the pointer.
 

Similar Topics

I have a task that could easily be solved using a 2-dimensional array using a ControlLogix processor, V32+. Basically it will loop through two...
Replies
23
Views
4,316
Hello All, I am currently working on a Project that retrieves data from a SQL table and stores in a PLC. This data is an array with multiple rows...
Replies
2
Views
2,925
All Working on a new program and I am using several strings that are arrayed. I am now trying to enter my initial data into them in the data...
Replies
4
Views
2,072
Thought this would be a built in instruction but can only find SWAPB that only works on one word at a time.
Replies
5
Views
2,406
Hi Thanks for reading this post. I Having trouble writing Wonderware array values to a compactlogix PAC. I can read the values through a...
Replies
1
Views
4,171
Back
Top Bottom