RSLogix 5000 Add-On Instructions

recondaddy

Member
Join Date
Apr 2006
Location
Atlanta, GA
Posts
77
I'm just learning about AOI's, and I have a question concerning Parameter Usage (Input, Output, or InOut).

I understand that Input and Output passes parameters in and out of the instruction BY VALUE, whereas InOut passes parameters BY REFERENCE. In the programming manual, I found a nifty table of considerations:

Value:
By Value: Synchronous - the Parameter's value does not change during Add-On Instruction execution.
By Reference: Asynchronous - the Parameter's value may change during Add-On Instruction execution. Any access by the instruction's logic directly reads or writes the passed tag's value.

Performance:
By Value: Argument values are copied in and out of the Parameters of the Add-On Instruction. This takes more time to execute a call to the instruction.
By Reference: Parameters access argument tags directly by reference, which leads to faster execution of instruction calls.

Memory usage:
By Value: Most amount.
By Reference: Least amount.

Parameter data types supported:
By Value: Atomic.
By Reference: Atomic, Arrays, and structures.

After looking at all these considerations, By Reference uses less memory, executes faster, and supports more data types than By Value. Why would I ever use Input or Output as opposed to InOut?

Thanks.
 
I have been playing around a litle with these too. I just can't seem to find the time to get very far with it yet.

I look forward to creating my own scaling instruction.

RSL
 
One definate reason to be VERY CAREFUL about passing by reference:

Pretend, for a moment, that you have an HMI with momentary Pushbuttons, tagged to an element in a UDT, and you pass that UDT by reference into an AOI. You have the possibility of the element changing state within the execution of the AOI, so it is something to watch out for.

Another difference, is that you **CANNOT PASS A CONSTANT BY REFERENCE**. Pure Input parameters, can be passed constant values if they are not necessary for the execution of the AOI. Output parameters, you might want to tag directly to a physical output, so passing by value eliminates extra copy logic to convert the reference output to a physical output.

The speed issue is really a non-issue, the CLX processors can copy elements blindingly fast, and you'd need an awful lot of INPUT/OUTPUT elements before you would ever notice a drop in scan time. Ditto memory. With the Logix Platform, there is virtually no reason to use the 'memory conservation' tricks that many of us absolutely needed to use in earlier PLC's.

EDIT --

AOI's are incredibly powerful and useful. I've been converting all of my older SBR/RET routines with AOI's, and building newer ones. Just replacing SBR/RET calls, my scan times have decreased from 29ms to 19ms on a fairly large project.

Oddly, I haven't bothered with a SCL AOI, as I find the FBD Scale function to be wholly sufficient, with the easy ability to follow it up with various filtering elements if needed. I have build MOP routines, Event (or time) based Pump Lead/Lag controls, Run time/maintenance counters, modified PMUL blocks for encoder control, and many others.

The biggest shortcoming I find with AOI's, is that the instruction 'Local' data elements are not exposed. Oh well, can't have everything I guess.
 
Last edited:
Great info, I've got a project coming up and the customer is mentioning the use of AOIs which we're not familiar with at this time. Any recommendations for some good reading on AOI or examples?

BTW this is a great site, I'm looking forward to contributing and of course, posting panic questions during commissionings.
 
Have patience. It took a couple of minutes for the video to load and begin playing.

Thanks for the link recondaddy. I've been banging my head o_O trying to train a couple of our techs about AOIs. These videos will help.
 

Similar Topics

I am trying to add a device to my RSLogix 5000 program. The device is a Eaton PowerXL DG1 I downloaded the eds file from the website (it...
Replies
5
Views
1,715
Im trying to sum a running "Shift Total" production value and move it into a Month Total value that will continuously update for viewing...
Replies
1
Views
1,514
I am trying to add a generic Ethernet module to RSLogix and keep getting an invalid size error. There are no inputs, only outputs. I am using...
Replies
6
Views
5,460
I would like some guidance or a way to add SCL or SCP instructions to my Add-On I am using RS-Logix 5000
Replies
3
Views
2,018
Hi there, I am trying to create an Add=On Instruction to help me manage some alarm conditions in my application. My AOI has one Boolean output...
Replies
7
Views
2,467
Back
Top Bottom