Controllogix message read

wanher3

Member
Join Date
Feb 2018
Location
USA
Posts
65
Hello,

I am trying to read a controllogix 32 bit array from a compactlogix using the MSG instruction and CIP Data Table Read message Type.
So I created a 32 bit array in my compactlogix and set it as the Destination element in my message configuration.
However, I am getting the error "Message references a tag of BOOL data type."

Can a BOOL array not be read with another BOOL array of same length from a contrologix ? What can be happening here ?

Thanks
 
Last edited:
I think that if you can create a user defined file that contains the 32 bit array. This can be transferred to a SINT array by using the COP instruction.
 
Hi,

I am not following what you are trying to say. Could you be more specific. I am using RSLogix 5000.

Thanks
 
Rockwell intentionally does not support the BOOL datatype, either individually or in arrays, with the MSG instruction.

The best workaround is to pack your BOOL[x] array data into the DINT.x bits of a DINT datatype, and transfer that with your MSG instruction.

I personally prefer to use a subroutine or an AOI to pack and unpack BOOL[x] arrays one bit at a time, instead of trying to do any fancy tricks with UDTs and other data types. Brute force might not be elegant, but it's fast and easy to understand.
 
You can use bits from integers, but they still need to be copied to the message structure. Rockwell messaging transfers data in 8 byte packets (SINT). If you monitor the "WriteParams" tag, there will be a SINT array. You can copy anything to the array using the COP instruction as long as data is in the form of a file. A user defined tag structure can qualify as a file even if it contains a single BOOL. Copying 1 to 32 BOOLS in a user defined tag will use 4 bytes or an array of 4 SINTs. There are rules when creating user defined tags to allocate memory efficiently, but it is easy to calculate when there is only one tag type in the structure.

A read of a message will be in reverse where the SINT array is copied to the user defined tag, file of integers, or strings.
 
Last edited:
In my programs, I have rarely use a Bool array. From the standpoint on what you are doing, a 32 Bool array is the same thing as a DINT addressed to the bit level.

Bool array addressing uses a bool tag with a length. Addressing looks like this. tagname[0], tagname[1] and so on to the length of the array.

I generally will use a single DINT tag which gives me 32 bool bits. The Dint addressing down to the bit level is about the same. For example, tagname.0, tagname.1 and so on to the 32nd bit of the DINT.

This will let you use the DINT tag in your message. I'm sure there are reasons to use the Bool array but for the most part, I have never found much use for it.

I would be interested in knowing the reason why one would use a BOOL array instead of a DINT, other then the 32 bit boundary of the DINT.
 
Thanks guys, this is an existing program that uses Array[32] message for remote status. I will change that program to use DINT instead; the bits from that array aren't currently being widely used so it should be a quick clean up as well.
 
You may already be aware of it, but produce/consume connection is usually a preferred way of doing this between RS5k PLCs vs a MSG instruction. Main downside though is you can't add to the tags to be read while online.
 

Similar Topics

I would like to Read the CPU Usage % information like the Task Monitor tool provides from one ControlLogix to another via a CIP Message. Comms...
Replies
12
Views
5,881
I am trying to read a data table in a Micrologix over ethernet. I set up the table N11 in the Micrologix
Replies
1
Views
3,396
I have a 1756-L62 that is sending a message to give a 1769-L24ER a permissive bit to run. This system has been working fine for about 2 years...
Replies
4
Views
3,758
Hey everyone, Got called out tonight on an issue with a ControlLogix L62 processor, curious if anyone has seen anything like this before. I've...
Replies
3
Views
1,623
ControlLogix 5575 (L75): Sudden/Repeating "Unconnected Message Timeout" (0204) This ControlLogix PLC (L75/5575) has been in operation for at...
Replies
24
Views
10,561
Back
Top Bottom