Author Topic: pilotlight2 setup  (Read 1405 times)

georgegraz

  • Newbie
  • *
  • Posts: 29
    • View Profile
pilotlight2 setup
« on: August 09, 2017, 05:44:30 AM »
I'm trying to get the following:
green light when valve open - text to say Steam Valve Open
 When closed -                        text to say Steam Valve Closed
Right now, when not True, Text shows up. When True, Green light comes on and text say true. Missing something.

Thanks
George

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5324
    • View Profile
    • AdvancedHMI
Re: pilotlight2 setup
« Reply #1 on: August 09, 2017, 08:47:01 AM »
I'm guessing you are referring to the PilotLight3Color. In any case, the base features of the PilotLights do not have the ability to switch text based on a Boolean value. The PLCAddressText will make it show the value from the PLC. So you can switch text by pointing it to a string in the PLC and make the PLC change the value of the string. To make it change based on a Boolean value, you would have to modify the code for the PilotLight

The BasicButton offers the capability you want with TextAlternate and SelectTextAlternate properties . You can either use that or copy and paste the required code pieces from it to the PiliotLight.

georgegraz

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: pilotlight2 setup
« Reply #2 on: August 14, 2017, 11:50:20 AM »
Thanks for the reply. This is what I just did and it works. I'm using the Basic Indicator, I have 1 with the Red Color & I have 1 with the Green color, then put them on top of each other. This will work. Better yet, would be a flashing yellow to indicate the valve isn't open nor is it closed (In between states). So how do I say Not_Opened=0 & Not Closed=0 as the tag. I'm trying not to modify the PLC program. So,   

Not_Opened && Not_Closed as the tag name.
Thanks
George

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5324
    • View Profile
    • AdvancedHMI
Re: pilotlight2 setup
« Reply #3 on: August 14, 2017, 01:32:00 PM »
To avoid multiple stacked buttons, you can use the BackColor and the Highlight color along with PLCAddressHighlight.

To invert a Boolean value simply precede the address with "NOT ". For example, the tag name Opened would become NOT Opened.

As for expressions, AdvancedHMI doesn't support expression in the PLCAddress properties. It would be easier to do this in the PLC. If you wanted to pursue it in AdvancedHMI, the best technique is to use a DataSubscriber2 to subscribe to the 2 values, then handle the DataChanged event to put the values in local variables, then push the result into a property such as Visible or Highlight.