EnableButton() - The Enable/Disable Button Command

This command locks and unlocks buttons on a user interface. This is a more targeted approach compared to useing the PanelEnable(0x16) and PanelDisable(0x15) packets.

This command works the same way as the LedOnOff() command. You can use the LED calculator and then just change the command.

Syntax

EnableButton(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) enabling buttons and the last 4 bits (low nibble) disabling buttons.

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

  • bit 7 - Button 2 Enable

  • bit 6 - Button 3 Enable

  • bit 5 - Button 4 Enable

  • bit 4 - Button 1 Disable

  • bit 3 - Button 2 Disable

  • bit 2 - Button 3 Disable

  • bit 1 - Button 4 Disable

If both an enable and a disable bit set or neither set for the same button it will maintain state.

Example Bitfield for EnableButton() command
Enable Disable

Button Number

1

2

3

4

1

2

3

4

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

Packet

EnableButton(0xA1,0.0.0)

Result

B1 Enabled, B2 No Change, B3 Enabled, 8-16 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 Enable Button 1, all other Buttons not affected

{
Name=”Unlock Button 1”
EnableButton(0x80,0,0,0)
}

Example 2

This task will Enable Buttons 1&5, and Disable buttons 2,3,4,6,7,8

{
Name=”Enable top buttons only”
EnableButton(0x87,0x87,0,0) //Enable top two buttons on an 8 button revolution, disable the rest
}