Industrial Communications

Showing results for 
Search instead for 
Did you mean: 

ComBox MODBUS - Trouble writing to R.W registers

Go to solution

Hey guys, 


I am trying to talk to an inverter (ComBox XW+) through MODBUS TCP. I can read values from the Read only registers just fine, and they line up exactly with what I see on the web page interface they have. However, when I try to write a particular r/w register, I get a function mismatch error (-538172 using smithd's modbus API). Moreover, when I try to read the R/W register, I always get the value 65535. This leads me to believe there's something wrong with my device setup, but just in case, I'd thought I'd make sure that I wasn't doing anything weird in the code. Please the the image of the block diagram, as well as the manual I am using for the device in the attachment.

There's a little MODBUS note online as well:

0 Kudos
Message 1 of 6



According to the LabVIEW Modbus API page, support for this library should be directed to



Thomas C.
FlexRIO Product Support Engineer
National Instruments
0 Kudos
Message 2 of 6
Accepted by Shehzaada

Hey Thomas!


Thanks for your assistance, however, that link isn't available anymore when I try to open it.


In any case, this problem is solved. I was simply writing to the wrong slave ID! The other slave was present on the network but it's MODBUS map is completely different, which is why I was seeing those weird values.

0 Kudos
Message 3 of 6



Thanks for the great news!


Sorry for the broken link.  I think I missed a character in the Copy/Paste:



Thomas C.
FlexRIO Product Support Engineer
National Instruments
0 Kudos
Message 4 of 6

Hi, I would like some help in reading the Modbus registers of a XW+ thru a Combox,  Very new to this so need the baby steps.



0 Kudos
Message 5 of 6

Hey Newhumless, 


1) You can obtain the LabVIEW Modbus API here:


2) Ensure MODBUS is enabled on the Combox by using the web setup (it should be accessible via the IP address assigned to the Combox). Record the important information like Modbus Port and Slave/Unit IDs of all associated devices of the combox (The control panel (SCP) will have a different ID, the inverter/battery will have another).

3) Open a MODBUS Master connection to the device using the TCP/RTU settings, and then also use the Set Unit ID VI to set the appropriate unit ID of the device you want to talk to. That's a detail that's usually omitted in he LabVIEW API (it says that the Set Unit ID is only really used for Serial connections, but that's not exacty true in this case).

4) Use the connection reference to read/write registers of your choice.


Good luck, 


0 Kudos
Message 6 of 6