NFlow.sspInfo
Inspect, import and export SSP (System Structure and Parameterization) archives.
📝Syntax
info = NFlow.sspInfo(sspFile)
nflowFile = NFlow.sspImport(sspFile, destinationDirectory)
sspFile = NFlow.sspExport(sspFile, components, connections)
sspFile = NFlow.sspExportDiagram(nflowFile, sspFile)
NFlow.writeSsv(ssvFile, parameterValues)
📥Input Arguments
Parameter Description
sspFile a character vector: path to an .ssp archive (a zip holding a SystemStructure.ssd and its component FMUs under resources/).
destinationDirectory a character vector: an existing directory that receives the extracted component FMUs and the generated .nflow model.
nflowFile a character vector: path to a .nflow diagram whose blocks are fmu blocks (as produced by NFlow.sspImport), packaged back into an SSP by NFlow.sspExportDiagram.
components a struct array with fields name and model (the path to each component's .nflow model).
connections a struct array with fields startElement, startConnector, endElement, endConnector. An empty startElement denotes a system input and an empty endElement a system output.
📤Output Arguments
Parameter Description
info a structure with fields name, systemConnectors (the parent system's own name/kind connectors), components (each name, source, type, implementation, parameterSources) and connections (each startElement, startConnector, endElement, endConnector).
nflowFile the path to the .nflow model written by NFlow.sspImport.
📄Description

SSP (System Structure and Parameterization) is an open standard that packages several FMUs and the way their connectors are wired into a single .ssp archive.

NFlow.sspInfo reads the archive's SystemStructure.ssd and reports the composition without loading any binary: the system name, its components and every connection between connectors.

NFlow.sspImport wires each component into an nflow diagram: every FMI 3.0 Co-Simulation component becomes an fmu block, connectors are matched to ports by name, and a component output routed to a system output is exposed as a recordable sink. Parameter values bound to a component — through a .ssv (System Structure Parameter Values) file or embedded directly in the .ssd — are applied to its FMU block. Components that are not FMI 3.0 are reported with their declared version rather than failing obscurely.

NFlow.sspExport does the reverse: it exports each component model to an FMU, lists its connectors and writes a SystemStructure.ssd describing the composition. Connections that reference the parent system (an empty start or end element) are declared as system-level connectors.

NFlow.sspExportDiagram is the exact inverse of NFlow.sspImport: it takes a diagram whose blocks are fmu blocks and re-emits an SSP that references those same component FMUs directly (without re-exporting them). Wires between FMU blocks become connections — port indices are mapped back to connector names by inspection — and each To Workspace sink fed by an FMU output becomes a system output connector. Importing an SSP and exporting the resulting diagram round-trips the composition's components, its component-to-component links and its system outputs (a system input has no driver block after import, so it is not reproduced). Any parameter overrides carried on an FMU block (as applied by NFlow.sspImport from a .ssv) are written back out as a bound .ssv, so parameter values round-trip too.

NFlow.writeSsv writes a parameter name/value struct as a .ssv file (the inverse of NFlow.readSsv): logical values become Boolean, integers Integer, everything else Real.

💡Examples
Inspect the bundled controlled-drivetrain composition
ssp = [modulepath('nflow_fmi', 'root'), '/examples/ControlledDrivetrain.ssp'];
info = NFlow.sspInfo(ssp);
disp(info.name);
disp({info.components.name});
disp(numel(info.connections));
Round-trip a composition: SSP -> diagram -> SSP
ssp = [modulepath('nflow_fmi', 'root'), '/examples/ControlledDrivetrain.ssp'];
work = [tempdir(), 'ssp_roundtrip'];
mkdir(work);
nflowFile = NFlow.sspImport(ssp, work);
outSsp = NFlow.sspExportDiagram(nflowFile, [work, filesep, 'RoundTrip.ssp']);
info = NFlow.sspInfo(outSsp);
disp({info.components.name});
🔗See Also
simfmiCoSimulatefmiInfo
📚Bibliography
Modelica Association, System Structure and Parameterization (SSP) standard, https://ssp-standard.org
🕔Version History
Version Description
1.0.0 initial version
2.0.0 NFlow.sspExportDiagram: package a diagram of FMU blocks back into an SSP; NFlow.writeSsv exports parameter values (SSV round-trip)
Edit this page on GitHub