09-12-2018
02:03 PM
- last edited on
04-07-2025
12:18 PM
by
Content Cleaner
I am attempting TCP modbus communication with a Hach Particle Counter.
Using the Modbus Master by Plasmionique Inc., I have been able to query the device and have particle count data returned.
The problem I am having is that the data returned doesn't quite match the data displayed on the device. The larger the count number, the further off the modbus data seems to be.
There are 2, 2 byte memory registers for each particle size count return. Six different sizes. In my screenshot all the counts are low enough that only 1 register is needed for count.
Unfortunately I could only do a limited number of unfiltered "pulls" on the particle counter, but in each case the data returned was similar. Low counts were close or exactly as displayed. But higher counts seemed to get further away from what was displayed.
I have looked at a few different ways of casting the data, or rotating the array output.
I have also flattened to a string and tried both large and small endian byte order. So far, anything I've tried only seems to be further off than what I'm already getting.
I don't have confirmation from the manufacturer yet, but it is possible that there may be some difference between what is displayed and what is in the memory registers, perhaps due to averaging or something.
I think I must have the conversion correct....but I'm not sure. I'm looking for thoughts on what I might be missing here.
Solved! Go to Solution.
09-12-2018 02:12 PM
The counts that you are retrieving are the totals. The counts displayed is the difference from the last value. If you look at the counts that you retrieved, 2 is the lowest count, followed by 7. The data displayed is 2 for the 10.0 um value and 5 for the 5.0 um value. The values in your array are 2 and 7 where 7 - 2 = 5. Let's look at the next value in the array and the display. In the array you have 19 and the display for 3.0 um is 12. 19 - 7 = 12. This pattern continues through all of your values.
09-12-2018 02:53 PM
Thanks Mark!
I could see there was a pattern, and that the particle counter was in "differential mode", but I didn't have the pieces together.
I was thinking differential mode was.....different.