4

I have a I/O remote device (EIP-2017) with 8 analog inputs and it implements EtherNet/IP protocol for reading I/O values. I found on codeplex (https://eipnet.codeplex.com/) a library written in .net c# but it does not have documentation or example how to use it.

So, this is the target (I/O remote device) documentation:

We suggest users using Implicit Message communicate with EIP-2000. Implicit Messages are applied only for accessing the Input Instance 65 hex (101) and Output Instance 66 (102) of the Assembly Object in the object model. Before using Implicit Messages, you must use the Forward Open service with correct “Instance ID” and “Data length” settings of the Connection Manager Object to build a connection between the EtherNet/IP scanner and the EIP-2000. Afterwards, the Implicit Message can be used. The “Instance ID” of EIP-2000 modules are shown below, but the “Data length” is different from modules.

This device has the following,
Input (T->O) Instance ID: 0x65, Length: 53 bytes Out (O->T) Instance ID: 0x66, Length: 22 bytes Configuration Instance ID: 0x64, Length: 0 bytes

And I wrote these lines of code:

static void Main(string[] args)
        {
            byte[] sc = new byte[8] { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 };
            byte[] path = new byte[] { 0x20, 0x04, 0x24, 0x64, 0x2C, 0x66, 0x2C, 0x65 };

            SessionInfo si = SessionManager.CreateAndRegister("192.168.2.227", senderContext: sc);
            si.SetConnectionParameters(101, 3000, 101, 803, 888);

            EIPNET.ConnectionManager.ForwardOpen(si, path);

            bool CIPok = EIPNET.EIP.SessionManager.VerifyCIP(si);

            EIPNET.EIP.EncapsPacket p = new EncapsPacket();
            p.Command = (ushort)EncapsCommand.ListIdentity;
            p.SessionHandle = si.SessionHandle;
            p.SenderContext = sc;
            p.Length = 0;
            //p.EncapsData = new byte[53];
            byte[] rec = si.SendData_WaitReply(p.Pack());
}

I'm registering the session and then open connection with Forward Open command and then...nothing...

GEOCHET
  • 21,119
  • 15
  • 74
  • 98
serban.b
  • 109
  • 1
  • 2
  • 10
  • if anyone need something like this, it's a library here: https://eipnet.codeplex.com/ – serban.b Mar 04 '16 at 22:57
  • 1
    and everything else is written here http://read.pudn.com/downloads166/ebook/763212/EIP-CIP-V2-1.0.pdf and here https://www.odva.org/Portals/0/Library/Publications_Numbered/PUB00213R0_EtherNetIP_Developers_Guide.pdf – serban.b Mar 04 '16 at 22:59
  • See the question: http://stackoverflow.com/questions/31461069/read-write-values-using-ethernet-ip – JPelletier Jun 20 '16 at 15:20
  • @serban.b did you manage do get it working? can you please contact me via miscelaneo at gmail dot com? – impoetk Aug 09 '16 at 23:28

2 Answers2

1

Are you connected to a PLC/CompactLogix or any kind of device connected via Ethernet/IP? Also, Implicit Messaging (UDP) should only be used for critical tasks. If you are only reading registers from a data table in a device, you should use Explicit Messaging (TCP/IP).

Jarvis
  • 63
  • 1
  • 11
1

There is also a EtherNet/IP testing tool & library from german company Hilscher which can be found here: https://kb.hilscher.com/pages/viewpage.action?pageId=97444743

Edit Seems like there are multiple libraries around these days. Here is another one which also seems to be actively maintained: http://eeip-library.de/

Basically, for CIP class 0/1, you should open an Encapsulation session, send the ForwardOpen, and then the device should start sending you input data UDP frames and you should start sending your output data to the device. These might be multicast transports. A Wireshark trace would have been useful to tell what's going on.