Industrial Communications

cancel
Showing results for 
Search instead for 
Did you mean: 

EthernetIP to CompactLogix PLC help please

Hello list,

 

I originally posted this on the Labview programming board but it was suggested that I post it here.

 

I’m not new to Labview programming but I am new to using it with a PLC.  I have an Allen Bradley CompactLogix L24ER, and I have purchased the Ethernet/IP toolkit here ->http://sine.ni.com/nips/cds/view/p/lang/en/nid/209676

 

Since the Help is so sparse, there are almost no examples, the VI’s are password protected, and I have been told by NI Tech Support that this product is not supported by them but NI R&D instead(?), I am turning to the community for help (where I probably should have gone first anyway.)

 

It is my understanding that this package will read & write “Controller Tags” and not “Program Tags”.  I have modified one of the example VI’s to just send & receive Booleans. It is attached.  Using it, I am attempting to read and write individual bits of the “Local:1:O.Data” register, by reading or writing to the Tag Name “Local:1:O.Data.x, where “x” represents the bit I want to read or write. 

 

So I have several questions.

 

Since the “EthernetIP Tag Write.VI”, when set to “BOOL” expects an array of Booleans, is it even possible to write and read a single bit of the PLC? I know that things like “Panelview” products will read and write to individual bits, so if this is the case, is it a limitation of these VIs that will allow them to only read and write arrays of 16 bits?

 

The value of the “BOOL tag” in the control is the same as the Tag Name in the “Controller Tags” of the PLC, but, from the error I’m getting, it looks like I’ve got the name formatted wrong or something wrong with the syntax.

 

At the suggestion of someone in NI Tech Support, I have been successful setting the VIs in my example to “INT” and reading “Local:1:O.Data”, but I am unable to write to it, so I know that my communications is working somewhat.  But I would really like to read and write to individual bits if that is possible.

 

I have attached my VI, a screenshot of my PLC registers, and a snapshot of my front panel showing the error I’m seeing.

 

I would like to be able to read and write on the bit level if possible.  If this package will not do that, is there one that will?

 

Any help would be appreciated.

 

Thanks,

Mike

0 Kudos
Message 1 of 6
(8,202 Views)

Hi Mike,

 

Unfortunately, our normal Ethernet/IP support team is out of office until next Thursday.  The CIP error indicated typically means that the PLC does not support the task you're attempting to do.  You may need to consult the vendor of the PLC to know what are valid commands for the PLC.  Further, we may need a wireshark to further discover where the communication is breaking down.  This error that you are seeing is independent of the EtherNet/IP Toolkit. 

Matt S.
Industrial Communications Product Support Engineer
National Instruments
0 Kudos
Message 2 of 6
(8,194 Views)

Matt,

 

Thank you for the reply.

 

As far as valid commands for the PLC, what I can tell you is that you can use this PLC with an Allen Bradley MMI connected to the Ethernet port, that MMI is able to read and write individual bits in the PLC.  That is why I expected the EtherNet/IP Toolkit to be able to do the same thing.

 

Mike

 

 

0 Kudos
Message 3 of 6
(8,187 Views)

Hi Mike,

 

Sorry for late response! China has been on holiday for the whole week.

 

As I understand, your question is that whether it is possible to write and read a single bit.

I'm afraid the answer is no.

The reason lies in some of the implementation details of how Rockwell's devices store and communicate data differently.

In your example, the PLC shows a INT as simply being an array of 32 BOOLs. This is specific programming-wise inside their software, because you can use the INT as a bit-field seamlessly in your ladder logic. However, the data item itself is not an array of BOOLs and the PLC will not let you access it as such over EtherNet/IP. So the "bit" you see is not a real "bit " and not available for you to be read as a "bit".

If you want a single bit, you need to get the INT itself and use LabVIEW functions to parse out a bit array and then get the bit you want.

 

Any further questions, please let me know.

Thanks.

 

Wendy

0 Kudos
Message 4 of 6
(8,095 Views)

The parsing is fine for reading. However NI should be able to implement the writing of a single bool element in an array. It does allow for the writing of a single bool bit just not an element of the structure. 

0 Kudos
Message 5 of 6
(4,313 Views)

Has this been fixed? I am having the same issue and wonder what the solution was.

0 Kudos
Message 6 of 6
(3,075 Views)