Author Topic: AnalogValueDisplay decimal  (Read 739 times)

jeffcoll

  • Newbie
  • *
  • Posts: 4
    • View Profile
AnalogValueDisplay decimal
« on: August 23, 2020, 01:04:15 PM »
Hi I have a question about the AnalogValueDisplay, I have this working, I currently see a temperature on it. But I can't make it a decimal number. It's 800 degrees now, but it's got to be 80.0 degrees. Also if it is possible I actually want to change the background of the 80.0 depending on with a color. blue/yellow/green/red

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5266
    • View Profile
    • AdvancedHMI
Re: AnalogValueDisplay decimal
« Reply #1 on: August 23, 2020, 01:28:47 PM »
Set NumericFormat to 0.0

jeffcoll

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: AnalogValueDisplay decimal
« Reply #2 on: August 23, 2020, 01:33:40 PM »
thank you, i really looked over this,

is there a way to make the background of the value change color?

jeffcoll

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: AnalogValueDisplay decimal
« Reply #3 on: August 23, 2020, 01:51:54 PM »
by customizing as you specified. I do get 1 decimal number. only then do I get 653.0 but must be correct 65.3 ?, I communicate with a modbus-TCP, number of 40001 is now also 653

MajorFault

  • Guest
Re: AnalogValueDisplay decimal
« Reply #4 on: August 23, 2020, 03:41:42 PM »
BasicLabel has ValueScaleFactor, I don't think the analog display does, which is weird.  You could use the BasicLabel. 

I think you are stuck to writing code for changing colors on BasicLabel, something simple like this would work...

Code: [Select]
Private Sub BasicLabel2_ValueChanged(sender As Object, e As EventArgs) Handles BasicLabel2.ValueChanged

        If BasicLabel2.Value > 5 Then
            BasicLabel2.BackColor = Color.Beige
        Else
            BasicLabel2.BackColor = Color.Coral
        End If

    End Sub

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5266
    • View Profile
    • AdvancedHMI
Re: AnalogValueDisplay decimal
« Reply #5 on: August 23, 2020, 04:31:52 PM »
The AnalogValueDisplay uses the newer PLCAddress object, so after you enter an address, you can expand it down to reveal the ScaleFactor. Set that to 0.1

The AnalogVaueDisplay changes the foreground color using the ValueLimits, but to change the background you would have to add some code as MajorFault recommends.