Author Topic: LinearMeterV target value scaling  (Read 934 times)

ronj

  • Newbie
  • *
  • Posts: 10
    • View Profile
LinearMeterV target value scaling
« on: October 05, 2015, 08:45:57 PM »
Hi,
I have a LinearMeterV set to display 0-100.0% from a PLC value that is 0-1000 (value scale factor = 0.1). This works fine.
The target value from the PLC is scaled the same way, however the target value display isn't scaled when it is displayed. It doesn't seem to be influenced by the value scale factor.
Is there some way to scale the target value, either the same as the value or independently?

Regards,

Ron

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: LinearMeterV target value scaling
« Reply #1 on: October 05, 2015, 10:09:01 PM »
Hmmm... never ran across this before. If you are using version 3.99, I made a quick patch that will get around this:

https://sourceforge.net/projects/advancedhmi/files/advancedhmi/3.5/Patches

Download and unzip MfgControl.AdvancedHMI.ControlsPatchV399a.zip
Replace the file in AdvancedHMIControls\Support
Rebuild the solution

This gives a new property of ScaleTargetValue which will be set to True by default.

The tolerances do not scale, so you will have to adjust them accordingly.

If you are not using version 3.99, then your best option may be to create a scaled value in the PLC

ronj

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: LinearMeterV target value scaling
« Reply #2 on: October 06, 2015, 03:22:04 AM »
Thanks for the quick fix. Problem solved (I am running 3.99a).
Just so you know... the new property appears to have a typo ScaleTargetVale (u missing).

I also ran into another problem with this control when a comms error (using ModbusTCP) caused an error in CDbl(). My fix in LinearMeterVert.vb starting at line line 42 is this:

                If ValueScaleFactor = 1 Then
                    MyBase.Text = value
                Else
                    'in case value contains a comms error message - cannot convert to Dbl
                    Try
                        MyBase.Text = CDbl(value) * ValueScaleFactor
                    Catch ex As Exception
                        MyBase.Text = value
                    End Try

                End If

I think these two issues (target scaling and issue with a comms error) also apply to the horizontal version LinearMeterH. I haven't tried this one as much as the vertical version.

Regards,

Ron

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: LinearMeterV target value scaling
« Reply #3 on: October 06, 2015, 08:28:36 AM »
Thanks for the feedback. I put a fix in for that one.