Author Topic: Fixed digits for AnalogValueDisplay  (Read 1823 times)

martinav

  • Newbie
  • *
  • Posts: 24
    • View Profile
Fixed digits for AnalogValueDisplay
« on: April 29, 2021, 11:41:20 AM »
I want to have trailing zeros to show on this display.  Leading zeros, no.  So, it needs to be right justified.  Not sure how to do this.  Tips?

Thanks

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5268
    • View Profile
    • AdvancedHMI
Re: Fixed digits for AnalogValueDisplay
« Reply #1 on: April 29, 2021, 06:21:54 PM »
Sounds like you are looking for a control called AlignedLabel that will be in the upcoming version.

The control source code for the base control is attached if you want to try to add it to your project to see if it is what you want.

martinav

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Fixed digits for AnalogValueDisplay
« Reply #2 on: May 03, 2021, 11:13:38 AM »
Oh, nice!  Thanks so much.

Not sure I know how to use it.  I do not see any PLCAddress controls to input the MODBUS address.  It works as a text label, but I'm not seeing how to use it for a PLC address.
« Last Edit: May 03, 2021, 11:21:38 AM by martinav »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5268
    • View Profile
    • AdvancedHMI
Re: Fixed digits for AnalogValueDisplay
« Reply #3 on: May 03, 2021, 11:37:20 AM »
Attached is the AdvancedHMI layer for the control. You will need to rename the file and the class name in the file itself because both files are needed. I would typically rename this one to AlignedLabelPLC

martinav

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Fixed digits for AnalogValueDisplay
« Reply #4 on: May 03, 2021, 12:43:22 PM »
I wont lie, I have no clue what i'm doing.  But, I think I did what you said to do.

Renamed the 2nd  file to AlignedLabelPLC.vb, and the CLass inside the file (edited in notepad).

Lots of errors on rebuild. 

Sorry, I'm high maintenance.

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Fixed digits for AnalogValueDisplay
« Reply #5 on: May 03, 2021, 11:15:09 PM »
You are probably using older version of AHMI and not v3.99y Beta38.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5268
    • View Profile
    • AdvancedHMI
Re: Fixed digits for AnalogValueDisplay
« Reply #6 on: May 04, 2021, 06:39:22 AM »
Change the

Inherits MfgControl.AdvancedHMI.Controls.AlignedLabel

to

Inherits AlignedLabel

martinav

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Fixed digits for AnalogValueDisplay
« Reply #7 on: May 04, 2021, 09:31:48 AM »
You are probably using older version of AHMI and not v3.99y Beta38.

Yes, I am using v3.99x.  I did not see that was a requirement. 

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Fixed digits for AnalogValueDisplay
« Reply #8 on: May 04, 2021, 11:47:31 PM »
It is not a requirement, that's why Archie posted 2 files and instructions of what changes to make.

With v3.99y Beta38 you just need to use the 2nd file as it is (unmodified).
« Last Edit: May 05, 2021, 12:07:24 AM by Godra »

martinav

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Fixed digits for AnalogValueDisplay
« Reply #9 on: May 07, 2021, 09:00:01 AM »
Ok, well, regardless.  Its too much for me.  It didnt work.  I gave up on it.