Did everything you suggested including setting up two gadgets. Keep in mind that I’m using a third-party Modbus device, not an Opto22 one. Secondly the holding registers are only 16-bit, not 32. In any case, when comparing the two registers (which now read 122. This is a live device) the scaled one reads 12, the unscaled one 12.
At this point I’m ready to concede defeat because it’s not working. This is a deal killer for the app we’re considering using Groov for, because if we can’t do simple scaling like this, we won’t be able to present data in the form necessary for our app.
Bother. Would you be up for sharing your Modbus tag configuration? There’s an “Export” button in the Modbus tag editor that will let you download a CSV file containing all the configured tags. Mine looks like this right now:
Raw Integer,32-bit Unsigned Integer,402048,Read/Write
Scaled Float,32-bit Unsigned Integer,402048,Read/Write,"Linear,Float,0,300,0,30,false"
The first column is the tag name, followed by data type, register address (the leading 4 means Holding Register), whether to allow gadgets that will write to it, and the scaler configuration.
Secondly the holding registers are only 16-bit, not 32.
Yeah, we support reading/writing multiple registers at once to store values larger than Modbus’ register size. I just grabbed 32-bit at random for the above test.
One more thing. These values are displayed in a Text Area gadget in Groov. Could that be an issue? It was the only way I could get a value in Groov Build without a tag label associated with it.
Aha! The Text Area might explain it: what does your formatting string look like? A single # will truncate to an integer, while #.# will give you one digit after the decimal point. Add more # for as many decimal points as you like.
I followed all of this and got my own scaling working mostly. My value from the modbus device is in absolute pressure and I need to scale it to gauge pressure (subtract 14.7) The complete scale formula would be ((x/10)-14.7) How would I do that? I tried to simply subtract it in the scale area, but that doesn’t work.
I figured out the correct scaling, but it drops my decimal during input… Also, if I am not paying attention, the tag editor wants to re-assign and save this as a float value.
If I do that, it reads correctly, but the input is not correct ie. if I enter “30.5” the compressor updates to “29.5”. It is displayed correctly, but the output doesn’t match the input.
The scaling doesn’t appear to effect the value limits. When I leave it as I originally had it, I can go into negative and the compressor displays inHg (inches of mercury, ie. vacuum). The kicker is that anything right of the decimal gets truncated.
If however, I set it as you suggested, wackiness ensues, but the decimals seem to work.
Yes:
2018-02-20, 16:31:19 GMT-08:00 INFO groov.Audit - User ‘NICKV’ wrote value ‘32’ to tag ‘Comp1 Mode1 Setpoint’ on ‘Compressor 1 (192.168.5.81:502 (id 1)/MODBUS)’.
2018-02-20, 16:31:14 GMT-08:00 INFO groov.Audit - User ‘NICKV’ wrote value ‘29.2’ to tag ‘Comp1 Mode1 Setpoint’ on ‘Compressor 1 (192.168.5.81:502 (id 1)/MODBUS)’.
2018-02-20, 16:31:07 GMT-08:00 INFO groov.Audit - User ‘NICKV’ wrote value ‘33.5’ to tag ‘Comp1 Mode1 Setpoint’ on ‘Compressor 1 (192.168.5.81:502 (id 1)/MODBUS)’.
2018-02-20, 16:30:36 GMT-08:00 INFO groov.Audit - User ‘NICKV’ wrote value ‘32.5’ to tag ‘Comp1 Mode1 Setpoint’ on ‘Compressor 1 (192.168.5.81:502 (id 1)/MODBUS)’.
Has this been addressed at all? It seems to be an issue with the read/write tags. I can set read only tags and they are fine, but when I try to set a R/W tag exactly the same it is all kinds of crazy.
I’m in the midst of addressing it now, along with a bunch of general cleanup on all the drivers. Next feature release is currently due around September.