nimbuscontrols / EIPScanner

Free implementation of EtherNet/IP in C++
https://eipscanner.readthedocs.io/en/latest/
MIT License
238 stars 98 forks source link

Communication with sick PLC gateway using EIPscanner #81

Closed smalik007 closed 1 year ago

smalik007 commented 2 years ago

Hi,

I am pretty new with the EIPScanner stack and trying to use it to communicate with Sick Gateway (more specifically FX3-GEPR00000) which then is connected to the main PLC and some other blocks. The gateway is the main linking point where all the data can be fetched from. I have a EDS file but I am not sure how to use the same here with the stack. The FileObjectExample.cpp example in the source seems to be using some output stream for uploading eds file, but I couldn't get the idea how I can I use the provided eds file from the vendor with the stack. I tried to use the explicit/implicit example too but they fails to establish connection with an error of 'what : Resource temporarily unavailable' eipscanner

I tried to dig dive more and enable the trace logs and found it actually establishes a TCP connection and then send some 24 bytes of data but does not get any reply from other side timesout and throws this error.

I am not sure the data sent here is some standard message of the TCP/IP stack but the gateway seems to not understand it. Here's the link for the eds file, any help is appreciated.

JohannesKauffmann commented 2 years ago

It seems like the Sick FX3 implements some custom protocol over TCP/IP. I wasn't able to find the EDS file you mentioned, but I did find this document, describing TCP/IP packet contents.

Note on page 7, port 9000 is mentioned. Without any further understanding of the device itself (I don't have one), since TCP/IP is mentioned, it seems like explicit messaging is implied.

EDS files are for implicit messaging, no? I don't know if and how you'd get the EDS file to work (or if you should, to get comms up and running). I haven't had the need to work with EDS files - only explicit messaging for now.

smalik007 commented 1 year ago

It turned out I was using wrong port for explicit messaging. As per standard the Ethernet/IP uses 44818 for explicit messaging. After changing the port the example code works as expected for explicit messages.

JohannesKauffmann commented 1 year ago

Good to hear that you got it resolved.