Controllogix Arrays

plcengineer

Member
Join Date
Jan 2004
Location
USA
Posts
176
I have an application that requires the addition of multiple arrays in a controllogix program. First of all, I have an array of 250 tag name Index_Pos_Recipe[0] through Index_Pos_Recipe[250].. I would like to do the following: Enter a number from an operator interface for the array index. For example enter in a 75.. I would then like to add Index_Pos_Recipe[0] through Index_Pos_Recipe[75] and put that number in one tag address. Another example would be enter in a 50, then I would need to add Index_Pos_Recipe[0] through Index_Pos_Recipe[50]..

I reviewed using a FAL instruction but I am not too familiar.. Please give some ideas of how to do this.. it seems simple but I have not been able to come up with anything.. I think the FAL would work but I tried putting that in my code and didn't understand what I needed to have so it didn't work... If someone knows the FAL and tell me how to set up this app, I would appreciate it..

tks,
plcengineer
 
Can you use ST? A while loop sounds perfect for this application.

Index := 0;

While Index < OITindex do

Total := Total + Index_Pos_Recipe[Index];

Index := Index + 1;

End_While;

Edited to add index set at beginning (what good would it be if you could only call it once?)
 
Last edited:
I have never used ST.. I am a ladder guy.. How would I go about setting this up.. Or, do you have a ladder way like with a FAL that would work..


tks
 
For STL you can create a routine, give it any name you want.
To execute the routine, put a JSR in your ladder.

Or I'll look into how the FAL works and see if I can understand it.

Marc
 
I take it back. I don't think the FAL instruction supports a variable in the length position.

I'd use ST, it's really simple & a good chance to get experience with it.
 
I'll look into the STL but if you don't mind, see what you think of the FAL.. Or some type of ladder that I would understand..
 
OK, here's the trick.
The length must always be 1 or greater.
Move a variable into the Control.Length
Declare a control tag,
Declare an Index tag,
Declare a total tag,
Declare the array.

I've attached an example file.
 
The Ladder & ST should be identical ithe end, it just executes little differently.

I'd bet the ST can blow through it much faster.
 
Hi CroCop.
Pardon me if I am wrong but in the ladder example I thought that the mode should be all and in the expression the part in the brackets should be [Control.Pos]

And here is another way that will do it in ST. I think it should be faster still. It is not zipped, just change the zip to ACD

Regards Alan Case
 
Last edited:
Hey Guys,

So, do I need to change the example from CroCrop?? Should the mode be ALL and the expression [Control.POS]??

tks,
 
The expression isnt [control.pos] just the bracketted part of the expression, ie replace index in the expression with control.pos
Read the FAL help file and it will explain this bit.

My understanding is that with the mode as INC then each false to true of the rung will add only 1 value to the total. With mode as all it is done in the one scan.

Regards Alan
 

Similar Topics

Hey guys, In the spirit of true "Object Oriented Programming", I am attempting to create a dynamic array of UDT "Objects". I need to add and...
Replies
12
Views
3,289
I have a controllogix processor with a few boolean arrays set up.. For example, one array is Step_Cycle_Complete. Basically, the addressing goes...
Replies
4
Views
7,028
I'm trying to integrate a Beckhoff IPC with a Controllogix PLC. There is some documentation, on the Beckhoff website, on how to do a PLC-PLC comms...
Replies
0
Views
54
Why does the controllogix redundancy modules use a single mode fiber vs multimode fiber?
Replies
1
Views
86
Hello, I have two 16 point input cards and 1 16 point output card showing module faulted on my IO tree in Logix Designer. The fault code is...
Replies
7
Views
217
Back
Top Bottom