Author Topic: Change Pilot Light color in code  (Read 890 times)

EE_Kraig

  • Newbie
  • *
  • Posts: 37
    • View Profile
Change Pilot Light color in code
« on: September 14, 2018, 01:04:58 PM »
I'm using a DataSubscriber to change a pilot light color but it's not working.

Code: [Select]
if (e.PlcAddress == "10014")
               {
                  if (e.Values[0] == "0")
                  {
                     plLowLevelA.LightColor = PilotLight.LightColors.Green;
                  }
                  else
                  {
                     plLowLevelA.LightColor = PilotLight.LightColors.Red;
                  }
               }

The code gets to this section just fine but the light color is always red.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Change Pilot Light color in code
« Reply #1 on: September 14, 2018, 03:53:23 PM »
If the Value is False, then you will have to change LightColorOff property.