Write comma-separated values to file.
This SimObject writes comma-separated values of input port values to file. Simulation time will also be included in the output file. A header is added with contents T,[FileName]_0, .. ,[FileName]_[PortWidth - 1]
An output line is added for each major time step.
Example configuration excerpt
<Lib
LibName = "fhsim_base"
SimObject = "Sink/CSV"
Name = "csv"
FileName = "outfile_CSVSink.csv"
PortWidth = "1"
/>
<Connection
csv.In = "Some.Out"
/>
Input Ports
Name | Width | Description |
In | 1 | Input signal. |
Output Ports
This SimObject does not contain any outputs.
Configuration parameters
Name | Width | Description |
FileName | 1 | File name to write to. .csv will be appended. |
PortWidth | 1 | Size of the input port In . |
Initial conditions
This SimObject does not contain any initial conditions.
Full example file
<Contents>
<OBJECTS>
<Lib
LibName="base"
SimObject="Sink/CSV"
Name="F"
FileName="outfile_CSVSink.csv"
PortWidth="1"
/>
<Lib
LibName="base"
SimObject="Src/Sine"
Name="A"
FHz="1"
PhaseRad ="0"
/>
</OBJECTS>
<INTERCONNECTIONS>
<Connection
F.In="A.Out"
/>
</INTERCONNECTIONS>
<INITIALIZATION>
<InitialCondition
/>
</INITIALIZATION>
<INTEGRATION>
<Engine
IntegratorMethod="2"
NumCores="1"
TOutput="0, 0:0.1:10, 20"
LogStates ="1"
stepsize ="0.1"
HMax="0.002"
HMin="0.00000001"
AbsTol="1e-3" RelTol="1e-3"
UseRSSNormInsteadOfInfNorm="0"
FileOutput="objects:all"
/>
</INTEGRATION>
</Contents>
This SimObject is referred to as Sink/CSV