LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NIModbuss.dll Cannot Write to Register

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?

0 Kudos
Message 1 of 7
(2,670 Views)

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)

0 Kudos
Message 2 of 7
(2,658 Views)

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.

0 Kudos
Message 3 of 7
(2,641 Views)

Try register 474.

 

The registers in the modbus libraries are 0 based although the device would start them at 1.

0 Kudos
Message 4 of 7
(2,639 Views)
I cannot write to many of the registers in the 40000 series. I have tried many including 474, 476. All write commands end up in a time out fault.
0 Kudos
Message 5 of 7
(2,637 Views)
You said you were using NIModbus.dll you downloaded.  Where is that?  Do you mean .llb?
0 Kudos
Message 6 of 7
(2,630 Views)
Sorry, yes llb not dll
0 Kudos
Message 7 of 7
(2,627 Views)