Author Topic: BasicLabel Blink  (Read 3106 times)

Morgan

  • Newbie
  • *
  • Posts: 44
    • View Profile
BasicLabel Blink
« on: March 18, 2019, 11:53:13 AM »
I have three suggestions for the basic label.

1. It would be nice if the label "Blinked" between the highlighted color and the normal color by setting a blink rate.  If the "Blink" rate was set to 0 then blinking would be disabled.

2. Have the "ValueToSubtractFrom" property be a value that can be read from the PLC.  This would allow you to display a time remaining (Timer.PRE - Timer.ACC).  You would also need to have the "ValueScaleFactor" affect the "ValueToSubtractFrom".

3. Add Auto/Manual and Enabled/Disabled to the Boolean text choices.
« Last Edit: March 18, 2019, 12:51:07 PM by Morgan »

Phrog30

  • Guest
Re: BasicLabel Blink
« Reply #1 on: March 18, 2019, 01:49:07 PM »
Enabled should already be in code, you just need a way to set this value via PLC.  You can add code similar to this in the control:
Code: [Select]
Private m_PLCAddressEnabled As String = ""
    <System.ComponentModel.DefaultValue("")>
    <System.ComponentModel.Category("PLC Properties")>
    Public Property PLCAddressEnabled() As String
        Get
            Return m_PLCAddressEnabled
        End Get
        Set(ByVal value As String)
            If m_PLCAddressEnabled <> value Then
                m_PLCAddressEnabled = value

                '* When address is changed, re-subscribe to new address
                SubscribeToComDriver()
            End If
        End Set
    End Property

You can do similar for auto/manual.  This sounds like a property most wouldn't use.  Typically Archie doesn't add things for one offs.  But you are more than welcome to modify it for your needs.

I believe the highlight color is used when the control detects the key character you define.  So, this would have to be on top of that.  Sounds like you need more of a multistate indicator.  My sample app has a multistate that will blink.
https://www.advancedhmi.com/forum/index.php?topic=2323.msg13814#msg13814

Morgan

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: BasicLabel Blink
« Reply #2 on: March 19, 2019, 02:06:41 PM »
I think you misunderstood Enable/Disable.  I was talking about the text that is displayed when the value is Boolean (like On/Off, True/False, Yes/No, etc.)

I have modified the BasicLabel to meet the request.  I was hoping that the modifications would become part of the standard build so that I would not have to replace the standard with my modified one each time a new version is released.

I have attached my version here.

Side Note: The "Blink" is not controlled by a PLC address.  I set the Highlight character to nothing to start the blinking and then use the PLCAddressVisible to show/hide text that needs to catch the operator's eye.  Also, I'm not 100% sure about the new PLCAddressValueToSubtractFrom property.  I do not currently have a PLC that is not in production to test it with.
« Last Edit: March 20, 2019, 07:36:44 AM by Morgan »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: BasicLabel Blink
« Reply #3 on: March 19, 2019, 02:29:51 PM »
I'm hesitant to add any more features to the BasicLabel because it has well exceeded what I consider self-explanatory. In turn this results in new users not knowing all of its features or the intended uses of them. For a while I have been contemplating how to break up the functionality into multiple controls that are less general purpose. This tends to make it more obvious what the control's functions are. The AnalogValueDisplay was an attempt to do just that, but apparently the execution was not planned out well and I see many new users trying to use the AnalogValueDisplay for things the BasicLabel would be a better fit. The trick to splitting up the BasicLabel is determining which functions would not be used together.

I did add the additional AutoManual and EnabledDisabled options that will appear in the next update.

As a good practice, when you customize a control it is good to copy it and give it a new name, then place in the PurchasedControls folder. That makes upgrading easier because you do not have to keep a list of what controls you modified.

Morgan

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: BasicLabel Blink
« Reply #4 on: March 19, 2019, 02:38:34 PM »
I understand completely.  Thanks for the response.