Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Variable multipiler
What is the purpose of the multiplier in the Modbus variable settings?

For example, if there is a float variable with a value of 1.0, and its multipliler is set to 0.001, then:
  1. the associated value display widget (with "value conversion" unchecked) will show 1.0;
  2. open the associated value editor popup (with "value conversion" unchecked), it will also show 1.0;
  3. change the value to 2.0 and save, the float value will be updated to 2000.0;
  4. now both the value display and the value editor will show 2000.0, which is very confusing: the value entered when saving (2.0) does not match the value displayed (2000.0) after saving.

That is, the variable multiplier is only used as a divisor when saving, and is ignored in all other cases. Is this a bug or by design?
I am very interested about Modbus issues.
I have tested but I can't find this issue. Please check the video and help me to find this issue.

On the video I have set the modbus value on my modbus device to 2.
I have created two modbus clients. The first client receives the value without conversion and the second client receives it with conversion 0.001.

As you can see the dispayed values are correct. The second "Value Display" displays the value as 0.002.
The popup editors displays the values with the correct way too.
I can't find any issue.
It is not in the video but the values are sent with the correct way too. I have tested it too.

Of course I don't use any other conersion inside the widgets while the Modbus conversion inside the variable is active.

Could you send me more information about this issue? Maybe a video will help me a lot.
By further testing, I found that this issue may be related to "Multiple reading". The variable multiplier works only if "Multiple reading" is disabled or "Continuous values" is set to 1. Otherwise, the actual multiplier used seems to be always the cube of the multiplier of the first variable with "Multiple reading" checked, while multipliers set for subsequent variables (with "Refresh" set to Never) are ignored.

This issue only affects reading. For writing, the multiplier works as expected.

Forum Jump:

Users browsing this thread: 1 Guest(s)