Create AOI with array input and udt output?

g.mccormick

Lifetime Supporting Member
Join Date
Jul 2012
Location
IN
Posts
961
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 16-bit words. Some of the words will need to be combined to form floats and DINTS and some will be holding STRING information. This data is all from some natural gas meters of which i have 5. I could just strong-arm this work and do 5X copies and paste of the same logic, but I thought creating an AOI would be better.

Is there a way that I can pass the the data into/out of the AOI easier than specifing everything line by line? BY that I mean, I would like to only have one in and one output in the calling arguments. The input being the base name of the array or first element , Meter1ArrayData[0] for insance. The output argument would be the basename of a UDT that I want to hold all of the data. Meter1_Info for instance.
Meter1_Info will have elements such as:
.FlowRate
.TotalFlow
.FullScale
.SerialNumber
etc
etc.
 
I assume that you are using Logix:
You can pass two structures as In/Out parameters

First parameter as INT[32]
Second parameter will be UDT with all your data members for the output.

Decoder.PNG
 
Last edited:
Well in answering my own question, I believe that I have it figured out.

If you define the input and output to the UDT as InOut then you can pass the name of an array and UDT in. The parameters of the AOI are craeted as array and also as a UDT.

I did a test case and it seems to have compiled correctly, now to creat my actual AOI , array, and UDT.

My InputArray is an array of 32 ints. My GarInst is the instance name of a UDT that I created. The same UDT is specified in the AOI.

ExampleAOI.png
 
I assume that you are using Logix:
You can pass two structures as In/Out parameters

First parameter as INT[32]
Second parameter will be UDT with all your data members for the output.

Thanks. I figured it out. Thank you for the reply.
 
Thanks. I figured it out. Thank you for the reply.

It is worth remembering than anything "structured", such as an array or a UDT tag, not only needs to be passed as an In/Out parameter, but has to be.

Input or Output parameters can only be the "atomic" data-types, BOOL, any of the INTs, or REAL. You cannot even use a LINT as an Input or Output parameter.
 

Similar Topics

I've looked and quite a few posts were older so I'm starting this one.... I created my first AOI but it appears to not be functioning correctly...
Replies
9
Views
2,830
Hello, I've been trying to learn this a while now and still have not found out how this works. I have an Omron CJ2M PLC and an ABB ACS 355 VFD...
Replies
1
Views
241
Hello, I have to deal with iFix again and am looking at the most efficient way to create alarms to display in iFix, i.e. not creating an...
Replies
0
Views
153
Good morning to all, I have the following issue, I installed everything of intouch including the patch, it is the 2023 version. The...
Replies
0
Views
329
So, I finally got versioin 27 installed on my Windows 10 VM. However, now I can't upload a project from my lab controller. I have the above error...
Replies
0
Views
1,129
Back
Top Bottom