TCPmaker : Visual Tour    TCPmaker Screen Controls  

Both the Pushbutton and the LED Indicator control classes have a Radio Button mode, that works like buttons on a car radio (and the similar kind of control group that is commonly used in Graphical User Interfaces in operating systems like Windows, MacOS, X-Windows, and many more).

In this mode, buttons are grouped together, and when a button in the group is clicked, that button goes "down" or to the "active" state, and all the other buttons must go "up" or to the "inactive" state.

Here's how to set up and use Radio Mode:

  • In the Visual Page Designer, create a single Integer Variable to hold the number of the button that is currently active.
  • Create a number of Pushbutton controls (or LED Indicator controls) that you want to become the Radio Group.  Set the m (mode) property of each control in this group to Radio.
  • For each control in the Radio Group, set the i property to the Id of the Integer Variable that you created in the first step above.  This association of multiple controls operating in Radio Mode, each with the same Integer Variable, is what forms a specific Radio Group.
  • Set the rb property of each Control in the group to a different value: 1, 2, 3, etc.
  • A control in the Radio Group becomes "active" when the value of the Integer Variable matches the value of the rb property of that Control.



Create an Integer Variable. Let's say its name = ButtonNum and its id="iv0".

Create 3 Pushbutton controls, all having m = Radio, and all having i = "iv0".

Create 3 LED Indicator controls, all having i = "iv0".

Set rb = 1 for the first button in the group, rb = 2 for the second button, and rb = 3 for the third button.

Set rb = 1 for the first LED in the group, rb = 2 for the second LED, and rb = 3 for the third LED.

Resulting Behavior:

When you set the value of variable ButtonNum (id="iv0") to 2, the second Pushbutton changes to its Active state, and the second LED Indicator also changes to its Active state.

When you click on the first button, the value of ButtonNum is changed to 1 and sent to the micro device. The first Pushbutton and the first LED become Active, and the second Pushbutton and second LED become Passive or inactive. 



12 of 19
Copyright Notice and Author Information