siva Posted September 12, 2007 Report Share Posted September 12, 2007 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 1 Quote Link to comment
David Wisti Posted September 12, 2007 Report Share Posted September 12, 2007 I've been wanting to create Ethernet/IP VIs for some time now, Nice job! I have a ControlLogix 5555 CPU and a 1756-ENBT/A Ethernet/IP card to test these VIs. Once I have some free time, I will post my results. 1 Quote Link to comment
Kevin Boronka Posted September 12, 2007 Report Share Posted September 12, 2007 siva, I'm using a ControlLogix 5561 Controler R16, with a 1765-ENBT/A Ethernet Bridge. Any possibility of getting EtherNet_IP_CIP unlocked ? Quote Link to comment
siva Posted September 12, 2007 Author Report Share Posted September 12, 2007 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 ? 1 Quote Link to comment
siva Posted September 13, 2007 Author Report Share Posted September 13, 2007 I am Sorry for uploading some VIs with password protection in previous posts and for having very bad documentation.. I've removed some junk code in the VIs and now i've attached the unlocked VIs. Thanks and Regards Siva QUOTE(siva @ Sep 11 2007, 12:18 PM) 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 Quote Link to comment
ad-guest Posted November 6, 2007 Report Share Posted November 6, 2007 QUOTE(siva @ Sep 12 2007, 12:24 PM) I am Sorry for uploading some VIs with password protection in previous posts and for having very bad documentation..I've removed some junk code in the VIs and now i've attached the unlocked VIs. Thanks and Regards Siva it so great. thanks very much Quote Link to comment
Götz Becker Posted November 6, 2007 Report Share Posted November 6, 2007 QUOTE(siva @ Sep 12 2007, 05:24 AM) I am Sorry for uploading some VIs with password protection in previous posts and for having very bad documentation..I've removed some junk code in the VIs and now i've attached the unlocked VIs. Thanks and Regards Siva Hi Siva, thanks for sharing your work and I guess that took some time to fiddle through the bytearrays. I have just two hints (I hope you don´t see them as nagging) after looking at the code. I my eyes every cluster and enums should be typedefs (always). Using normal "Divide" by 2 for array lengths may have unwanted sideeffects for different odd length-arrays (due to DBL->Intger Rounding). I normally have more confidence in the "Quotient Remainder" function for this. just my 2 cents and thanks again for sharing your code! Quote Link to comment
siva Posted November 6, 2007 Author Report Share Posted November 6, 2007 QUOTE(beckerg @ Nov 5 2007, 05:10 PM) Hi Siva,thanks for sharing your work and I guess that took some time to fiddle through the bytearrays. I have just two hints (I hope you don´t see them as nagging) after looking at the code. I my eyes every cluster and enums should be typedefs (always). Using normal "Divide" by 2 for array lengths may have unwanted sideeffects for different odd length-arrays (due to DBL->Intger Rounding). I normally have more confidence in the "Quotient Remainder" function for this. just my 2 cents and thanks again for sharing your code! 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. Quote Link to comment
siva Posted November 7, 2007 Author Report Share Posted November 7, 2007 QUOTE(beckerg @ Nov 5 2007, 05:10 PM) Hi Siva,thanks for sharing your work and I guess that took some time to fiddle through the bytearrays. I have just two hints (I hope you don´t see them as nagging) after looking at the code. I my eyes every cluster and enums should be typedefs (always). Using normal "Divide" by 2 for array lengths may have unwanted sideeffects for different odd length-arrays (due to DBL->Intger Rounding). I normally have more confidence in the "Quotient Remainder" function for this. just my 2 cents and thanks again for sharing your code! 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 Quote Link to comment
siva Posted November 9, 2007 Author Report Share Posted November 9, 2007 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. Quote Link to comment
mysterj Posted November 29, 2007 Report Share Posted November 29, 2007 Siva: Thanks for creating these VI's -- this will save a great deal of effort! One question: The lower level VI's are password protected. Will you provide the passwords so we can see what's inside? Thanks! - Keith Quote Link to comment
longzoo Posted December 5, 2007 Report Share Posted December 5, 2007 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 Quote Link to comment
siva Posted December 5, 2007 Author Report Share Posted December 5, 2007 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. Quote Link to comment
longzoo Posted December 5, 2007 Report Share Posted December 5, 2007 Siva, I cannot thank you enough! The register was in fact configured as 1 and now that we have it set to 200, i can access all 200 with your vis. And thanks again for the documents...I will look over those as soon as I get my main vi written (or as i need to during the programming Warm regards, Dave QUOTE(siva @ Dec 4 2007, 01:40 PM) Hi longzoo,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. I got the protocol information by Reverse engineering the TCP messages between PLC/SCADA. and by using DF1 Protocol Spec Document, 5000 Data access document., You can find these docs in Rockwell Software Knowledge Base Section. If you are not able to find, then please drop me a mail at sivamgr@gmail.com and I ll send you all the docs and notes. Quote Link to comment
DougyMoore Posted January 5, 2008 Report Share Posted January 5, 2008 I need to know how things would change to access string registers in a MicroLogix 1100 vs. the integer files. Anybody know this? QUOTE(siva @ Sep 11 2007, 06: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 Quote Link to comment
daviid Posted January 10, 2008 Report Share Posted January 10, 2008 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 Quote Link to comment
DougyMoore Posted January 10, 2008 Report Share Posted January 10, 2008 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 SivaIt 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 Quote Link to comment
daviid Posted January 10, 2008 Report Share Posted January 10, 2008 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? 1 Quote Link to comment
DougyMoore Posted January 10, 2008 Report Share Posted January 10, 2008 Sorry, No. QUOTE(daviid @ Jan 9 2008, 03:03 PM) I was actually looking for a 7.1 version of the CIP version. Do you have this also? Quote Link to comment
jared Posted January 11, 2008 Report Share Posted January 11, 2008 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 Quote Link to comment
siva Posted January 11, 2008 Author Report Share Posted January 11, 2008 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. 1 Quote Link to comment
jared Posted February 29, 2008 Report Share Posted February 29, 2008 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. Quote Link to comment
siva Posted March 1, 2008 Author Report Share Posted March 1, 2008 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 Quote Link to comment
jared Posted March 14, 2008 Report Share Posted March 14, 2008 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) 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 Link to comment
jared Posted May 28, 2008 Report Share Posted May 28, 2008 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 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.