LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

EthernetIP Help Please

Hello list,

 

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, 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.

 

  1. 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?

 

  1. 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.

 

Any help would be appreciated.

 

Thanks,

Mike

0 Kudos
Message 1 of 17
(5,223 Views)

http://forums.ni.com/t5/Industrial-Communications/bd-p/260

 

Have you tried these forums?  There's usually some more EIP folks lurking around in there.  

0 Kudos
Message 2 of 17
(5,206 Views)

Sorry I did not.

 

I will repost over there.

 

Thanks,

Mike

 

0 Kudos
Message 3 of 17
(5,198 Views)

I'm curious if you're able to work with the array of booleans and only read/write the element you're interested in to get the value you want.  I'd suspect any software to do that for you behind the scenes if it wasn't showing you that it was happening.  I'm unaware of any single bit transmissions taking place.

0 Kudos
Message 4 of 17
(5,187 Views)

 

I was able to change the VI I attached from "BOL" to "INT", chaged the data I was writing and reading from "Boolean Arrays" to "I16" and then I could read the 16 bit BOOLEAN register in the PLC, but I was still unable to write to it using the same tag name I was reading it with "Local:1:O.Data".  I get the following error:

Details:CIP Error - Extended Status may be available

CIP Status: 0xff (General error)

CIP Extended Status: 0x2105 (Address and count out of range)

 

Mike

 

 

0 Kudos
Message 5 of 17
(5,172 Views)

Hello Mike,

    I am in the same boat as you are, I am attaching Presentation of what i learned about Ethernet Tag Read and Write. let me know if you have any questions.

 In short :

1) Yes, you can Read and Write only controller Tags no Program Tags.

2) If tags are Independent i.e. Not in an Array then it is Very easy to Read and Write.

3) You can not Read or Write to UDT's at all.

4) You can not Write to element in an array other then 0th element.

         I have multiple times to NI and same response i get like yours. R&D team supports this tool kit.

I have no luck so far from NI Tech Support team to resolve my issues.

   Please note if you are trying to Write Tag in to an Array it will make only that that Tag "ON" and rest of the tags will become zero.

In my PPT you can see one can write only 0th element of Array rest of the bits in that array will become zero.

      In my example i am using compact Logix L32E Processor.

 

  

Thanks

Sanjay

0 Kudos
Message 6 of 17
(5,020 Views)

Hello,

     In My previous post i was trying to Write Tags in to an array and was able to do only 0th element and mentioned that i was getting an error when i tried to write two tags at the same time. Yes, i was getting an error but now i dig in to more for this and find out you can write multiple tags in to an array.

Please see attached slide that how you can do this. I hope this helps.

 

  I still could not able to find out how to Read UDT's. If anyone can find out please post here that would be big help.

 

Thanks

Sanjay

0 Kudos
Message 7 of 17
(4,991 Views)

Sanjay,

 

Thank you for the information...we both have the same issues.

 

I think I have what I need to do working, but this would have been a lot easier if some PLC specific examples and better documentation had been provided. 

 

It is my understanding that there is now a CAR that will fix the documentation, so that this tool set doesn't advertise things that it does not do.  I hope the CAR also includes some good examples with the package.

 

Mike

 

 

 

 

 

 

0 Kudos
Message 8 of 17
(4,952 Views)

Mike, 

Thank you for following up.

I hope NI Tech support next release will resolves issues with this Toolkit.

 

Regards

Sanjay

 

0 Kudos
Message 9 of 17
(4,911 Views)

Sanjay (or anyone else),

 

So how fast/often can I expect to be able to read & write Controller Tags since there will be no ladder running in my PLC?

 

Thanks,

Mike

 

 

0 Kudos
Message 10 of 17
(4,770 Views)