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:
Solved! Go to Solution.
According to the LabVIEW Modbus API page, support for this library should be directed to https://decibel.ni.com/content/thread/17712.
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.
Thanks for the great news!
Sorry for the broken link. I think I missed a character in the Copy/Paste:
1) You can obtain the LabVIEW Modbus API here: https://forums.ni.com/t5/NI-Labs-Toolkits/LabVIEW-Modbus-API/ta-p/3524019
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.