Author Topic: Meter2 Control Scale problem  (Read 1696 times)

iDeeW

  • Newbie
  • *
  • Posts: 18
    • View Profile
Meter2 Control Scale problem
« 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??
« Last Edit: December 29, 2016, 01:49:35 PM by iDeeW »

bachphi

  • Hero Member
  • *****
  • Posts: 642
    • View Profile
Re: Meter2 Control Scale problem
« Reply #1 on: December 29, 2016, 02:36:17 PM »
You did not say what exactly are in PLCAddresstext and PLCAddressvalue. Perharps check MaxValue setting
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

iDeeW

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Meter2 Control Scale problem
« Reply #2 on: December 29, 2016, 02:51:34 PM »
Max value = 150
Min value = -150

the current value is 125

Thanks,

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Meter2 Control Scale problem
« Reply #3 on: December 29, 2016, 05:18:11 PM »
This is definitely an issue and it only occurs when setting for zero centered. This will be fixed in the next release.

iDeeW

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Meter2 Control Scale problem
« Reply #4 on: December 30, 2016, 12:40:03 PM »
Thanks Arch

iDeeW

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Meter2 Control Scale problem
« Reply #5 on: January 13, 2017, 05:01:50 PM »
Archie,

Thanks for updating the meter2 control on version t.

But now Meter2.vb crashes on communication fail.

Error msg:
Code: [Select]
{"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,
« Last Edit: January 13, 2017, 05:08:17 PM by iDeeW »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Meter2 Control Scale problem
« Reply #6 on: January 13, 2017, 06:33:18 PM »
Archie,

Thanks for updating the meter2 control on version t.

But now Meter2.vb crashes on communication fail.

Error msg:
Code: [Select]
{"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.

iDeeW

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Meter2 Control Scale problem
« Reply #7 on: January 14, 2017, 11:42:18 PM »
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.
 

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Meter2 Control Scale problem
« Reply #8 on: January 17, 2017, 08:34:52 PM »
How are you checking the Value before it gets to the Meter2?

iDeeW

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Meter2 Control Scale problem
« Reply #9 on: January 17, 2017, 11:18:46 PM »
In Meter2.vb -> Public Overrides Property Text()
This is how you have it right now...
Code: [Select]
..
...

If ValueScaleFactor = 1 Then
     MyBase.Text = value
Else
     MyBase.Text = value * ValueScaleFactor
End If
...
..

Below is my modification
Code: [Select]
If ValueScaleFactor = 1 Then
     MyBase.Text = value
Else
     If value Is NumericFormat Then MyBase.Text = value * ValueScaleFactor
End If

Thanks,
« Last Edit: January 17, 2017, 11:20:51 PM by iDeeW »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Meter2 Control Scale problem
« Reply #10 on: January 18, 2017, 01:58:31 AM »
Ok.. So you are using PLCAdressText as well as PLCAddressValue ?

iDeeW

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Meter2 Control Scale problem
« Reply #11 on: January 19, 2017, 10:41:12 AM »
No. I only use the PLCAddressValue.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Meter2 Control Scale problem
« Reply #12 on: January 19, 2017, 07:01:38 PM »
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.