best way to pass input to addon instruction

mrgees100peas

Member
Join Date
Aug 2016
Location
vermont
Posts
24
for micrologix devices rslinx 5000

I am task with adding some static bars to one of our lines. The current code has 2 bars already in place. I'm going to add 7 more (9 total) so I figure that since the code repeats I'll create an add-on instruction that will do all the work neatly. The data comes from a controller which talks to the plc via ethernet. The controller stores all the data for all the bars in a single array of INT, size 117. For the add-on instruction I don't need all 117 entries, I just need 1 or 2 of those. For example, data[19] and data [22].

Here is my question. Since that data is an input to the add-on instruction do I pass in the whole array (117 elements) or just the part of the array I need? The thing is that I want to get away from knowing exactly which array element belongs to which bar. All the data is separated equally for example the status data for bar 1 is stored in data[19] and for bar 2 is in data[28] (9 addresses apart). I don't know how data is passed in a plc but it would seem to me rather wasteful to pass a whole array just to get 2 elements out of it.
 
Micrologix runs with RS500, I guess it was a typo.
For each of you AOI instances just copy (use) the part of your 117 elements that refers to that instance in particular.
Move externally your data to tags inside your AOI each one individually
 
I have no idea, but the wastefulness is only if the array is passed by-value; if it's passed by-reference then it's actually less wasteful. I imagine if you pass the array as an InOut, then it will be passed by-reference.



Does your MicroLogix even support AOIs?
 
if you are using Micrologix using RSlogix 500 software and AOI is not available to you
they are only available in the Logix5000
you could create a subprogram with local tags and copy it for each bar
 

Similar Topics

Compactlogix controller, program has 28 conveyors that use TON's to start the conveyors. The TT sounds a warning horn during start and the DN...
Replies
10
Views
482
I have S7 1512C controler for controlling 48 PID temperature loop, the output is PWM. Please I need the best, most efficient way to write the...
Replies
13
Views
587
I am going to need to use HART multi-drop in order to handle a series of Vega Radar units. There are a lot of options and I'm wondering what...
Replies
3
Views
249
Out of interest, I'd like some thoughts on what would be considered best practice with regards to a 2-position turntable control scheme (see...
Replies
17
Views
1,123
Hello colleagues Anybody knows, what could be the best or a better option to bring with you when you are in service at factory to connect via...
Replies
1
Views
259
Back
Top Bottom