ControlLogix Structure Bit Word

kamenges

Member
Join Date
Nov 2002
Location
Green Bay, WI
Posts
4,332
I am designing a system with a ControlLogix 5555 processor that will communicate to five AB1336E drive on ControlNet through a 1203-CN1 CNet to ScanPort adapter. In the CLX program I want to create a user defined data type that represents my data coming back from and going to the drives. My problem is in the status and command bit words. When you define a BOOL in a structure, Logix5000 immediately reserves a DWORD and fills in consecutive BOOLs in that DWORD until the DWORD is full. The 1203-CN1 and the 1336E send back the command and status words as 16-bit words. So trying to embed a bit structure into the drive data structure will shift all the words after the bit words by one word.
Is there a way to force Logix5000 to use a 16-bit word when defining a structure of BOOLs for a case such as mine?

Thanks,
Keith
 
Nope. You can either use the BOOL data type and ignore the upper 16 bits or just use an INT and access it at the bit level. That is what I do for accessing over DeviceNet or ControlNet.
 
Logix 5000 will "jump ahead" after a BOOL to the next 32-bit boundary in a UDT if the next element is 32 bits or larger, but not if the BOOLs are followed by a SINT or INT.

When I use 16-bit SCANport devices on DeviceNet or ControlNet, I use several BOOL (less than 16) elements followed by an INT element for the speed reference/ feedback. This makes a UDT that is only 4 bytes (2 Words) long and fits the SCANport image perfectly.

[attachment]

impact_command.gif
 
Thanks guys.
I was trying to get too cute. I was making a second UDT that was a bit layout for the command and status words. In your example the start bit is dereferenced as Drive.Start. I was trying to do something like Drive.Command.Start with Command being a separate UDT that contained only BOOLs. In that case the UDT Command comes out as 4 bytes and if I put that in my Drive UDT the data would get shifted.

Thanks again.
Keith
 
Oh ! I hadn't thought of making a compound UDT for that. Yes, I can see how that would expand to 4 bytes and screw up your intended structure.

Good luck with the IMPACT drive project !
 

Similar Topics

When adding an IFM AL1322 IO-Link Master Module to a 1756-EN2T Ethernet Card on a 1756-L82E Controller, The Input and Output data file does not...
Replies
0
Views
105
Is this possible? I'm looking at the "Instruction Logic" of the AOI block (which is the *instance*, correct?) (a VFD AOI called "P_VSD"), and on...
Replies
2
Views
1,555
Why does the controllogix redundancy modules use a single mode fiber vs multimode fiber?
Replies
1
Views
78
Hello, I have two 16 point input cards and 1 16 point output card showing module faulted on my IO tree in Logix Designer. The fault code is...
Replies
7
Views
214
Hello, My associate and I are trying to sync up two ControlLogix racks (7-slot chassis) with identical modules. We are able to see the secondary...
Replies
4
Views
193
Back
Top Bottom