
Micky (Customer) asked a question.
What is Productivity's equivalent or work around to AB's AOI?
I have an application that we take a physical input and run it through some logic and then trigger an alarm. Example would be a prox on the tail of a shaft of auger, that when it times out from pulsing rings a horn based on what floor it is located on. Also has options to disable horn but still alarm for HMI to see. Want to do this x100 and if need to change logic not have to replace a 100 sections of logic. Right now it is being done in a PLC5 using indirect addressing or in a compactlogix using an AOI and tags to it.
Is there an equivalent in Productivity or if not, what would be a way to workaround this?
Write logic with pointers. If he replies, Garry may have an example of this on his website.
+1 Todd
In the productivity series you would use an array with pointers. Here is a post on how this is done.
https://accautomation.ca/productivity-1000-series-plc-array-functions-part-1/
Here is a link to the entire series.
https://accautomation.ca/series/productivity-1000-plc/
I hope this helps you out.
Regards,
Garry
Is there a limit to the size of the array or how fast the pointer effectively increments through? Lets say I have 750 alarm bits that I need to run through the logic controlling the horn. How fast can I increment the pointer?
Hi Micky,
The array size would be based on memory, but I did a quick check at adding both a 1D and 2D array. I used 32-bit variables. The limit was 10,000 elements on the 1D and 10,000 x 10,000 elements on the 2D.
You can use the pointer inside a For / Next loop and do everything within one scan of the PLC. Please look at the Program Control instructions in the Productivity Suite software.
Regards,
Garry
To make sure I am following correctly. I would basically have whatever logic or physical inputs that is an alarm create an "abnormal" bit. This bit gets put into a position in the array. I then have a For / Next loop that moves through the array with the number of loops being the size of the array. Or since I am just using one audible alarm break out of the loop then? Is there a min time you recommend I can move that pointer?
Hi Micky,
Yes you are correct. The 'For Loop Break' instruction can be used to exit the For Next loop once you have the audible alarm.
I do not have a minimum time for the pointer move. Usually I do everything as fast as possible.
Regards,
Garry
Why not just map the bits into an integer and if the interger > 0 you have an alarm. On the HMI just bit mask the alarm word.
At this moment, there's no AOI functionality in Productivity Suite. What I have been doing is making a Run When Called task that does what I need it to do, then in my main scan, I copy the data I need manipulated into a temporary variable, call the task that uses the temporary data, and copy the temp data back to the target. Here's an example:
The called task:
And the calling process:
I've found that calling the task doesn't add a huge amount of scan time, but it you're worried about keeping that time low, you can always make an array of UDTs (called UDS in Productivity) and call one element of the array every scan, incrementing your array reference by one on each scan.
I hope I explained that well enough. My coffee hasn't fully kicked in yet.
Productivity Suite can mimic an AOI. An AOI is really made up of two things:
1. An array of UDS (User-Defined Structure) Data Type
2. A loop that executes the code once for each element in the array.
For example, a simple motor AOI for 10 motors
Create the UDS -
Create the Array of 10 Motor Data Type
Create a routine with a Loop that executes the code you want to use for the motors. Number of loops needs to match the number of elements in the array. Use the tag for current loop as the indirect reference for the array element.