RSLogix UDT naming members of an array

plclady

Member
Join Date
Jul 2018
Location
utah
Posts
18
I want to create a UDT that contains an array of 4 DINTs. Can I give the DINTs names they will show up with instead of .0 or .1 etc? And then can I give the BOOL members of each DINT a description?

So for example if my array is named
SMV_Output_Assembly_100

then word 0 of that array would be named
Control_Word

and bit 0 of Control_Word would just be .0 in the expanded tag list but it would have a comment that reads "0=not run forward; 1=run forward"
 
Yes, with a description but the addressing would still be by bit.
OR you could create another UDT (or 4 UDTs) with 32 Boolean members and give each a unique name. Then instead of DINTS you would say the the data type are the new ones with the special members.
 
OR the original UDT you wanted to define with (4) dints could be a UDT with a bunch of boolean data types, each with a unique name. Don't worry about the DINT organization (unless you have to).
 
The only problem with that is when I want to set them all to 0 I have to do it 128 times. If I have a DINT that 32 BOOLs target to I can just cleanly set it to 0. I need the BOOLs because their descriptions tell the user which bits mean what.
 
You might be able to use an FLL on an array of bools, but probably not.

You could just use a loop with indirect addressing incremented by 1 to unlatch them all, that's pretty easy.
 
The only problem with that is when I want to set them all to 0 I have to do it 128 times. If I have a DINT that 32 BOOLs target to I can just cleanly set it to 0. I need the BOOLs because their descriptions tell the user which bits mean what.

I would make a constant tag of the udt, reset all bools in the tag browser and call it "AllFalse". When I want to clear another tag of the same type I just copy AllFalse to it.
 

Similar Topics

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,116
Greetings, I'm here in my home lab trying to acquire a working knowledge of UDT's. I've had to work with them in the past in large existing...
Replies
13
Views
10,078
Hi all, I'm designing UDTs for a RSlogix 5000 project and I would like your valuable comments about this topic. I have around 10 tanks to control...
Replies
6
Views
7,095
I am trying to clean up a project by creating a UDT that I will reuse, and while I was creating the UDT tags I got to a 2 dimensional array, and...
Replies
6
Views
7,284
Hi all, I'm working on my first RSLogix 5000 program. Thanks to the help of some of you guys I am taking advantage of the AOIs (add on...
Replies
14
Views
18,591
Back
Top Bottom