Parameter

Parameters can modify the behavior of blocks. Signal instances are created for block parameters of type PT.Parameter. This object can be created using PmpParameter in MATLAB which sets the required and optional properties of the object. Parameters can be changed independently or they can be changed by grouping them in a Parameter set. Grouping ensures parameter updates are done atomically from the perspective of Simulink. Parameters may only be modified from the PMP client-side and not from an exported Simulink model.

In contrast to inports, parameter updates are visible in the model during the execution of the model. This is illustrated in Overview of an asynchronously processed sample where a testpoint is written during the execution of the model, where the black block indicates a parameter update. This update can be seen during the execution of the model as indicated by the arrow originating from the black block. Applying a parameter set is always done in between the write and read, i.e. that allows atomic updates of parameters in a Simulink model. This interaction with parameters is identical as for standard PMP blocks that run synchronously, however, due to the fact that asynchronous blocks typically execute longer it is more notable.

Overview of an asynchronously processed sample where a parameter is written during the execution of the model

Overview of an asynchronously processed sample where a parameter is written during the execution of the model

Vector and matrix representation

Representation of Simulink block parameters containing a vector or a matrix can be realized in two ways. When the Simulink block parameter is of type PmpParameter, a Signal will be realized for each entry in the vector or matrix, see Naming Conventions and Restrictions for naming. Besides parameters, PmpUpdatable can be used to store the arrays or matrices of data in Simulink.

For each PmpUpdatable in Simulink, an Updatable instance is created in PMP. The content of a PmpUpdatable is updated atomically for the Simulink model, independent of the size of the PmpUpdatable. Limitations: When updating multiple updatables, the content of these updatables are updated at different moments in time. For synchronous executing Simulink models the updating is done when the model is not executing. For asynchronous executing Simulink models this is not guaranteed. Data is stored in as binary little-endian data.

PmpUpdatables can be used analogously to PmpParameters, a PT.Updatable has to be created in the MATLAB workspace using PmpUpdatable. The name of the created object can be used in any block which accepts a vector or a matrix as block parameter. PmpUpdatables cannot be used for scalar parameters.