| Simulink Reference | ![]() |
Allow Level-2 M-file S-function and other M-file programs to get information about a block while a simulation running.
Description
This class allows a Level-2 M-file S-function or other M program to obtain information about a block. Simulink creates an instance of this class or a derived class for each block in a model. Simulink passes the object to the callback methods of Level-2 M-file S-functions when it updates or simulates a model, allowing the callback methods to get block-related information from and provide such information to Simulink. See Writing Level-2 M-file S-functions for more information.You can also use instances of this class in M-file programs to obtain information about blocks during a a simulation. See Accessing Block Data During Simulation for more information.
Parent Class
Derived Classes
Property Summary
| Name |
Description |
|
Block's handle. |
|
Current simulation time. |
|
Number of discrete work vectors used by block. |
|
Number of block output ports. |
|
Number of block's continuous states. |
|
Number of block's discrete states |
|
Number of parameters that can be entered on S-function block's dialog box. |
|
Number of block's input ports. |
|
Number of runtime parameters used by block. |
|
Sample times at which block produces outputs. |
Method Summary
| Name |
Description |
|
Get a block's continuous states. |
|
Get a block's continuous states. |
|
Get name of a data type supported by this block. |
|
Get size of a data type supported by this block. |
|
Get a block's continuous state derivatives. |
|
Get a parameter ented on an S-function block's dialog box. |
|
Get one of a block's Dwork vectors. |
|
Determine the properties of a fixed-point data type. |
|
Get one of a block's input ports. |
|
Get one of a block's output ports.. |
|
Get one of the runtime parameters used by a block. |
Properties
BlockHandle
CurrentTime
Description: Current simulation time.
NumDworks
Description: Number of data work vectors.
NumOutputPorts
Description: Number of output ports.
See Also: ssGetNumOutputPorts
NumContStates
Description: Number of continuous states.
See Also: ssGetNumContStates
NumDiscStates
Description: Number of discrete states. In an M-file S-function, you need to use Dworks to setup discrete states
See Also: ssGetNumDiscStates
NumDlgParams
Description: Number of parameters declared on the block's dialog. In the case of the S-function, it returns the number of parameters listed as a comma-separated list in "S-function parameters" dialog field.
See Also: ssGetNumSFcnParams
NumInputPorts
Description: Number of input ports.
See Also: ssGetNumInputPorts
NumRuntimePrms
Description: Number of parameters declared on the block's dialog. In the case of the S-function, it returns the number of parameters listed as a comma-separated list in "S-function parameters" dialog field.
See Also: ssGetNumSFcnParams
SampleTimes
Description: Blocls's sample times.
Access: RW for M-file S-functions, RO for all other blocks.
Methods
ContStates
Purpose: Get a block's continuous states
Syntax: states = ContStates();
Description: Get vector of continuous states.
See Also: ssGetContStates
DataTypeIsFixedPoint
Purpose: Determine whether a data type is fixed point.
Syntax: bVal = DataTypeIsFixedPoint(dtID);
Description: Returns true if the specified data type is a fixed-point data type.
DatatypeName
Purpose: Get the name of a data type.
Syntax: name = DatatypeName(dtID);
Description: Returns the name of the data type specified by dtID.
See Also: DatatypeSize
DatatypeSize
Purpose: Get the size of a data type.
Syntax: size = DatatypeSize(dtID);
Description: Returns the size of the data type specified by dtID.
See Also: DatatypeName
Derivatives
Purpose: Get derivatives of a block's continuous states
Syntax: states = ContStates();
Description: Get vector of state derivatives.
See Also: ssGetdX
DialogPrm
Purpose: Get an S-function's dialog parameters.
Syntax: param = DialogPrm(pIdx);
Description: Get specified dialog parameter. In the case of the S-function each DialogPrm corresponds to one of the elements in the comma-separated list of parameters in the S-function parameters dialog field.
See Also: ssGetSFcnParam, RuntimePrm
Dwork
Purpose: Get one of a block's Dwork vectors.
Syntax: dworkObj = Dwork(pIdx);
Description: Get information abouth the Dwork vector specified by pIdx where pIdx is the index number of the work vector. This method returns an object of type Simulink.BlockCompDworkData.
See Also: ssGetDWork
FixedPointNumericType
Purpose: Get the properties of a fixed-point data type.
Syntax: eno = FixedPointNumericType(dtID);
Description: Returns an object of Embedded.Numeric class that contains the attributes of the specified fixed-point data type.
InputPort
Purpose: Get an input port of a block.
Syntax: port = InputPort(pIdx);
Description: Get the input port specified by pIdx, where pIdx is the index number of the input port. For example,
returns the first input port of the block represented by the runtime object rto.
This method returns an object of type Simulink.BlockPreCompInputPortData or Simulink.BlockCompInputPortData, depending on whether the model that contains the port is uncompiled or compiled. You can use this object to get and set the input port's uncompiled or compiled properties, respectively.
See Also: ssGetInputPortSignalPtrs, Simulink.BlockPreCompInputPortData, Simulink.BlockCompInputPortData, .html">OutputPort
OutputPort
Purpose: Get an output port of a block.
Syntax: port = OutputPort(pIdx);
Description: Get the output port specified by pIdx, where pIdx is the index number of the output port. For example,
returns the first output port of the block represented by the runtime object rto.
This method returns an object of type Simulink.BlockPreCompOutputPortData or Simulink.BlockCompOutputPortData, depending on whether the model that contains the port is uncompiled or compiled. You can use this object to get and set the input port's uncompiled or compiled properties, respectively.
See Also: ssGetInputPortSignalPtrs, .html">Simulink.BlockPreCompOutputPortData, .html">Simulink.BlockCompOutputPortData
RuntimePrm
Purpose: Get an S-function's runtime parameters.
Syntax: param = RuntimePrm(pIdx);
Description: Get specified runtime parameter.
See Also: ssGetRunTimeParamInfo
| Simulink.ParamRTWInfo | Simulink.ScopeDataLogs | ![]() |
© 1994-2005 The MathWorks, Inc.