Looking at the code, there seems to be no provision for opening or for writing to a serial port. It would take some replacing of all the send and recv calls to the filehandle associated with a Device::SerialPort or Win32::SerialPort, but at that stage, you best start with a fresh copy of the module and rewrite it for serial communications.
Maybe there is some kind of software modbus proxy server (or maybe "gateway" in their parlance) that can take data over the network and route it to the serial port?
| [reply] [d/l] [select] |
Thank a lot. So this module is inappropriate for RTU. But please help me with another module: Modbus::Client
It demands: $bus = new Modbus::Client "/dev/cua00", POSIX::B19200; . For Windows the second parameter I suppose it is filehandle I can open it with opening of serial port. But what is the first parameter for Windows? Here there are quotes:
1. the first kind is the serial device the modbus is connected to. If this type of parameter is specified, Modbus::Client optionally accept a second paramater to define the baud rate. By default, Modbus::Client will initiate communications at 9600 baud, no parity.
2. NOTE FOR WINDOWS USERS: For finer control of the serial connection, it is possibly better if you open the connection and pass the FileHandle to the new method. This is because Windows does not implement POSIX::Termios
What parameters should be for WIndows?
$bus = new Modbus::Client "???", ???;
| [reply] [d/l] [select] |
| [reply] |