I am trying to use codesys SoftPLC as Modbus RTU Master which is supposed to communicate with an actual(physical) slave device.
The slave device is connected to COM port of my PC.
I created a codesys project with Codesys WinSoftPLC as device(PLC). Also, i added a COM port as Modbus Master in the codesys device tree.
Now i want to send read & write requests to slave. What library can i use for Modbus RTU commands??
I saw the ModbusRequest FB in IoDrvModbus Library, but it requires a handle. So i opened the same COM port of PC, using SysComOpen. Ofcourse this is not going to work as the same windows COM port is already open by Modbus COM Object. So how do i get the handle??
Is their any other library i can use??
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello Everyone,
I am trying to use codesys SoftPLC as Modbus RTU Master which is supposed to communicate with an actual(physical) slave device.
The slave device is connected to COM port of my PC.
I created a codesys project with Codesys WinSoftPLC as device(PLC). Also, i added a COM port as Modbus Master in the codesys device tree.
Now i want to send read & write requests to slave. What library can i use for Modbus RTU commands??
I saw the ModbusRequest FB in IoDrvModbus Library, but it requires a handle. So i opened the same COM port of PC, using SysComOpen. Ofcourse this is not going to work as the same windows COM port is already open by Modbus COM Object. So how do i get the handle??
Is their any other library i can use??