Author Topic: Nice Pass/Fail pilotlight  (Read 5316 times)

alanls1

  • Newbie
  • *
  • Posts: 10
    • View Profile
Nice Pass/Fail pilotlight
« on: June 09, 2013, 09:07:55 PM »
Drag a Pilot light onto your form.  Set the "LightColor" property to White.  Then Drag a basiclabel onto the form.   Remove the text in the "Text" property.  Set the "ForeColor" property to the color of your form.  Then in your textchanged event.

 Private Sub LblThrustCollarResults_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles LblThrustCollarResults.TextChanged
        Select Case LblThrustCollarResults.Text
            Case 0
                PLThrustCollarResults.LightColor = AdvancedHMI.Controls.PilotLight.LightColors.White
                PLThrustCollarResults.Value = False
            Case 1
                PLThrustCollarResults.LightColor = AdvancedHMI.Controls.PilotLight.LightColors.Green
                PLThrustCollarResults.Value = True
            Case 2
                PLThrustCollarResults.LightColor = AdvancedHMI.Controls.PilotLight.LightColors.Red
                PLThrustCollarResults.Value = True
        End Select

    End Sub


Then move a value of 0,1 or 2 into the basiclabel tag in the plc.


This will give you a green or red Pilotlight for pass and fail.