| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Gauges Blockset |
| Contents | Index |
| Learn more about Gauges Blockset |
| On this page… |
|---|
You can modify many properties of a preconfigured Gauges Blockset block using its ActiveX Control Properties dialog box, introduced in Accessing the Properties. This section discusses some of the more complicated tasks and concepts associated with the modification of properties.
For more information about individual properties of the preconfigured blocks, see the online help for the corresponding controls. To access such help, open the library window and double-click the question-mark block. The online help summarizes the functionality and contains links to information about properties, events, and methods.
Some control properties let you use more than one style for a given component or characteristic, in the same block. For example, you might use multiple styles to create
Different font characteristics for text in different places
Multiple colors within a graphical element such as an annular region or a divided pie chart
Multiple sets of ticks, each with its own size or labeling characteristics
Multiple components, such as LEDs or needles, each with its own characteristics
These sections discuss the use of multiple styles in preconfigured Gauges Blockset blocks:
Many Gauges Blockset blocks include multiple styles by default:
The Vacuum block in the Angular Gauges library uses three text styles: one for the tick labels, one for the number at the bottom of the gauge, and one for the text near the center of the gauge.
The Volume block in the Angular Gauges library uses three adjacent annular regions, each with a different color.
The Thermometer block in the Linear Gauges library uses two styles for ticks: one for numbered ticks every 10 degrees and another for unnumbered ticks every 2 degrees.
The Circle Meter block in the LEDs library applies one of three LED styles to each of 10 LEDs. The three styles differ in their colors.
If a component supports multiple styles, then its property dialog box has properties that enable you to set the number of styles and refer to the styles by number. As an example, the figure below shows how a dialog box supports multiple font styles. The Fonts property indicates the number of font styles, while the FontID property refers to a given style by number.

To determine whether a component supports multiple styles, look in the block's property dialog box for a pair of properties whose names are
A plural noun describing the component, such as Fonts or Scales
A word that combines the noun and the letters "ID," such as FontID or ScaleID
If the dialog box has no such properties for the component, then you cannot create multiple styles for that component. For example, in the Background panel of a block's dialog box, you can define the color of an outline, but you cannot create multiple concentric outlines of different colors.
After locating the style-identifying pair of properties for the component you are interested in, follow these steps to create an additional style:
Click once on the up arrow next to the value of the first property in the pair (Fonts in the figure). This value is the number of defined styles. If N styles are defined, then each is associated with an integer between 0 and N–1. The corresponding ID property (FontID in the figure) can assume values between 0 and N–1.
Click repeatedly on the up arrow next to the ID property to set it to its maximum value. This causes the dialog box panel to reflect the attributes of that particular style instead of the other defined styles.
Configure other properties in the dialog box panel to match the attributes that you want that particular style to have. In the figure, the Set Font button enables you to set font attributes and the Sample box displays text using those attributes. In many cases, all properties in the panel except the original style-identifying pair are attributes of the style. In a few cases, only part of the panel contains attributes of the style and others are global attributes that apply to all styles.
To view attributes of an existing style, set the ID property to the integer associated with that style. Then, properties on the dialog box panel other than the style-identifying pair reflect attributes of that style. For example, the following figures show how the Sample portion of the Fonts panel of a dialog box displays either a large bold font or a font of medium size and weight, depending on whether the FontID value is set to 0 or 1.


In some cases, creating a style implicitly causes the block to apply it. For example, creating an additional style for tick marks automatically creates an additional set of tick marks on the block. In other cases, creating a style does not implicitly cause the block to apply it. For example, even after you create an additional font style, you will not see its effect on the block until you indicate which text should use that style. This section describes how to apply styles that the block does not apply immediately after you create them.
To determine where you can apply a style you have created, look for the corresponding ID property on a panel of the dialog box other than the panel where you defined the style. For example, the figure below shows part of a Captions panel containing the FontID property. The fact that the FontID property is not preceded by a Fonts property indicates that this is a panel that enables you to apply font styles but not define them.

Once you have located a part of the dialog box where you can apply a style you previously created, set the ID property to match the ID property of that style. For example, the figure above shows that the block has exactly one caption, and that the caption's font style is the one whose ID is 1. If you change the FontID value in the Captions panel to a different number, then you will probably notice a change in some text on the block.
Many blocks have properties whose names end with ID, such as FontID, ScaleID, and NeedleID. Such properties enable you to use more than one style in the same block, as in the situations listed in Using Multiple Styles Within One Block. This section describes how to interpret ID property settings. For an example that examines ID property settings among a block's default settings, see Modifying Multiple Tick Marks.
The value of an ID property refers to a style by number. To determine the purpose of the ID property, first see whether the property directly above it is a plural noun similar to the ID property's name. (For example, see whether the property directly above FontID is Fonts.) Then,
If the property directly above the ID property is a plural noun similar to the ID property's name, then this panel of the dialog box defines a set of styles. The ID property associates a number with each style. Other properties in the dialog box panel reflect the definition of the style whose number is the current value of the ID property. By changing the value of the ID property, you can view the definition of a different style.
For example, in the Fonts panel of the Volume block, the FontID property occurs directly underneath a Fonts property. This panel of the dialog box defines font styles, and the Sample box displays text using the font style whose number is the current value of the FontID property.
If the property directly above the ID property is not a plural noun similar to the ID property's name, then the ID property applies a style that was previously defined in another panel of the dialog box. Other properties in the dialog box panel indicate the context in which the style is applied. By changing the value of the ID property, you can select a different style to apply.
For example, in the Captions panel of the Volume block, the FontID property does not occur directly underneath a Fonts property. The purpose of the FontID property in this case is to reference previously defined font styles and apply them to captions. (The font styles are defined on the Fonts panel of the dialog box.)

Sometimes, multiple styles are combined so seamlessly that it is not obvious why multiple styles are needed or which parts of the block correspond to which style definitions. You can often adjust the definition of the style to make the style usage more apparent. For example, if you change the colors of different annular regions and then look for the corresponding change in the block, then you should be able to determine how the design is split among multiple annular regions.
Many blocks enable you to include text on the block. Such text might describe the quantity being measured, the units of measurement, or other information. The table below lists some types of text that are associated with a specific part of the block, as well as the part of the ActiveX Control Properties dialog box panel that defines the text. Some types of text apply only to certain blocks.
| Type of Text | Part of Dialog Box That Defines or Enables Text |
|---|---|
| Title appearing in block's outline | Title property on Background panel |
| Numerical labels near tick marks | Labels area on Ticks panel. On Strip Chart block, Labels properties on Tracks and X Axis panels. |
| Numerical labels near pointer or needle | Digital panel |
| Captions appearing anywhere on block | Captions panel |
When it is present, the Captions panel of the ActiveX Control Properties dialog box enables you to place text anywhere on the block. Blocks that use text captions by default include Mixer Scale, Tank, Thermometer, Amp Meter, and Volume. This section describes how to add, remove, and change characteristics of text captions using the Captions panel.
Adding Text Captions. To create a new text caption, follow these steps:
Removing Text Captions. To remove the most recently added text caption (that is, the one with the largest CaptionID value), decrease the value of the Captions property by one. Note that this removes all characteristics of that text caption.
Changing Fonts and Other Characteristics of Text Captions. To change the font of an existing text caption, you must create a numbered font style and then apply that style to the caption. Follow these steps:
Allocate space for a new font style by increasing the value of the Fonts property by one.
Set FontID to its maximum value. This is the index that corresponds to the newest font style.
Set CaptionID to the index that corresponds to the text caption whose font you want to change.
Apply the font style to the caption by setting FontID to the font style's index.
To change other characteristics of an existing text caption, first set the CaptionID property on the Captions panel to the value that corresponds to the text caption you want to change. Then use other properties on the dialog box panel, except the Captions counter, to configure the text caption accordingly.
Note For text captions, the color choice on the Captions dialog box panel overrides the color choice on the Fonts dialog box panel. |
Changing the range of values displayed on a block involves adjusting these properties:
Scale properties define the extent of the units displayed by the block, the location of the block's center, and the block's start and stop positions.
Tick-mark properties define tick marks on the block, including start and stop values, the interval between tick marks, and label positions.
Needle or pointer properties indicate the value.
To illustrate how to use these properties to adjust the range of values displayed on a block, this example changes the Generic Linear Gauge to display values from -20 to 20, sets the interval between tick marks to 5, and shows the tick-mark labels. This figure shows the Generic Linear Gauge with its default settings (left) and with modified settings (right).

Click the Scales tab to display the scales properties page. This figure shows the default scale properties for the Generic Linear Gauge.

To modify the scale range, change ScaleMax to 20 and ScaleMin to -20.
Click the Ticks tab to display the tick-mark properties page. This figure shows the default tick-mark properties.

To show tick-mark labels, check the Label On/Off check box.
To set the starting and ending tick marks so they mark the minimum and maximum scale settings, set StartValue to -20 and StopValue to 20. Change the DeltaValue property, which sets the spacing between tick marks. A value of 5 is reasonable for default block size.
Click the Pointers tab to display the pointer properties page. This figure shows the default pointer properties.

The Value property indicates the current pointer value. Set the initial value to 0, halfway between the maximum and minimum scale values. Click OK to accept the changes and close the dialog box.
This example illustrates the use of multiple tick marks and the use of the ID property to manage them. Instead of modifying a block, this example examines the default settings for a particular block.
This figure shows the Amp Meter block. Notice that the tick marks have two different lengths. These are created by defining two sets of tick marks.

The first set consists of 11 longer tick marks, each positioned at one of the label values, positioned at increments of 1.0. The second set consists of five shorter tick marks for each integer change in the scale, positioned at increments of 0.2.
To examine how these tick marks have been created, double-click the Amp Meter block to display its properties dialog box. Select the Ticks tab.

The Ticks and TickID properties, in the box labeled 1, are defined as follows:
The Ticks property specifies how many sets of tick marks are used by the block. For this block, this property is set to 2.
The TickID property indicates which set of tick marks is defined by the other properties on this page. When specifying the characteristics of a set of tick marks, you set the TickID property, and then define the property values for that set of tick marks. In the dialog box page above, the settings for all the properties on the page apply to the first set, identified as TickID 0.
The Position/Size properties, in the box labeled 2, are defined as follows:
The Inner property defines the edge of the tick mark closest to the needle center and the Outer property defines the edge of the tick mark farthest from the needle center. To see where the tick marks are located relative to the needle length, examine the needle length by selecting the Needles page. The needle length is 2.0. The Inner position is 1.70 and the Outer position is 2.00. These tick marks are 0.3 units long.
The Width property of the tick marks is 0.00, the narrowest width.
The Range properties, in the box labeled 3, are defined as follows:
StartValue determines at which scale value the first tick mark is displayed. For these tick marks, the value is 0.
StopValue determines at which scale value the last tick mark is displayed. For these tick marks, the value is 10.
DeltaValue determines the interval between tick marks. For these tick marks, the value is 1.
The Labels properties On/Off check box, in the box labeled 4, determines whether the labels are displayed. For the first set of tick marks, the labels are displayed.
The FontID property, in the box labeled 5, determines which of multiple fonts defined for this block is used for the label. In this case, two font sets are defined. The first (FontID 0) is for the tick marks, while the second (FontID 1) is for the caption, "Amps."
To examine the second set of tick marks, change the TickID property value to 1 by clicking the up arrow to the left of the value. The Ticks page looks like this.

The Position/Size properties, in the box labeled 2, are defined as follows:
The Inner position is 1.90 and the Outer position is 2.00. These tick marks are 0.10 units long, one-third the length of the longer tick marks.
The Width property of the tick marks is 0.00, the same as the longer tick marks.
The Range properties, in the box labeled 3, are defined as follows.
StartValue for these tick marks is 0. The first short tick mark and the first long tick mark appear in the same place.
StopValue for these tick marks is 10. The last short tick mark and the last long tick mark appear in the same place.
DeltaValue determines the interval between tick marks. For these tick marks, the value is 0.2.
The Labels properties On/Off check box determines whether labels appear next to the tick marks. No labels appear next to this set of tick marks.
If you decrease the Ticks property, then the tick-mark settings corresponding to the highest TickID value is removed. To replace that set of tick marks, you will have to recreate the settings from the defaults.
![]() | Connecting Blocks in a Model | Controlling Multiple Graphical Elements | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |