PLC 5/40e Ethernet support

89 views
Skip to first unread message

alpep

unread,
Feb 17, 2021, 11:10:17 AM2/17/21
to libplctag
Hi,
I am using the application tag_rw.exe with the libplctag v2.3.2  to test two PLCs.
The PLC 5/80e is working fine but the PLC 5/40e give me the error PLCTAG_ERR_TIMEOUT.

I have tested both PLCs with another old library and both PLC are working fine.
I wondering if the PLC 5/40e is supported by the libplctag  or if I missing something.

I produced two debug files (level 4) with the tag_rw for both PLCs if it can help you.
Best regards,
Alain

Kyle

unread,
Feb 17, 2021, 1:25:41 PM2/17/21
to libplctag
Hi Alain,

Yes, the debug files would be helpful.   I recall another user had a problem with some PLC/5 systems that were not upgraded to use PCCC over CIP (Ethernet/IP).   In that case they use a different protocol called CSP (there are other names) on a different port: 2222.  

I do not have access to a system with CSP so there is unfortunately no way I can test code to support it.   I have Ron Gage's code from years ago that supports it and I can see what the packets look like but I have no PLC that supports it.  I am happy to take patches!

Some libraries do support both CSP and PCCC/EthernetIP.

Best,
Kyle

alpep

unread,
Feb 18, 2021, 5:35:03 AM2/18/21
to libplctag
Hi Kyle,
Here are the debug files I generated with the tag_rw.

Best regards,
Alain

PLC80_d4.txt
PLC40_d4.txt

Kyle

unread,
Feb 18, 2021, 11:22:25 AM2/18/21
to libplctag
I see the following for the PLC-5/40:

2021-02-17 09:38:55.021 thread(2) tag(0) DETAIL session_open_socket:636 Using default port 44818.
2021-02-17 09:38:55.021 thread(2) tag(0) DETAIL socket_connect_tcp:1053 Starting.
2021-02-17 09:38:55.021 thread(2) tag(0) DETAIL socket_connect_tcp:1102 Found numeric IP address: 142.10.10.102
2021-02-17 09:38:55.021 thread(3) tag(0) INFO tag_tickler_func:197 Starting.
2021-02-17 09:38:57.084 thread(2) tag(0) WARN socket_connect_tcp:1173 Unable to connect to any gateway host IP address!
2021-02-17 09:38:57.084 thread(2) tag(0) WARN session_open_socket:642 Unable to connect socket for session!
2021-02-17 09:38:57.084 thread(2) tag(0) WARN session_handler:1002 session connect failed PLCTAG_ERR_OPEN!
2021-02-17 09:38:57.084 thread(2) tag(0) DETAIL session_handler:1128 in SESSION_CLOSE_SOCKET state.

So the library could not connect to the PLC on port 44818 which is the standard Ethernet/IP port.   Can you try to connect using telnet or netcat or some other tool to port 2222?  You can try using tag_rw and providing a port if you are using a version of the library that is new enough:

"protocol=ab_eip&gateway=142.10.10.102:2222&path=0&cpu=plc&elem_size=2&elem_count=1&name=N14:0"

Also I note that you are using a path.   Those are not used for direct PLC-5 connections.     You can and should leave that off unless you are using a DH+ bridge.  I marked that in red.

Please capture the debugging output if you can run the check against port 2222.

Best,
Kyle

alpep

unread,
Feb 19, 2021, 4:05:06 PM2/19/21
to libplctag
Hi Kyle,

Here is the capture when using the port 2222.

Best regards,
Alain 
PLC40_d4_2.txt

Kyle Hayes

unread,
Feb 19, 2021, 6:01:20 PM2/19/21
to alpep, libplctag
Hi Alain,

Yes, I see it connect.   The library speaks the wrong protocol but it connected to port 2222.  No delays, just a good TCP connection.

2021-02-19 15:50:36.343 thread(3) tag(0) DETAIL socket_create:1033 Done.
2021-02-19 15:50:36.343 thread(3) tag(0) DETAIL session_open_socket:632 Using special port 2222.
2021-02-19 15:50:36.343 thread(3) tag(0) DETAIL socket_connect_tcp:1053 Starting.
2021-02-19 15:50:36.343 thread(3) tag(0) DETAIL socket_connect_tcp:1102 Found numeric IP address: 142.10.10.102
2021-02-19 15:50:36.343 thread(3) tag(0) DETAIL socket_connect_tcp:1194 Done.
2021-02-19 15:50:36.343 thread(3) tag(0) INFO session_open_socket:651 Done.

Then the code continues on to try to connect using Ethernet/IP but that PLC does not support Ethernet/IP.

I have tried my own PLC-5 to see if it supports the older, CSP, protocol but it does not.   The library does not support that protocol.

If you know someone willing to give me access to a PLC that supports CSP, I will happily work to make the library support it!

Best,
Kyle



--
You received this message because you are subscribed to a topic in the Google Groups "libplctag" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/libplctag/1ZvdNhOOi7w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to libplctag+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/libplctag/9f9835a6-2306-471a-b9d9-2584ee05dfaen%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages