FromCSV
This block reads data from a CSV file. The first line of the CSV file should include the variable names, and the first variable name should be "time".
Library
SignalImporters
Description
The FromCSV block enables data reading from CSV (comma separated values) files. The first line of the CSV file should indicate the variable names. It is mandatory that the first variable name is "time". This is, for example, compatible with the FMU result files.
The block will read as many columns as specified by the first parameter (Number of requested variables). The columns are identified by their name (located on the first line, passed as a string).
Parameters
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
fname | Filename | String | ||
nout | Number of requested variables | Number of variables to read in the CSV file. One variable corresponds to one column. | Number | |
outports | Variable selection | Structure | ||
outports/varname | Variable name | Name of the variable to read. A string corresponding to the column name (first line). | Cell of strings | |
outports/vardatatype | Datatype | Cell of strings | 'double' | |
outevent | Generate events at time instants | This parameter defines if the block generates an activation event. When OutEvent is used, an additional event output port is added to the block. Default is OFF. | Number | 0 |
externalActivation | External activation | Specifies whether the block receives an external activation or inherits its activation through its regular input ports. When External Activation is selected, an additional activation port is added to the block. By default, external activation is not selected. | Number | 0 |
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
Method | Interpolation method | Defines how the data read in is interpolated. | String | 'ZeroOrder' |
Leftside | Behavior before the data time span | String | 'Zero' | |
Rightside | Behavior after the data time | String | 'Zero' | |
Offset | Data starts from line # | Line of the CSV file to start to read from. Default is 2. | Scalar | |
Separator | CSV file separator character | If left as an empty string, Activate considers the first character following the variable time in the first line as the CSV separator. Otherwise this field is used to precise the separator character. | String |
Ports
Name | Type | Description | IO Type | Number |
---|---|---|---|---|
Port 1 | explicit | output | nout | |
Port 2 | activation | input | externalActivation | |
Port 3 | activation | output | outevent |
Advanced Properties
Name | Value | Description |
---|---|---|
always active | no | Time Dependency = standard mode activated |
direct-feedthrough | no | |
zero-crossing | no | |
mode | no | |
continuous-time state | no | |
discrete-time state | no |