This example looks at the System Status which in this case is a user selection but could just as well be the state of a J1939 variable. Based on its value it either turns a LED Graphic On, Off, or Blinks the LED.
Blinking is accomplished by changing the LED state each time this routine is called.
This routine is called by a user event that has a repeating 500mSec timer.
The LED widgets on the display use the visibility condition to either show or hide the red LED. The LED State varaible is set to 0 or 1 directly from this routine without having to call a calculation routine.
If the hardware has an actual LED lamp you have control over you can control that hardware LED as well by adding that to the existing code.
More complex actions can be accomplished by adding the fire actions block in line with any of the flow paths.
If you needed a blink timer different than the routine loop timer you would create a single shot "On" timer and and "Off" timer that would get started from the respective decision branch and additional decision would be added to see if timer has elapsed before changing the state of the LED.
Comments
0 comments
Please sign in to leave a comment.