08-14-2026 02:27 PM
Greetings everyone. I'm trying to communicate with an HY-OPTIMA 5846 via Serial Modbus. I'm using an NI USB-485 as the communication interface. So far, here's what I've done:
Right now I am using the manufacturer supplied defaults, i.e. no parity, no flow control, no termination char, 19,200 rate, 2 stop bits. I get either a generic I/O error or a framing error, but at the very least I am getting something from the sensor. If I either shut it off or disconnect it, response goes to zero.
If I mess with the baudrate and go beyond 19,500 or under 19,100 communication breaks completely. No other common speed (9,600; 14,400 etc.) works, so it might not entirely be settings.
Has anyone encountered a similar issue before? What could I be missing? I have tried both the regular Modbus commands as well as the raw data from the snippet, with read registers and loopback
08-14-2026 05:05 PM
Self update:
It APPEARS to be working without disabling the bias resistors, on 2-wire auto
Daikaz_0-1786745003775.png
Which I'm certain was very much not the case before, and goes against what the NI guide for the USB-485 says, but at least now I'm able to at least, establish communication with no errors, and even get some results via the more high level Modbus libraries.
I will continue testing functionality for the rest of the day and again on next Monday and update as to whether or not this was an actual solution or a red herring.
08-17-2026 02:37 PM
Did you try a Web (Google) search for "USB to RS-485 Modbus"? Several examples of the device, LabVIEW code to use it, etc. [I've never used ModBus, so I "looked it up" ...].
Bob Schor
08-17-2026 04:06 PM
Yes, several in fact; like I mentioned, must've tried no less than 5 different Modbus libraries and examples, that's how I ended up finding the VI I posted. Trust me, I don't post a thread unless I'm absolutely stumped and out of ideas.
I ended up using the open source Plasmionique Modbus library, after the change in settings that seemingly solved the problem.
08-18-2026 08:56 AM
Did you add the 120 Ohm termination resistors to both ends? You may think that the bias resistor setting is this but that is not correct. These interfaces have AFAIK no internal termination resistor that can be enabled or disabled but require physical termination resistors on both ends of the bus.
The bias resistors that can be enabled or disabled in software are actually biasing the + and - side of the bus to +5V and GND respectively to guarantee a proper offset of the data lines in idle state. It also forms an AC signal termination of some kind through the power supply but far from the correct 120 Ohm line termination.
08-18-2026 11:59 AM
Indeed I did. The sensor, according to the user manual, has an internal 120 ohm resistor, and I added one to the other end of the communication, right on the part where I short the Tx Rx lines.
Right now, the settings that are working for me are 19,200 baudrate, no parity, no flow control, 2 stop bits, bias resistors enabled on the USB-485 in 2 wire auto mode. The 120 ohm resistor seems to make no difference at all; have tried with and without, no difference.
Plasmionique Modbus library has been so far, the best one I've tried, and their example VI is the most robust I have seen. Highly recommend it.
08-19-2026 03:46 AM - edited 08-19-2026 03:47 AM
I've heard other reports where some of the Modbus libraries didn't seem to work with specific devices but never had these devices myself to verify why that would be. It seems illogical since the Modbus protocol is quite trivial to implement and there are not many possibilities to vary on that.
As to needing a termination resistor on both ends of an RS-485 cable, that depends a lot on the cable length. For short cables 1 termination on either end is usually enough. It allows that a real current can flow in the current loop and that is already enough. The missing termination on the other end will cause reflections of the signal in at least one direction but for short cables that will be relatively limited. If you go towards the maximum cable length and/or the maximum nodes on the bus of what the RS-485 specification allows, proper termination is very important however.
The bias resistors are often needed to provide a defined idle state of the bus when none of the nodes is sending. Otherwise the lines are floating because of the typical very high input impedance of the receivers on the bus and when one of the nodes then starts to send, there is a lot of ringing and overshoot before the bus stabilizes.
08-20-2026 01:01 PM
That is some quite valuable information, as this is part of a whole system and will share space with several other sensors and equipment, which will certainly add electrical noise and complexity.
I will incorporate the 120 ohm resistor at the final design with the terminal blocks, which should cover for the added length on the sensor's final position. Thanks!