Logix 5000 UDT within UDT

Thanks. That's a good idea for posting a visual snip here. I use VS Code for pretty much any editing.
Is there any documentation for the L5X syntax?
Nothing substantial. There's a KB article QA1778, but it says nothing about XML/L5X. There's an elusive BITFIELD modifier. Haven't found the time to try implementing it, but any insight beats no insight.

I started toying with the auto-magic "ZZZZZZZZ_" ones and tried mapping the bits to INTs and DINTs of my own. Led to *lots* of opportunities for code improvement. Many of my overlays are DINT-sized to reduce memory block ballooning caused by smaller types. See my PF525 UDT snippet.

Inside its AOI the LogicStatus (INT) provided by the Class 1 connection is simply assigned to the UDT's LogicStatus DINT now.

Code:
Local.LogicStatus := Ref_LogicStatus;

This handily beats the following in code use and performance:
Code:
Ready := LogicStatus.0;
Active := LogicStatus.1;
DirectionCmd := LogicStatus.2;
...

So each AOI has a nested .Local UDT. The AOI input/output parameters are aliased to its members and it results in an overall structure that can be modified to different naming schemes without altering the underlying code.

Another subtle perk of the AOI-represented-by-nested-UDT™ approach is that the ExternalAccess rules automatically propagate to the aliased parameters. No need to set each status BOOL to Read Only.

LogicStatusOverlay.jpg
 
Last edited:

Similar Topics

Hello, Wondering if the following setup would work. 1. Local PLC on the network has an array of 25 REALs 2. Supervisory PLC on the network needs...
Replies
14
Views
1,820
Hi there, I am doing work for a customer who has a UDT that uses parameters like this: PLC_REG_TO_SEND.GROUP_15.1234_DINT[1].0 I believe these...
Replies
5
Views
1,810
Ok, I am having a tough time with an application and figuring out how the best way would be for me. So here is what I would like to accomplish: I...
Replies
28
Views
9,270
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,827
I am sure everyone is saying not this again. I have looked and could not find an answer to this. I created a UDT with elements DW0, DW4, DW8...
Replies
1
Views
2,530
Back
Top Bottom