indexed addressing for control logix

T

Thread Starter

Tiger

hello everybody, i would like to know if anyone here has any experience indexing tags on control logix, i m looking to use some indexed registries as it is done on plc 5 but i dont know how i can do that on control logix using tags, i hope i can hear any answer from anyone soon. thanks for your help.

Tiger
 
Check RSLogix5000 help. Search for "indexed". It explains what is supported and and the correct adressing syntax. Since there is no index register in the Logix CPU, you will need to create an indexing mechanism through code.
 
Y

Yosef Feigenbaum

To the best of my knowledge you can't indirectly change files as you could with the PLC-5. The 1st thing that comes to mind is to create a buffer file at least as large as the file you want to manipulate, copy the source file to the buffer file, and after manipulation, return the data to the source file (if needed).

Good Luck,

(8{)} ( .)
[email protected]
 
T
Define the tag group to be indexed as an array and define the DINT tag to be used as the pointer. Then you can access as: TagName[pointer]. If you have multiple items to access with the same pointer then create a user defined data type, then create an array of that data type and access as UserDefinedTagName[pointer].ElementName.

This is covered in the control logix programming manuals. They are available at http://www.ab.com/manuals

I hope this helps.
 
D

Dave Campain

Many of the instructions that are used for functions that require indexing use a CONTROL tag (eg FAL, FSC, FFL, FFU, SRT).A unique tag can be created for each instruction instance. The CONTROL tag has .LEN (length) and .POS (position) fields that can be used in place of S24 for control of indexing. ControlLogix can not perform all the indexing tricks that PLC5 could, but the advantages are not having all index instructions using the same address to store position, and the ability to use user defined arrays out weighs those deficencies.

Dave
 
M
My understanding of indexed addressing is that it's just a flavor of indirect addressing, where the indirection pointer is a .POS word in a control structure (R6:xx for example). In ControlLogix, the indexed addressing prefix (#) is no longer used. Instead, all indirect addressing is coded more consistently. ControlLogix still has a "Control" datatype, and it still has a .POS subelement (DINT). To reference an element in a single-dimensioned array of DINT's, the address would look like: MyDintArray[MyControl.POS], if you wanted the entire 32 bits. If you want a single bit, use MyDintArray[MyControl.POS].6. This assumes that MyControl.POS is manipulated by another instruction, possibly a FAL. Of course, for the file position (.POS) to be useful, the FAL has to increment on a per-scan basis.

But now, there's no particular magic in the .POS element. It's just another integer pointer into the array. So, to reference the accumulated value in an array of counters, you could just as easily code MyCounters[WhichCounter].ACC. In this case, WhichCounter is just another tag with an integer base-type SINT, INT, or DINT. Like in PLC-5, array references are not bounds-checked by the processor. So, referencing an array element beyond its bounds produces a major fault. ControlLogix allows arrays with up to three dimensions (but not for BOOL). Indirection can only be one level deep. So, you can't code inner brackets such as: ArrayX[Pointers[MyFAL.POS]]. Maybe later firmware will fix this limitation.

Some of this is solely from experimentation, so there may be other methods I'm unaware of.

Mike
 
Top