Jump to content

Industrial EtherNet (EtherNet/IP)


Recommended Posts

Implementation of Common industrial Protocol (CIP) via EtherNet [EtherNet/IP (CIP)]

EtherNet_IP_PCCC

Use these set of VIs to communicate with MicroLogix Series PLCs Via EtherNet.

These VIs use simple TCP/IP Communication.

Communication : Ethernet, TCP/IP

Protocol : EtherNet/IP

Service :CIP (For Connection Management), CIP Service for PCCC

Command : PCCC

Tested with : MicroLogix 1100, MicroLogix 1500,1200(with NET-ENI)

No OPC Server Required

No Automation Server Required

No NI-DSC Module Required.

Note: These VIs access N7 Integer File. To access other Files in the PLCs, just replace the "Fileno" Constant(0x07) with a Control and make it as a parameter to the SubVI.

EtherNet_IP_CIP

Use these set of VIs to communicate with CompactLogix, Control Logix Series PLCs, Any Device that supports CIP(EtherNet/IP)

These VIs uses simple TCP/IP Communication.

Communication : Ethernet, TCP/IP

Protocol : EtherNet/IP

Service :CIP (For Connection Management, Read, Write)

Command : CIP Commands

Tested with : Compact Logix Series PLCs

No OPC Server Required

No Automation Server Required

No NI-DSC Module Required.

Visit : ODVA Website for EtherNet/IP Protocol Specification

  • Like 1
Link to comment

Sure..

Attached the Unlocked VIs.

I would appreciate, if somebody updates the code as per guidelines and makes it available free to all.

Thanks and Regards

Siva

QUOTE(Kevin Boronka @ Sep 11 2007, 07:53 PM)

siva,

I'm using a ControlLogix 5561 Controler R16, with a 1765-ENBT/A Ethernet Bridge. Any possibility of getting EtherNet_IP_CIP unlocked ;) ?

  • Like 1
Link to comment
Link to comment
  • 1 month later...

QUOTE(beckerg @ Nov 5 2007, 05:10 PM)

Hi beckerg,

Thanks for your suggestions. Your suggestions are included into the code along with some other changes. I am waiting for the testing to happen. Once tested, the updated code will be uploaded into the LAVA code repository.

Link to comment

QUOTE(beckerg @ Nov 5 2007, 05:10 PM)

I've analysed the sub vi for this issue.

The Number of elements in the frame will always be an even number. Hence, Int(SizeOf(@array)/2) gives the same result as Quotient(Number=SizeOf(@array), Divisor=2). At no case, the frame will get composed of odd number of elements. Thats why the component is running with no-errors.

anyway, its good to use quo-rem operator for this purpose. thanks for the suggestion

Link to comment

The Present set of VIs does not fully support reading/writing of the following types of tages

1) Timer Tags

2) Control Tags

3) Counter Tags

4) Data Structures

However ACC, PRE elements of timer\control\counter tag-structures can be accessed.

To access ACC element of a Timer, say timer-1, use "timer1.ACC" as Tag-name and Datatype as DINT. Similiarly, to access Preset Element, use "timer1.PRE" as tag-name and DINT as datatype. By using this method, ACC, PRE of Timer, Control and Counter tags can be accessed.

Note: "ACC", "PRE" should be in Upper Case.

Link to comment
  • 3 weeks later...

Hi Siva,

I am attempting to use your EtherNet_IP_PCCC.zip files to communicate with a MicroLogix 1500. My problem is with writing to the PLC. I made a small test vi that uses your init, update registers, scan registers, and terminate vis. If i write a value, say 1F3A, to offset 0 all is well. I can read the 1F3A in the register array with no errors. But if i try to write to any other offset, say 2 or 4, i get a data error on the update register vi and when i try to read that offset i get a value that looks like a timer that is continually scanning. I guess i dont understand the registers :(

Where did you get the information to set up the clusters for your vis? This is probably what would point me in the right direction.

Thanks so much for the vis! i can tell that you have spent alot of time/work creating them. Once i get an understanding of the registry on the 1500 i feel sure communications will be a breeze :)

QUOTE(siva @ Sep 11 2007, 01:48 AM)

Implementation of Common industrial Protocol (CIP) via EtherNet [EtherNet/IP (CIP)]

EtherNet_IP_PCCC

Use these set of VIs to communicate with MicroLogix Series PLCs Via EtherNet.

These VIs use simple TCP/IP Communication.

Communication : Ethernet, TCP/IP

Protocol : EtherNet/IP

Service :CIP (For Connection Management), CIP Service for PCCC

Command : PCCC

Tested with : MicroLogix 1100, MicroLogix 1500,1200(with NET-ENI)

No OPC Server Required

No Automation Server Required

No NI-DSC Module Required.

Note: These VIs access N7 Integer File. To access other Files in the PLCs, just replace the "Fileno" Constant(0x07) with a Control and make it as a parameter to the SubVI.

EtherNet_IP_CIP

Use these set of VIs to communicate with CompactLogix, Control Logix Series PLCs, Any Device that supports CIP(EtherNet/IP)

These VIs uses simple TCP/IP Communication.

Communication : Ethernet, TCP/IP

Protocol : EtherNet/IP

Service :CIP (For Connection Management, Read, Write)

Command : CIP Commands

Tested with : Compact Logix Series PLCs

No OPC Server Required

No Automation Server Required

No NI-DSC Module Required.

Visit : http://www.odva.org/' target="_blank">ODVA Website for EtherNet/IP Protocol Specification

Link to comment

QUOTE(longzoo @ Dec 4 2007, 11:53 PM)

Hi Siva,

I am attempting to use your EtherNet_IP_PCCC.zip files to communicate with a MicroLogix 1500. My problem is with writing to the PLC. I made a small test vi that uses your init, update registers, scan registers, and terminate vis. If i write a value, say 1F3A, to offset 0 all is well. I can read the 1F3A in the register array with no errors. But if i try to write to any other offset, say 2 or 4, i get a data error on the update register vi and when i try to read that offset i get a value that looks like a timer that is continually scanning. I guess i dont understand the registers :(

Where did you get the information to set up the clusters for your vis? This is probably what would point me in the right direction.

Thanks so much for the vis! i can tell that you have spent alot of time/work creating them. Once i get an understanding of the registry on the 1500 i feel sure communications will be a breeze :)

I'm afraid that the Number of Registers in N7 File of your PLC is configured as 1. Configure the N7 File Size accordingly before using the VIs.(You can set the no of registers in N7 as 256).

Hope this would solve the problem. If not, Please send a Snapshot of the test VIs.

Link to comment
  • 1 month later...

Here's my 7.1.1 version of the PCCC routines. There's one difference in the way I come up with the first ID code (in the "CPF" protion of the frame) from the tick count. Siva divides by 2^16 and takes the remainder so this should be the same as the lower Word of the tick count, but I couldn't get that to work so used the high Word instead and it works fine. I'm not sure why there's a difference.

Have fun!

QUOTE(daviid @ Jan 9 2008, 09:53 AM)

Hello Siva

It seems like a nice vi package. Do you have the possibility to save it in labview 7.1 format? I don't have the latest labview version.

/David

Link to comment

QUOTE(DougyMoore @ Jan 9 2008, 03:07 PM)

Here's my 7.1.1 version of the PCCC routines. There's one difference in the way I come up with the first ID code (in the "CPF" protion of the frame) from the tick count. Siva divides by 2^16 and takes the remainder so this should be the same as the lower Word of the tick count, but I couldn't get that to work so used the high Word instead and it works fine. I'm not sure why there's a difference.

Have fun!

I was actually looking for a 7.1 version of the CIP version. Do you have this also?

  • Like 1
Link to comment

QUOTE(siva @ Sep 11 2007, 12:48 AM)

Implementation of Common industrial Protocol (CIP) via EtherNet [EtherNet/IP (CIP)]

EtherNet_IP_PCCC

Use these set of VIs to communicate with MicroLogix Series PLCs Via EtherNet.

These VIs use simple TCP/IP Communication.

Communication : Ethernet, TCP/IP

Protocol : EtherNet/IP

Service :CIP (For Connection Management), CIP Service for PCCC

Command : PCCC

Tested with : MicroLogix 1100, MicroLogix 1500,1200(with NET-ENI)

No OPC Server Required

No Automation Server Required

No NI-DSC Module Required.

Note: These VIs access N7 Integer File. To access other Files in the PLCs, just replace the "Fileno" Constant(0x07) with a Control and make it as a parameter to the SubVI.

EtherNet_IP_CIP

Use these set of VIs to communicate with CompactLogix, Control Logix Series PLCs, Any Device that supports CIP(EtherNet/IP)

These VIs uses simple TCP/IP Communication.

Communication : Ethernet, TCP/IP

Protocol : EtherNet/IP

Service :CIP (For Connection Management, Read, Write)

Command : CIP Commands

Tested with : Compact Logix Series PLCs

No OPC Server Required

No Automation Server Required

No NI-DSC Module Required.

Visit : http://www.odva.org/' target="_blank">ODVA Website for EtherNet/IP Protocol Specification

Hi, I tried the VIs using a control to replace the "Fileno" Constant(0x07), However I got errors for each N value I tried, except for N7... Any ideas where my problem is? Also, if I want to write o read a Bit, do I only need to change the FileType to 0x85?

Thanks

Link to comment

QUOTE(jared @ Jan 11 2008, 05:00 AM)

Hi, I tried the VIs using a control to replace the "Fileno" Constant(0x07), However I got errors for each N value I tried, except for N7... Any ideas where my problem is? Also, if I want to write o read a Bit, do I only need to change the FileType to 0x85?

Thanks

Hi Jared, By Changing the Constant(0x07),. any Integer file can be accessed. But, before changing the constant, create that particular file in the PLC and configure it as integer. also configure the number of registers in that file as required. Accessing Bool File directly is a bit tough. Instaed of accessing a Bool File., You can keep some registers in the N7 and access it. In plc side, keep a logic to read from the integer file register and update the bool file. Use one of the these values for this field. Do not use any othervalues; doing so may result in unpredictable results.

Admin Note: Content removed because it was messing up the RSS feed. Please don't use nonprintable characters in posts. Next time use an image of the content.

  • Like 1
Link to comment
  • 1 month later...

Thanks for all the help you have giving me previously... I am using your EtherNET/IP VIs but I had problems when trying to use the Update VI. I have several instances of the SCAN VI to read different integers, but as soon as I try to use a Scan VI to write a value to the PLC I get an error (something that has to do with the network busy or something like that). Any ideas of why this error and what do to to fix it. The weird thing is that when I use the Test program you provide (one SCAN and one Update) it works fine... but as soon as I put it in MY program with multiple Scans, then I get the error. Any ideas will be greatly appreciated.

Jared

QUOTE(siva @ Jan 10 2008, 06:32 PM)

Hi Jared, By Changing the Constant(0x07),. any Integer file can be accessed. But, before changing the constant, create that particular file in the PLC and configure it as integer. also configure the number of registers in that file as required. Accessing Bool File directly is a bit tough. Instaed of accessing a Bool File., You can keep some registers in the N7 and access it. In plc side, keep a logic to read from the integer file register and update the bool file. Use one of the these values for this field. Do not use any othervalues; doing so may result in unpredictable results.

Admin Note: Content removed because it was messing up the RSS feed. Please don't use nonprintable characters in posts. Next time use an image of the content.

Link to comment

These VIs cannot function properly if put in parallel. PLease do the following to over come the proble,

1) Build a Wrapper VI (Driver VI / a single Interface VI) using 3 VIs(Init, Update, Scan) as SubVIs

2) Use the Wrapper VI in your code instead of directly calling Init, Update or Scan..

This will overcome the race around condition..

Please write to sivamgr@gmail.com if you face any problem in implementing this..

QUOTE(jared @ Feb 29 2008, 05:35 AM)

Thanks for all the help you have giving me previously... I am using your EtherNET/IP VIs but I had problems when trying to use the Update VI. I have several instances of the SCAN VI to read different integers, but as soon as I try to use a Scan VI to write a value to the PLC I get an error (something that has to do with the network busy or something like that). Any ideas of why this error and what do to to fix it. The weird thing is that when I use the Test program you provide (one SCAN and one Update) it works fine... but as soon as I put it in MY program with multiple Scans, then I get the error. Any ideas will be greatly appreciated.

Jared

Link to comment
  • 2 weeks later...

Hi Siva,

thanks for your reply... I do not know how to implement what you are suggesting... I went to NI.com trying to find info regarding wrapper VIs and Drive VIs but I could not find anything. I will be reading a lot of data, but only sending one bit of information (to stop the system). Is there an example where I can see how to do this??

Thanks again for your help

Jared

QUOTE (siva @ Feb 29 2008, 03:51 AM)

Link to comment
  • 2 months later...

Hi Siva,

I have been using your set of VIs for communicating PLC with LabVIEW via Ethernet IP. I am experiencing a problem with a particular PLC... while I am communicating seems like a loose signal for an instant and then I get an error... the only way to get the program working again is to reset the AB ENI converter (that converts serial to ethernet from the PLC). When I monitor the PLC by itself I have noticed that the ms for each scan is very slow... this PLC manages a lot of variables and I guess that amount of data makes the data transfer very slow... I wonder if there is an instant in which the VI does not get data and that is why it get an error. Any ideas??

Thanks,

Jared

QUOTE (jared @ Mar 12 2008, 06:21 PM)

Hi Siva,

thanks for your reply... I do not know how to implement what you are suggesting... I went to NI.com trying to find info regarding wrapper VIs and Drive VIs but I could not find anything. I will be reading a lot of data, but only sending one bit of information (to stop the system). Is there an example where I can see how to do this??

Thanks again for your help

Jared

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.