UDT or AOI ?

DennyO

Member
Join Date
Mar 2017
Location
Ohio
Posts
11
I am going to change some code in the near future. We have a lot of conveyors that use pushbutton stations wired to real world inputs. Do you prefer to use utd's and map the I/O or do you prefer to use an AOI instruction and plug in the I/O. I will put this info on an HMI. Tell me what you think.
 
It depends on the capabilities of your HMI for accessing UDTs and AOI.


I usually do everything in AOIs if it is practical.





If I need to have different AOI definitions be accessed in the same way I will use a UDT to defien the common Parameters.

SO I might have UDT Type "FakeInterfaceBlah" as an InOut on AOI "Do1", and I would have it as a InOut for another AOI type called "Do2"

SO you have

UDT FakeInterfaceBlah
AOI Do1
AOI Do2

Then you might have

FakeInterfaceBlah BlahInst1 (as an instance)
FakeInterfaceBlah BlahInst2
FakeInterfaceBlah BlahInst3
FakeInterfaceBlah BlahInst4

Then

Do1 Do1Inst1 With BlahInst1 as an InOut
Do1 Do1Inst2 With BlahInst2 as an InOut
Do2 Do2Inst1 With BlahInst3 as an InOut
Do2 Do2Inst2 With BlahInst4 as an InOut

But where this really gets handy is if I define an array of FakeInterfaceBlah and do this

Do1 Do1Inst1 With BlahInst[0] as an InOut
Do1 Do1Inst2 With BlahInst[1] as an InOut
Do2 Do2Inst1 With BlahInst[2] as an InOut
Do2 Do2Inst2 With BlahInst[3] as an InOut


then I can loop through it in other places in my code.


For your pushbuttons if your HMI can access AOIs then just use AOIs


but if you have different types of pushbutton stations with different features what I describe about making fake interfaces with UDTs might be helpful.


for example all of them may have a start and stop button but maybe some of them have a Jog button, and others have say a "Pause" Button. Put the Start and Stop Button in a UDT. And then you would have 2 or more AOIs defined.

Or you could Do the same thing bug instead of using a UST you can have a Start and Stop AOI and put that AOI in side 2 different APIs that define the "Jog" and pause behavior.


All of this is poor man's polymorphism.


I will stop my ramblings now. Time to put the kids to bed.
 
I am going to change some code in the near future. We have a lot of conveyors that use pushbutton stations wired to real world inputs. Do you prefer to use utd's and map the I/O or do you prefer to use an AOI instruction and plug in the I/O. I will put this info on an HMI. Tell me what you think.

I think you may have a confusion.

A "UDT" is just a constructed data-type, nothing else.

You create tags, of that UDT, which can be used as parameters to Add-On Intructions, but their usage will always be "In/Out".

An AOI using any UDT derived tags will always be manipulating the tags of the UDT's directly.

My preferred method is to call the AOI with the plant item tag, but to also parameterise the "inputs" (such as Running status etc.) as input parameters, either directly, or via an alias, to the physical I/O Input tag member. Same with any physical Outputs.

Doing it this way, you will always be able to "see" the outside world connections that the AOI is working with.
 
Who will be maintaining the logic? I have a few customers that don't like using AOIs because there maintenance people struggle with them (I know, its a training issue) so UDTs are the primary method.
 

Similar Topics

Hi all, We have been using an UDT that contains tag-based alarms as an In/Out parameter for an AOI. (V31-V32) Unfortunately, V33, they have...
Replies
0
Views
1,091
Hi All! I've created some AOI and have added a local tag of my UDT. I've set external access to Read/Write in AOI's tag browser. So, I've created...
Replies
14
Views
5,725
Good Evening , I’m probably entering the most challenging stage of programming I have ever attempted . It is probably easy , and easily...
Replies
8
Views
4,089
I want to create an AOI to take modbus data and put it together as needed. The data is going to be coming from an RTA gateway and will be 32...
Replies
4
Views
3,552
Good Evening , I still have many "Mental Blocks" when it comes down to programming. Could you tell me the difference between a UDT and a AOI ...
Replies
26
Views
16,678
Back
Top Bottom