I was actually just thinking about how I could do this.
I wish I could do this.
You know, kind of like wire shark/ethereal.
I don't know how I could do this as of yet.
There used to be an app called hyperterminal, even the ancient kermit should be able to do it.
It's been a while, so the following might not be exactly right.
IIRC you make a pigtail into the RS-232 cable, connect the sniffer port's Rx pin to the sniffed port's Tx pin, and also the ground. No flow control, neither soft nor hard.
If it's RS-485 the cabling even simpler because all data are essentially broadcast.
Set baud/startbits/stopbits/parity and the data should show up. obviously you'll need some way to deal with non-ASCII characters, but most of these apps can capture to a file, which you can look at in hex; some might even display hex on the fly.
Did you change back to the correct register? Because I cannot find any register 16#24 if I do a quick check in an altivar manual.
And also I think you need to have the Read_Qty set to 1 if you didnt already.
And lastly did you have an alarm while reading so the answer should be non zero? Dumb questions but people can tend to miss things when they get frustrated..
A cheap way to check RS485 comms (Modbus RTU etc) is using a usb - rs485 cable and for example putty.
I would manually trigger your send and see what goes out and if there are anything coming in..
I was able to read for the first time today.
Stepping it through manually seemed to do the trick.
Going to do some more testing tomorrow.
It appears (yet to be confirmed) that switching between reads and writes w/ the function causes it to bucker up.
Also, when I don't get data, the time from when the start of the function starts and when it completes is almost always 2ms.
When it works, it is from 20-28 ms.
When it is faulted and a run cmd is issued, it is like 500ms. Default timeout when a timeout isn't set?
Also, it doesn't clear the data from read to write.