modelJSONWriter
Extends from Modelica.Blocks.Icons.DiscreteBlock (Graphical layout of discrete block component icon).
Information
This model samples the model inputs u and saves them to a json file.
Typical use and important parameters
The parameter nin defines the number of variables that are stored.
In Dymola, this parameter is updated automatically when inputs are connected to the component.
The parameter fileName defines to what file name the results
are saved. The file is in the current working directory,
unless an absolute path is provided.
The parameter keyNames defines the key names that are used to
store the json values corresponding to the inputs u.
Dynamics
This model samples its inputs at the time defined by the parameter outputTime
and writes them to the file fileName.
The model has the following options:
-
If
outputTime==OutputTime.Initial, results are saved at initialisation. -
If
outputTime==OutputTime.Custom, results are saved when the built-in variabletimeachievescustomTime. -
If
outputTime==OutputTime.Terminal, results are saved when the simulation terminates.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | nin | Number of inputs | |
| String | fileName | getInstanceName() + ".json" | File name, including extension |
| String | varKeys | {"key" + String(i) for i in 1:nin} | Key names, indices by default |
| Buildings.Utilities.IO.Files.BaseClasses.OutputTime | outputTime | Buildings.Utilities.IO.Files.BaseClasses.OutputTime.Terminal | Time when results are written to file |
| Modelica.Units.SI.Time | customTime | 0 | Custom time when results are stored, used if outputTime=Custom only |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Blocks.Interfaces.RealVectorInput | u | Variables that are saved |
Revisions
-
April 9, 2019 by Filip Jorissen:
First implementation. See #1114.