Open adryash opened 2 months ago
This is a support request, and not yet known to be an issue (aka bug report). It would have been better posted to the discussion section. However I respond:
The Fanuc implementation of Ethernet/IP is somewhat limited. I know we have installs where we have had success talking with it, but its been months and my memory is not clear regarding the difficulties. To paraphrase the problem, try and relate this to the situation: the spec can say "all of the above is ok", yet Fanuc will only support a very specific subset of all of the above. I was not impressed with their implementation, and even less impressed with the support that was unavailable to my customer from them.
To make a guess, I think the format or sequence of SockAddr fields in one of our replies was bothering them, even though you could clearly see we were within spec.
I would start by bringing in wireshark. The packet decoding within that tool is very good for EIP. Perhaps it will show some kind of disagreement. You should be able to see both directions of traffic. On linux we just fire up tcpdump, create a capture file, and then transfer it to a desktop for examination by wireshark later.
Attached is a script we use to fire up tcpdump.
If that shows nothing, then I'd ask on an EIP forum about the brain dead or old form of the SockAddr sequence that this robot can handle. You could dumb down the code to work around the problem most likely.
INTERFACE=any
FILE=/tmp/eip.cap
rm "$FILE" 2> /dev/null
tcpdump -nn -i $INTERFACE -w "$FILE" 'udp port 2222 or tcp port 44818'
Thanks for your reply! I tried Wireshark and to be honest, I do not see anything special there. There is a proper request-response sequence of List Services, Register Session and Forward Open. After the last one the robot just sends TCP RST to my adapter and that's it. Could you give me some more explanation about what can be wrong with the SockAddr? Maybe I can try to change some lines in the CIPster code to check other possibilities?
Update: I made it work. We have to send the O->T Saii in the forward open reply even if we are using standard 0x08AE port. Now FANUC robot connects properly to my adapter using CIPster library. I made a proper pull request for next generations.
Hello @adryash , I think we are trying to achieve the same thing, only you are much more knowledgable regarding CIP. I am basically trying to implement this: https://github.com/UofI-CDACS/fanuc_ethernet_ip_drivers, only in C++, so reading and writing (position) registers. Looking at the code, it sends an explicit generic message, but I am not sure how I can implement this using CIPster. Looking at the sampleapplication.cc
, would I just create an explicit message assembly and populate the uint8_t
array with with class code, service, instance and attribute? I can't find where the actual send happens in the example though...
I am trying to write a C++ EtherNet/IP Adapter that will communicate with a FANUC robot configured as a Scanner. Unfortunatelly, after exchanging 3 messages I get
recv() error: Connection reset by peer
and I don't know why. It seems that the robot for some reason refuses the Forward Open response, even if on the C++ side everything works fine.My code is in general very similar to the code from sample_application, configured to work with the robot.
From my
BeforeAssemblyDataSend
method I tried returning true, false, writing something in my buffer or not doing anything - each time without luck.My Scanner configuration on the robot side is:
When I set the connection Enable to TRUE, I get an error:
And the Status is for the whole time OFFLINE.
In my C++ Adapter I get logs:
What am I doing wrong? Is there any other thing to configure that I am not aware of? Or maybe the protocol versions are incompatible?