Jump to content
OMRON Forums

Problem with Modbus on CK3M


Recommended Posts

We currently use Modbus successfully with our PowerBricks. We have a PLC that issues commands like


cmd"ModbusHoldingRead ..."


and it works. Now I'm trying the same thing on the CK3M. The only difference is that since the CK3M only has one Ethernet interface, I'm using it for both Modbus and normal communication.


Currently I only have one Modbus client enabled. I am able to connect to the Modbus client and issue the same Modbus commands from the terminal. However whenever I enable the PLC, it disconnects with a "Send" error in ModbusSocketError. When I look at ModbusLinuxError, I get different errors such as "Socket operation on non-socket," "Bad file descriptor," and "Destination address required".


Is there some problem with using the same interface for both Ethernet and Modbus? Should I get a USB Ethernet adapter? Or is there some other workaround?

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

I don't remember all the details, but I know there is a problem with connecting in the Terminal Window versus in a PLC and mixing operations. The Terminal Window and PLCs operate in different threads, and that can cause conflict. Try doing everything in one or the other, and we can go from there.
Link to comment
Share on other sites

I did a little research and found this info:


Thread is a communication channel. For example, a socket can connect to a server from the command in a terminal window, or in a PLC. A terminal window is a communication thread, and a PLC is another one. Several sockets can be opened from a single thread.

In principle, a socket should be opened and closed within the same thread.


I did a little testing with a Power PMAC client to a Power PMAC server:


I found that I could use the same socket with the Terminal Window and a PLC. I could connect to the server with either thread and then send commands thru both. Your issue was reproduced when I connected with the Terminal Window and sent a command from there before enabling the PLC. In that case, the PLC failed to send commands, and the connection closed (Modbus.State=0).

Link to comment
Share on other sites

This topic is now closed to further replies.

  • Create New...