LEDOnOff() - The Indicator LED Control Command

This command turns indicators on a button station on or off. The command can be used to turn individual buttons on and off while leaving others alone. The task editor in System Builder has an LED calculator at the top that will build this command for you based on the type of UI and what you want it to do. Then you simply paste that into your task.
This is similar to the LEDColour() command but can do multiple buttons at one time and is single color.
It is also similar to the indicator port (^18) but can leave indicators alone that you don’t want to change.

Similar to the indicator port (^18), this command does not override the proximity sensor. Any values sent while a panel is asleep will not be seen until the device wakes up.

Syntax

LEDOnOff(Buttons 1-4 BitField, Buttons 5-8 BitField, Buttons 9-12 BitField, Buttons 13-16 BitField)
Each byte is for a set of 4 Buttons with the first 4 bits (high nibble) turning on indicators and the last 4 bits (low nibble) turning off indicators.

schema (Repeat for each button set)
  • bit 8 - Button 1 On

  • bit 7 - Button 2 On

  • bit 6 - Button 3 On

  • bit 5 - Button 4 On

  • bit 4 - Button 1 Off

  • bit 3 - Button 2 Off

  • bit 2 - Button 3 Off

  • bit 1 - Button 4 Off

If both an "on" and an "off" bit are set or neither are set for the same button it will maintain state.

Example Bitfield for LEDOnOFF() command
Bit Value in Hex 80 40 20 10 8 4 2 1

Binary Value

1

0

1

0

0

0

0

1

Hex Value

80

0

20

0

0

0

0

1

Hex Result

100=A

1=1

1 & 3 On, 4 Off, 2 No change

You can use the join setting of the virtual panel to help calculate the right values. Just remember the order is reversed. Bit 8 is button 1!

Examples

Example 1

This task will turn on button 1, all other buttons not affected

{
Name=”Turn On Button 1”
LEDOnOff(0x80,0,0,0)
}

Example 2

This task will blink button 1 3 times.

{
Name=”Panel Unlock Blink”
LEDOnOff(0x80,0,0,0)    // Turn Button 1 LED on
Delay(.3)
LEDOnOff(0x08,0,0,0)    // Turn Button 1 LED off
Delay(.3)
LEDOnOff(0x80,0,0,0)    // Turn Button 1 LED on
Delay(.3)
LEDOnOff(0x08,0,0,0)    // Turn Button 1 LED off
Delay(.3)
LEDOnOff(0x80,0,0,0)    // Turn Button 1 LED on
Delay(.3)
LEDOnOff(0x08,0,0,0)    // Turn Button 1 LED off
Delay(.3)
}

Example 3

Flashes LEDs 1,2 and 7at a 500ms interval, LEDS 3,4,5,6,8 forced to off

{
Name=”Alert Blink”
Delay=0.5                 //Set the delay time
Loop1:
LedOnOff(0xc3,0x2d,0,0)   //LEDs 1,2 and 7 on, 3 to 6 and 8 Off, 9 to 16 not affected
Delay()                   //Wait a bit
LedOnOff(0x0f,0x0f,0,0)   //Leds 1 to 8 off, 9 to 16 not affected
Delay()                   //Wait a bit
Jump(Loop1)
}