Dials & Gauges Blockset | ![]() ![]() |
Using ActiveX Control Blocks in a Model
This section discusses how to use ActiveX Control blocks in a model, including describing the following:
Adding ActiveX Control Blocks to a Model
To add ActiveX Control blocks to your Simulink model, drag them into the model window:
Modifying ActiveX Control Block Parameters
Specifying the Type of Connection and Input/Output Block Parameters
ActiveX Control blocks are drawn with an inport and an outport because all ActiveX Control blocks can be used as either input or output devices (or both). By default, however, each ActiveX Control block is set up to act as either an input device (with an output connection), or an output device (with an input connection). Unused ports are removed when the simulation starts running or when you update the block diagram.
Note: For your own ActiveX controls built on top of the ActiveX Control block, you can also double-click on the border of the block to display the Block Parameters dialog box. |
Block Parameters
The Block Parameters dialog box for the Generic Knob control block is shown below. Several of the fields are briefly described below.
Connections. This field determines the type of connection the ActiveX Control block is currently using:
Input and Output Properties.
Each ActiveX Control block stores its current value in a property. This table lists the names of those properties that are common to each ActiveX Control block in the given Global Majic ActiveX Control Library.
Library |
Property Name |
Angular Gauges |
NeedleValue |
Buttons & Switches |
Value |
Knobs & Selectors |
KnobValue (Generic Knob) Value (Frequency Selector) |
LEDs |
Value |
Linear Gauges |
BandStop (Min-Max Thermometer) PointerValue (Others) |
Numeric Displays |
Value |
Percent Indicators |
PortionValue |
Sliders |
Value |
Strip Chart |
N/A (See The Strip Chart Control Block.) |
Other Block Parameters. See Summary of Dialog Box Fields and Check Boxes for information about the other fields and check boxes. You can also click the Help button to find out about other parameters.
Moving and Selecting ActiveX Control Blocks
The way you move and select ActiveX Control blocks is significantly different from how you move and select a Simulink block.
To move an ActiveX Control block, drag the border.
To select an ActiveX Control block, click on the border or "rubber-band" select the block. To resize an ActiveX Control block, first select the block, and then drag one of the selection handles (as you would resize a Simulink block). You can only do this when the border is turned on.Modifying Properties of ActiveX Controls
ActiveX controls have many properties. Changing characteristics of the ActiveX control often requires that you change several properties. This manual does not provide details on how to modify all properties of the Global Majic Systems ActiveX controls. However, it does provide some instructions on how to make some common changes to ActiveX controls. See Modifying ActiveX Control Properties.
Running the Simulation
Run a simulation as you normally would run a Simulink model. Choose a simulation stop time large enough to give you time to manipulate input ActiveX Control blocks.
Saving the Model
When you save a model that contains ActiveX Control blocks, MATLAB saves additional files that describe the ActiveX Control blocks. For example, saving a model with the name sample
, containing a Generic Knob control and a Lower Right gauge, saves these files.
sample.mdl sample@Generic_Knob.ax sample@Lower_Right.axIf any ActiveX Control blocks are contained in subsystems, the subsystem name is indicated in the filename with the
@
character before it. For example,
sample@SubSystem@Generic_Knob.ax
![]() | Accessing the Global Majic ActiveX Library | Modifying ActiveX Control Properties | ![]() |