UTD bit overlays

Allen Nelson

Member
Join Date
Apr 2002
Location
West Chester, PA
Posts
1,368
In Controllogix PLCs, you can create a "User-defined type" of tag.

You can, for example, create a "DEVICE" UDT, and have tags DEV1.ON, DEV1.OFF, DEV1.STATUS, and DEV1.FaultTimer, where .ON and .OFF are bits, .STATUS is a DInt, and .FaultTimer is a timer.

So far, it's good.

But I want to be able to do things like I used to do them in PLC-5/SLCs. If I had the symbol DEV1_ON as N7:0/0 and DEV1_OFF as N7:0/1, I didn't have to do anything program DEV1_STATUS, because its address N7:0. I just use STATUS on the HMI and I was done.

Now I've found that you CAN do this sort of thing with Controllogix, using a technique called "bit overlays". I've learned that you can't do this using RSLogix5000, but have to edit the .L5K file in a special way to get the effect.

My question is: What is that special way?

I've looked through the RSLogix forum, and the Knowledgebase, and the only thing I've learned is that the technique is called "bit overlay" (which there is an unhelpful help topic in it in the Logix), and that once you do this, the UDT is read-only.

But how do you do it? What's the syntax?
 
I'm not sure exactly what you're getting at, but here's what I think you're trying to do:

You liked being able to grab a bunch of bits at once by dumping them into an integer tag in PLC-5/SLC. You want to do that with CLX, now.

I didn't know you meant by "bit overlays." So, I decided to try and figure out if I can do what you're asking. Here's how you do it:

1. When you define a UDT, group the BOOLS together. This will compact them into SINT datatypes. If you want descriptions for each of your bits, enter them.

2. Save the project as an L5K file.

3. Open the L5K file and find your UDT.

4. Where you see a line like this: SINT ZZZZZZZZZZUSER_VAR9 (Hidden := 1);, Remove (Hidden := 1).

Now you have something like the following:

SINT ZZZZZZZZZZUSER_VAR9 (Description := "This Should work");
BIT BINARY0 ZZZZZZZZZZUSER_VAR9 : 0 (Description := "Desc1");
BIT BINARY1 ZZZZZZZZZZUSER_VAR9 : 1 (Description := "Desc2");
BIT BINARY2 ZZZZZZZZZZUSER_VAR9 : 2 (Description := "Desc3");
BIT BINARY3 ZZZZZZZZZZUSER_VAR9 : 3 (Description := "Desc4");
BIT BINARY4 ZZZZZZZZZZUSER_VAR9 : 4 (Description := "Desc5");


5. Use RSLogix5000 to open the L5K file.

6. Save your program and restart RSLogix before you do any work. Imports tend to lead to crashes.

You won't be able to edit your UDT in RSLogix anymore. You'll get this prompt.

Good luck!
AK
 
Last edited:
Allen, first let me state I have NEVER seen a Controllogix except on display or at a trade show.

Being the inquisitive person I am I had to do some reading though, lets see if what I found out will help.

You are wanting to create a UDT then use bit level (Boolean) addresses for certain things. A boolean data type created outside of a UDT uses either 4 bytes or 32 bytes, a PV reads 4 bytes. The UDT actually uses 1 bit. Instead of using boolean use a DINT. Now the HMI can read one bit from the 32 bit word.

Some of the tech docs I read:
http://domino.automation.rockwell.c...D8A861BF6B91283285256B210049BC6B?OpenDocument

http://domino.automation.rockwell.c...E7D1A5E2D92501A785256AFB005B5347?OpenDocument

http://domino.automation.rockwell.c...A78B0D59D41C8B2885256AFB005BE69F?OpenDocument
 
Actually, Ron, the version of Logix5000 that I'm using now (V13) reserves a whole SINT (8 bits) for each group of bits defined in a UDT. It adds more as necessary, I assume. It might even expand the datatype to INT (16 bits) or DINT(32 bits) because CLX likes everything to be 32 bits. By removing the hidden attribute on the "parent" SINT variable, you gain access to it in Logix. You can use the variable as if it were an array of BOOL data.

I wonder, though... If you know the Tag name of the hidden variable, can a Panelview request it anyway? I'll have to try that tomorrow.

I can't vouch for earlier versions of Logix, it changes too much each time.

AK
 
Get the Logix5000 Controllers Import/Export manual 1756-RM084-en-p for everything you wanted to know about the L5K format. Chapter 3 covers data types.

By default, RSLogix groups the BOOL's in your UDT into SINT's. But there's nothing to stop you from aliasing the bits in a DINT or INT. Give the SINT, INT, or DINT any name you like - the default names with all the Z's are to avoid duplicating any name that you may have given to a UDT element. Any description you attach to the bit aliases will 'flow though' to tags defined as the UDT type.

This feature is especially useful for organising and defining data travelling over DeviceNet, ProfiBus, etc.
 
Satisfaction

:site:

Thanks guys - especially Aaron (akreel) and Gerry. I've got it working exactly as I want it.

I modified the L5K file as follows:
Code:
     DATATYPE HOA (FamilyType := NoFamily)
          DINT STATUS (Description := "RUNNING STATUS");
          BIT IS_OFF STATUS : 0 (Description := "CONFIRMED OFF/CLOSED",
              Radix := Binary);
          BIT IS_ON STATUS : 1 (Description := "CONFIRMED ON/OPEN",
              Radix := Binary);
          BIT ALARM STATUS : 2 (Description := "IN ALARM",
              Radix := Binary);

In the PLC, I have logic that looks like this:

Feedback for Valve 123
VALVE 123 Closed
Local:2:I: Data[0].7 VALVE123.IS_OFF
--------------| |-------------------------( )

Local:2:I: Data[0].8 VALVE123.IS_ON
--------------| |-------------------------( )



I can use the .IS_OFF and .IS_ON anywhere in my program (and avoid the "I/O update is asynchronous to scan" worry).

In my HMI, I just monitor the tag VALVE123.STATUS for my animation. When the valve is confirmed closed, STATUS = 1; when open, STATUS=2, and so on. But I don't actually have to write code to set those values - it's handled by the bit logic.
 
Said I didnt know nothing about it

Havent gotten the opportunity to use a Controllogix and RSL5000 so really didnt have a clue. Just read what I could find and it explained that bit addresses in boolean within UDT's didnt work as sometimes wanted.
Code:
DATATYPE HOA (FamilyType := NoFamily)
          DINT STATUS (Description := "RUNNING STATUS");
          BIT IS_OFF STATUS : 0 (Description := "CONFIRMED OFF/CLOSED",
              Radix := Binary);
          BIT IS_ON STATUS : 1 (Description := "CONFIRMED ON/OPEN",
              Radix := Binary);
          BIT ALARM STATUS : 2 (Description := "IN ALARM",
              Radix := Binary);
Does that mean you did use a DINT?

I understood the process but didnt understand all the details but in time I will get more of an understanding I hope.
 
Re: Said I didnt know nothing about it

rsdoran said:
Does that mean you did use a DINT?

I understood the process but didnt understand all the details but in time I will get more of an understanding I hope.

Gerry said it would be ok to use an INT or DINT, so I guess Allen decided to give it a shot.

I didn't understand it either, Ron. But I was curious and had the tools to try it. I also tried connecting to a hidden SINT. It CAN be done. I used an OPC topic in EXCEL to check this out. So, Allen, you can leave your DINT hidden, and you'll probably still be able to modify your UDT! Neat.

AK
 
Re: Said I didnt know nothing about it

rsdoran said:
Havent gotten the opportunity to use a Controllogix and RSL5000 so really didnt have a clue. Just read what I could find and it explained that bit addresses in boolean within UDT's didnt work as sometimes wanted.

When defining a UDT, the software is only clever enough to group consecutive BOOL's into a SINT. If there are more than eight consecutive BOOL's, additional SINT's are created. However, it won't collect all the BOOL's together if they're separated in the definition by other data types. All data has to align to a 32-bit boundary.

For example, if you defined the elements of your UDT in the following order:
  • BOOL1
  • BOOL2
  • SINT1
  • INT1
  • BOOL3
the resulting size of the data type would be 2 32-bit words (8 bytes), in spite of the fact that all the data could fit into a single 32-bit word. The first two BOOL's are grouped into a "hidden" SINT. SINT1 and INT1 are packed into the same 32-bit word as the hidden SINT. BOOL3 is put into a second hidden SINT.
 

Similar Topics

oops that would be a UDT or a UTD CSF_Array1 has four elements of Real I have a UDT named Cost_SQFT that has four elements Cost_SQFT.cost1...
Replies
4
Views
1,607
See the screenshot of EIP tag list. We are trying to read in a digital input that is hard-wired. It is shown here as I31.1. I believe we cannot...
Replies
7
Views
310
A couple days ago I accidentally toggled an alwasyoff bit. The issue is it was set up as a single OTU on a rung, nothing else, and used as XICs...
Replies
3
Views
238
Hi I have an old panel builder 32 that I’m replacing for a factory talk me hmi . In the plc for the old panel builder there is a coms bit for the...
Replies
0
Views
85
Hello, Haven't been on in a while. I need to generate a bit level pdf of the I/O for RSLogix 500. I can generate a report but it just shows the...
Replies
1
Views
177
Back
Top Bottom