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.

OpDataSet

Library

rtlab/Data logging

Block

This block reads a cell array table from a Matlab binary file (*.mat) and outputs the selected column (dataset).

Figure 1: OpDataset block

Mask

Figure 2: OpDataset mask

Parameters

Real-Time PathPath where the file is located when the simulation is running on the target node.
Non Real-Time PathPath where the file is located when the model is running on the Command Station (Running under Windows OS).
Variable NameName of the variable saved in the .mat file. The variable should be saved in the Matlab V6 format. See example below on how to create and save the variable to a mat file.
Number of outputsThe number of outputs will correspond to the number of columns in the variable.
Max number of datasetsThe max number of datasets is the maximum number of rows in the variable. This maximum is used to allocate memory on the Real-Time target node during load. The variable can contain fewer rows than the maximum number of datasets.
Max dataset sizeMaximum size of a dataset. This size corresponds to the maximum size for each output.

Inputs

Dataset SelectA scalar value used to select the dataset during the simulation. This value corresponds to the row number saved in the variable.


Outputs

Status:

Value

Status

1

OK

-1

Output is trimmed

-2

Bad file name

Dataset size: Array containing the size of each dataset.

Data 1: Data from the first column of the selected dataset

M Script Example to Create One Dataset

%Dataset #1
RPPs{1,1}=zeros(1,20); %Output #1
RPPs{1,2}=zeros(1,5)+1; %Output #2
RPPs{1,3}=zeros(1,15)+2; %Output #3
RPPs{1,4}=zeros(1,20)+3; %Output #4

%Dataset #2
RPPs{2,1}=zeros(1,20)+10; %Output #1
RPPs{2,2}=zeros(1,20)+11; %Output #2
RPPs{2,3}=zeros(1,20)+12; %Output #3
RPPs{2,4}=zeros(1,20)+13; %Output #4

%Dataset #3
RPPs{3,1}=[1:20]; %Output #1
RPPs{3,2}=[20:-1:1]; %Output #2
RPPs{3,3}=[100:5:200]; %Output #3
RPPs{3,4}=ones(1,10); %Output #4
%Saving RPPs variable to my_dataset.mat
%Note: Variable should be saved in V6 format
save my_dataset.mat RPPs -V6

Characteristics and Limitations

Direct Feedthrough

No

Discrete sample time

Yes

XHP support

No

Work offline

No

Example Model

/Examples/Features/OpDataSet

OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323