Documentation Home Page ◇ RT-LAB Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.
OpParameterManager
Library
rtlab/Data logging
Block
The OpParameterManager block allows a user to manage subset of signal.
Mask
Description
The OpParameterManager block manages saving and reloading a subset of signals of the model where it is included. The signals, or parameters, are saved as a single MATLAB variable in a mat-file.
The file name and variable name are specified in the block mask. Note that the size of the variable saved in the file is equal to the number of parameters plus 1. The first element of the variable is unused, but enables compatibility with the OpFromFile block in which the first element of the variable is the time value.
The block makes use of an asynchronous application launched during model initialization. This application performs the following tasks: read the specified file at initialization, save the parameters in the file, and reload the values saved in the file.
Both saving and reloading actions are performed depending on specific conditions of the first two inputs of the OpParamManager block, as described in the Inputs section below.
Parameters
Controller ID | A non-null positive integer that serves as an identifier for the control of the asynchronous application. Note that two OpParameterManager blocks can not share the same Controller ID |
---|---|
Filename | Name of the file that will be read at initialization, and that will be used later on to save or reload the parameters. If the file is not found in the model directory on the target, initial parameter values are set to 0, and the file will be created at the first save request. The file is written in the Matlab-4 format, |
Variable name | Name of the Matlab variable in which the parameters are grouped. This name is only necessary to create a Matlab compatible file format. |
Number of signals | Specifies the number of parameters to be saved or read. This number must be equal to the size of the Data input and of the Data_out output of the block. |
Trigger | Two options are given to the user for triggering a save or reload action. With the Rising Edge option, a rising edge on the Data_ready line triggers the action. With the Level option, the action will be repeatedly performed at each time step as long as the Data_ready line is asserted. |
Inputs
Data_ready | When asserted, this line triggers saving or reloading the data connected to the Data input. The action to be performed, saving or reloading, depends on the value of the Save_Reload line at the time when the Data_ready line is asserted. |
---|---|
Save_Reload | When set to 1, data will be saved in file when the Data_ready line is asserted. When set to 2, data will be read from file when the Data_ready line is asserted. |
Data | Signal input vector |
Outputs
Error: This output reflects the error status of the last saving or reloading action requested. Possible values are summarized in the following table:
Error Status | Description |
---|---|
0 | No error occurred |
-1 | The file could not be opened for writing during a ‘save’ request |
-2 | The Save_Reload input was not equal to 1 or 2 when the Data_ready line was asserted |
-3 | The file could not be opened during a ‘reload’ request |
Data_out: Signal output vector
Characteristics and Limitations
Direct Feedthrough | No |
---|---|
Discrete sample time | Yes |
XHP support | Yes (Partial XHP only) |
Work offline | No |
OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323
Follow OPAL-RT: LinkedIn | Facebook | YouTube | X/Twitter