Documentation Center

  • Trial Software
  • Product Updates

Block Parameters for the ActiveX Control Block

Summary of Parameters

NameDescription
Program IDName of the control
ConnectionsWhether the ActiveX® Control block has ports
Input propertyName of the property that is set when the ActiveX Control block receives a signal
Initialization commandCommand that sets the initial conditions for the ActiveX Control block
Other events and handlersEvents that trigger an action by the ActiveX Control block
Update commandFunction that the Simulink® engine invokes when it updates the block during the simulation
In-block controlWhether the ActiveX Control block displays a control or is connected to an ActiveX Control block somewhere else
BorderWhether a border appears around the control

Program ID

The Program ID parameter is the name of the control displayed on the block. To determine the Program ID of other controls, consult their documentation.

Connections

The Connections parameter determines whether the block has an inport only, both an inport and an outport, or no ports. If the block has both an inport and an outport, then the values at both ports are the same.

Input Property

The Input property parameter indicates the name of the block property whose value is set by the input signal. Each preconfigured Gauges Blockset™ block stores the block's current value in a property, as listed in the table below.

Names of Input Properties

LibraryProperty Name
Angular GaugesNeedleValue
LEDsValue
Linear Gauges
  • BandStop (Min-Max Thermometer)

  • PointerValue (other pointer linear gauges)

  • Value (bar gauges)

Numeric Displays
  • Value (Generic Numeric LED, Odometer, PlusMinus XX.XXX)

  • AlphaNumeric (others)

On Off GaugesValue
Percent IndicatorsPortionValue

Initialization Command

The Initialization command parameter is a string that sets the initial conditions of the ActiveX Control block.

The handle of the control is hActX.

Other Events and Handlers

The Other events and handlers parameter specifies actions taken by the ActiveX Control block when you perform a defined action on the ActiveX Control block. You must enter an event as an N x 2 cell array. The first entry in each row must be the name of the event. The second entry in each row must be the MATLAB® callback to be executed.

For a list and description of supported events for a control, consult the control's help.

Update Command

The Update command parameter is the name of the function that Simulink software invokes when it updates the block during a simulation. The function has these input arguments:

  • The handle of the control

  • The current input value

The function is not invoked when you update the diagram.

In-Block Control

The In-block control check box determines where the ActiveX Control block value is displayed. The control can be on the block icon, in the same model window, in a different model, in a subsystem, or in a MATLAB figure.

If checked, the control whose name is specified in the Program ID field appears on the ActiveX Control block.

If cleared, the block is connected to the control whose handle is specified in the Handle location field (this field appears when you clear the box):

  • If the window is a MATLAB figure window, specify the name of a function whose return value is the figure handle. You can also specify initialization commands in the function to set the initial conditions of the ActiveX Control block.

  • If the window contains a Simulink subsystem, the control must be displayed on an ActiveX Control block contained in that subsystem. Specify the path of the ActiveX Control block on which the control is to appear.

    For example, if a model named my_model has a subsystem called sub_disp_signals that contains an ActiveX Control block named signal1, the path is my_model/sub_disp_signals/signal1.

Using this feature is useful in a complex model that displays signals in multiple subsystems on ActiveX Control blocks. If you feed the signals into ActiveX Control blocks but display the controls themselves in a separate system or window, you do not have to open the subsystems to see the results.

Border

The Border check box determines whether the block displays a border around the control.

    Note:   Be careful when clearing this box, because the only way to move a block is to drag it with the border. Clearing the Border box renders the ActiveX Control block immovable.

Was this topic helpful?