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".

    FromCSV

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

FromCSV_0

NameLabelDescriptionData TypeValid 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'
'int32'
'int16'
'int8'
'uint32'
'uint16'
'uint8'
'boolean'

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
1

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
1

FromCSV_1

NameLabelDescriptionData TypeValid Values

Method

Interpolation method

Defines how the data read in is interpolated.

String

'ZeroOrder'
'Linear'
'Not_a_knot'
'Natural'
'Clamped_To_Zero'
'Akima'
'Fritsch_Butland'
'Steffen'

Leftside

Behavior before the data time span

String

'Zero'
'Hold'
'Extrapolation'
'Repeat'
'Error'

Rightside

Behavior after the data time

String

'Zero'
'Hold'
'Extrapolation'
'Repeat'
'Error'

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

NameTypeDescriptionIO TypeNumber

Port 1

explicit

output

nout

Port 2

activation

input

externalActivation

Port 3

activation

output

outevent

Advanced Properties

NameValueDescription

always active

no

Time Dependency = standard mode activated

direct-feedthrough

no

zero-crossing

no

mode

no

continuous-time state

no

discrete-time state

no