Dials & Gauges Blockset    

Buttons & Switches

The Buttons & Switches library contains two-state controls that change their states when you click on them. The block output is 0 when the block's state is off and 1 when the state is on. The blocks in this library differ in cosmetic ways, such as the images shown on the block and the changes in the block's appearance after you click on it. The next sections describe how to customize buttons and switches, and how to change the output values from buttons and switches.

Customizing Buttons and Switches

The table below lists some common ways to customize a block in the Buttons & Switches library, using its ActiveX Control Properties dialog box.

Task 
Description 
Associate an image with a state
Use the Picture button on the On or Off panel to select a graphics file. You cannot associate both an image and text with a state.
Associate text with a state
Use the Caption field on the On or Off panel. The X and Y values control the position of the text. The BackColor and ForeColor buttons control the colors of the background and text, respectively. You cannot associate both an image and text with a state.
Associate a sound with a state
On the On or Off panel, check the Sound check box and type the name of a .wav file in the Wave file field. You can either type the name of the sound file or browse for it using the ... button.
Use beveling to make the button appear three-dimensional
Use the BevelInner and BevelOuter properties on the Background panel.
Change the way the button's beveling (if visible) responds to a mouse click
Use the Mode property on the General panel. The SingleState option causes the bevels to remain fixed. The TwoState option causes the bevels to toggle with each mouse click. The Pressed option causes the bevels to toggle only while you are pressing the mouse button.
Make the button turn off after being on for a specified length of time
Set the OnTimer property in the General panel to a nonzero value, measured in milliseconds.

Changing Output Values

The output values for blocks in this library are 1 and 0. To convert these output values to other numerical values, you can send the output to a Look-Up Table block in Simulink.


  Angular Gauges Knobs & Selectors