LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus Serial Write to a single register

Hi, I'm trying to write command to my energy meter UEM80-4D R, the query message is correct, I try to change the bps on the meter through writing the command, but the setting on the meter didn't change, I do not know how to get the response message too. Any examples of write single holding register by using the Modbus library will be great.

 

Thank you 

Download All
0 Kudos
Message 1 of 6
(1,908 Views)

Hi harry,

 

does your energy meter even support "Write Single Register" (as the error message suggests)?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(1,895 Views)

Hi, yes it does support, I write the command based on the example on the datasheet of the meter.

Download All
0 Kudos
Message 3 of 6
(1,890 Views)

Hi harry,

 

those images always show function code 10h=16d…

 

You use that function code 10h=16d when creating your own "message" indicator.

But you still use that WriteSingleHoldingRegister function! That function is using the ModBus function code 6 - and then your device responds with "unsupported function code"! Have you tried to write to multiple registers?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(1,864 Views)

Hi, I just tried what you have suggested, but i still encounter the error. 

0 Kudos
Message 5 of 6
(1,854 Views)

Hi harry,

 

what happens when you send the bytes of that example (Capture.png from message #3) to your device using a simple VISAWrite command?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(1,850 Views)