03-05-2009 09:38 AM
Hello,
I am trying to communicate to a power control board using the NIModbus.dll downloaded from the NI website. I am using the RS232 com port on my PC. The com port is connected to a NOXA RS232 to RS485 converter (2-wire) and then to my power control board. The power control board uses Modbus protocol.
I can read from all of the required registers using Read Input Registers or Read Holding Registers command. My problem is that using Write Single Register and Write Multiple Registers causes a timeout error 6101.
Example:
Function Code: Read Input Registers
Starting Address: 475
Quantity: 1
Returns: 1581
This is correct. We have verified this with other software here.
Function Code: Write Single Register
Starting Address: 475
Quantity: 1
Returns: Timeout Error
Any suggestions?
03-05-2009 10:21 AM
Are you sure you can write to this input register or is it read only?
Per the Modbus spec. http://www.modbus.org/docs/Modbus_Application_Protocol_V1_1b.pdf (see page 19), you can write to holding registers (40,000 series), but you can only read from input registers (30,000 series)
03-05-2009 11:59 AM
Thanks for the reply.
Yes, the register address is 40475 actually.
We have connected a different computer (laptop) to the NOXA device with RS232 COM port. That laptop has a custom VB program communicating with Modbus. The custom VB program can change the register value.
03-05-2009 12:02 PM
Try register 474.
The registers in the modbus libraries are 0 based although the device would start them at 1.
03-05-2009 12:06 PM
03-05-2009 12:17 PM
03-05-2009 12:24 PM