Dials & Gauges Blockset    

Strip Chart

The interface to the Strip Chart block is different from the interface to the other preconfigured blocks in the Dials & Gauges Blockset. You can configure the Strip Chart block using properties in its dialog box, just as you would for other preconfigured blocks. However, to plot data on the chart, you must invoke methods for the block. You can use the MATLAB command invoke to call methods of ActiveX control blocks and pass arguments to those methods.

An M-file S-function provided with the Dials & Gauges Blockset plots data on the Strip Chart block by using the invoke method. More generally, this S-function illustrates how to communicate with any ActiveX control from the MATLAB language through an S-function.

The file is called ax_strip_sfun.m and is located in the main Dials & Gauges Blockset directory. You can use the following MATLAB command to find the location of this file on your computer.

During initialization, the Simulink block attributes (sample time, input width, etc.) are configured and the Strip Chart configuration is set. The infrastructure of the Dials & Gauges Blockset provides the handle of the ActiveX control (hActX) and is available in this S-function.

You can use this handle to set the properties of the Strip Chart through the standard dot notation. For example, the following line sets the LastX property of the Strip Chart to zero.

Any property of the Strip Chart can be set in this fashion.

In the outputs section of the S-function, each track of the Strip Chart is initialized to zero on the time axes and the actual plotting of the data is performed. A loop is included in this section to account for vector signals sent to the Strip Chart from Simulink.

Note that S-functions offer more options than those shown in this example. See the Writing S-Functions documentation for more details on writing your own S-functions.


  Sliders Using Your Own ActiveX Control