AdvancedHMI Software
General Category => Support Questions => Topic started by: iDeeW on December 29, 2016, 01:23:51 PM
-
Hi everybody,
Check the below picture. I have a guage control, a meter control & a meter2 control on the latest version of AdvancedHMI.
The meter & guage control works with no issues. But the meter2 controls is off!!
The value displayed in the PLCAddressText does not match with the PLCAddressValue.
My ValueScaleFactor is 1 for all meters.
Any ideas??
-
You did not say what exactly are in PLCAddresstext and PLCAddressvalue. Perharps check MaxValue setting
-
Max value = 150
Min value = -150
the current value is 125
Thanks,
-
This is definitely an issue and it only occurs when setting for zero centered. This will be fixed in the next release.
-
Thanks Arch
-
Archie,
Thanks for updating the meter2 control on version t.
But now Meter2.vb crashes on communication fail.
Error msg:{"Conversion from string "Com Error -999.No Values Returne" to type 'Double' is not valid."}
So as a quick fix I'm checking if the value is numeric before doing the scaling. Looks like the problem is no more.
But I'm sure you will addressed this in a more elegant manner.
Thanks,
-
Archie,
Thanks for updating the meter2 control on version t.
But now Meter2.vb crashes on communication fail.
Error msg:{"Conversion from string "Com Error -999.No Values Returne" to type 'Double' is not valid."}
So as a quick fix I'm checking if the value is numeric before doing the scaling. Looks like the problem is no more.
I tried to replicate this by using a Modbus simulator. I added a Meter2 and set PLCAddressValue to 40001. Started the simulator and it showed the value, I then shut down the simulator. The result is an error message on the face of the meter, but no program exception.
-
Yes I tried it too. Same app did not crashed with my simulator.
But when I just pull the Ethernet cable from an actual modbus server it crashed with the above error.
-
How are you checking the Value before it gets to the Meter2?
-
In Meter2.vb -> Public Overrides Property Text()
This is how you have it right now...
..
...
If ValueScaleFactor = 1 Then
MyBase.Text = value
Else
MyBase.Text = value * ValueScaleFactor
End If
...
..
Below is my modification
If ValueScaleFactor = 1 Then
MyBase.Text = value
Else
If value Is NumericFormat Then MyBase.Text = value * ValueScaleFactor
End If
Thanks,
-
Ok.. So you are using PLCAdressText as well as PLCAddressValue ?
-
No. I only use the PLCAddressValue.
-
I see now.... the error is normally sent to the Text property, but when you have a ScaleFactor other than 1, it tries to scale a string. This will be fixed in the next release.