maxvoxel8 Posted January 25, 2021 Share Posted January 25, 2021 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 More sharing options...
Omron Forums Support Posted January 28, 2021 Share Posted January 28, 2021 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 More sharing options...
Omron Forums Support Posted January 29, 2021 Share Posted January 29, 2021 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 More sharing options...
maxvoxel8 Posted February 3, 2021 Author Share Posted February 3, 2021 Ah, that gives a clue. Does that mean I have to use the same PLC to send all commands? At present we are connecting with a different PLC than the one that sends the read/write commands. Link to comment Share on other sites More sharing options...
maxvoxel8 Posted February 3, 2021 Author Share Posted February 3, 2021 Ok, I moved all of the Modbus commands to the same PLC and now things seem to work. Thanks for the help. Link to comment Share on other sites More sharing options...
Recommended Posts