Scaling in Groov

From our pump flow meters we collect total gallons over time and that number gets pretty big. Currently it’s at 3,713,041 gallons. I want to convert that to acre/ft. It’s an easy conversion that I know how to do. My problem is making it work in the Opto/Node-RED environment.

Here’s the formula: 1 gallon = 0.0000030688832459704 acre/ft

Here’s my issue:

  • Groov will display the raw number if I make the tag a float. However I don’t know how to use the scaling function in Groov to do make the conversion. As you can see it’s simple multiplication.
  • I tried to do it in Node-RED thinking I could use a Function node and write a simple script but NR reads the Modbus device that stores it as two numbers in two consecutive registers and I don’t know how to covert those to a single number so my simple little multiplication will work.

The numbers in question are:

Total Gallons: 3713041
Low register: 19042
High register:41028

Any help would be appreciated.


Is the gallon input coming from modbus?

In modbus you need to figure out the scale factors and input the numbers. (no formulas).


As far as snap pac stuff, AFAIK only the “round gauge” and “range indicator” have scaling.

The gallon input is coming from modbus. It’s a Banner engineering device and for our convenience it’s displayed as a single number. However the rest of the world looks at it as two numbers because modbus only supports a 16-bit number in a single register.

As to the scaling in Groov, I’m familiar with that but I have no idea how to take the linear scaling in your graphic above and make it do this:

Total Gallons * acre/ft per gallon = Total Acre/Ft

3713041 * 0.0000030688832459704 = 11.39 (plus a bunch more decimals) acre/ft

You have to do something like this:

Figure out what your high limit would be and figure out what the low limit would be for both raw and scaled values.

Groov will read 64bit registers or in your case (I think), 32 bit.