Skip to main content
Namespace: VM.API.Pre.CoSimulator
Assembly: VM.API.Pre.CoSimulator.dll
This class implements APIs for FileGen and MFileGen class.

Inheritance

object ← CoSimulatorAPI

Extension Methods

LinkPropertyItemCache.GetLinkProperties(object, LinkPropertyType), LinkPropertyItemCache.GetLinkPropertiesAndValues(object, LinkPropertyType), LinkPropertyItemCache.GetLinkedObjects<T>(object, LinkPropertyType)

Methods

CreateSInput(SubSystemDocument, UnitName, string)

Create SInput.

Parameters

document SubSystemDocument The document to create the scalar input. unit UnitName The unit of the scalar input. name string The name of the scalar input.

Returns

Obj The new SInput object that is created by this API.

Exceptions

ArgumentNullException Will be thrown if ‘document’ is null.

CreateSOutput(SubSystemDocument, Obj, UnitName, string)

Create SOutput.

Parameters

document SubSystemDocument The document to create the scalar output. formula Obj The formula of the scalar output. unit UnitName The unit of the scalar output. name string The name of the scalar output.

Returns

Obj The new SOutput object that is created by this API.

Exceptions

ArgumentNullException Will be thrown if ‘document’, ‘formula’ is null. ArgumentException Will be thrown if the type of ‘formula’ is not Function.

ExecuteMatlabProcess(Obj, string, string, IEnumerable<Obj>, IEnumerable<Obj>, string, ExpressionValueVariable?)

Execute process using MFileGen.

Parameters

fileGen Obj The M file generation to excute process. strFileName string The file name of a matlab file to be generated. strFileDir string The file path of matlab file to be generated. inputs IEnumerable<Obj> The inputs of the M file generation setting. outputs IEnumerable<Obj> The outputs of the M file generation setting. strInterfacePath string The interface folder path of the M file generation setting. interfaceTimeStep ExpressionValueVariable? The interface time step of the M file generation setting.

Exceptions

ArgumentNullException Will be thrown if ‘fileGen’, ‘strFileName’ ‘strFileDir’, ‘strInterfacePath’ arguments are empty. ArgumentException Will be thrown if the type of ‘fileGen’ is not MFileGen. ArgumentException Will be thrown if the type of ‘inputs’ is not SInput or if the type of ‘output’ is not SOutput. ArgumentOutOfRangeException Will be thrown if ‘interfaceTimeStep’ value is equal to or less than 0.

ExecuteProcess(Obj, string, string, string)

Execute process using FileGen.

Parameters

fileGen Obj The file generation to excute process. strFileName string The file name of a fmu file to be generated. strFileDir string The file path of a fmu file to be generated. strInterfacePath string The interface folder path.

Exceptions

ArgumentNullException Will be thrown if ‘fileGen’, ‘strFileName’, ‘strFileDir’, ‘strInterfacePath’ arguments are empty. ArgumentException Will be thrown if the type of ‘fileGen’ is not FileGen.

ExportMatlabModel(Obj, IEnumerable<Obj>, IEnumerable<Obj>, string, string)

Export matlab model using MFileGen.

Parameters

fileGen Obj The file generation to export matlab model. inputs IEnumerable<Obj> The inputs of the matlab file generation setting. outputs IEnumerable<Obj> The outputs of the matlab file generation setting. strFileName string The file name of a matlab file to be generated. strFileDir string The file path of a matlab file to be generated.

Exceptions

ArgumentNullException Will be thrown if ‘fileGen’, ‘strFileName’, ‘strFileDir’ arguments are empty. ArgumentException Will be thrown if the type of ‘fileGen’ is not MFileGen.

ExportModel(Obj, IEnumerable<Obj>, IEnumerable<Obj>, string, string, string, FMIVersionType, ExpressionValueVariable?, string, double, int)

Export model using FileGen..

Parameters

fileGen Obj The file generation to export model. inputs IEnumerable<Obj> The inputs of the file generation setting. outputs IEnumerable<Obj> The outputs of the file generation setting. strFileName string The file name of fmu file to be generated. strFileDir string The file path of files to be generated. strInterfacePath string The interface folder path. version FMIVersionType The version of the file generation setting. interfaceTimeStep ExpressionValueVariable? The interface time step of the file generation setting. modelDescription string The model description of the file generation setting. scaleFactor double The scale factor of the file generation setting. messageLevel int The message level of the file generation setting. None=0, Partial=1, Full=2

Exceptions

ArgumentNullException Will be thrown if ‘fileGen’, ‘strFileName’, ‘strFileDir’, ‘strInterfacePath’ arguments are empty. ArgumentException Will be thrown if the type of ‘fileGen’ is not FileGen. ArgumentException Will be thrown if the type of ‘inputs’ is not SInput or if the type of ‘output’ is not SOutput. ArgumentOutOfRangeException Will be thrown if ‘interfaceTimeStep’ value is equal to or less than 0.

GenerateFile(SubSystemDocument, string)

Create FileGen.

Parameters

document SubSystemDocument The document to create the file generation setting of FMI version. name string The name of the file generation setting of FMI version.

Returns

Obj The new FileGen object that is created by this API.

Exceptions

ArgumentNullException Will be thrown if ‘document’ is null.

GenerateMatlabFile(SubSystemDocument, string)

Create MFileGen.

Parameters

document SubSystemDocument The document to create the M file generation setting of matlab version. name string The name of the M file generation setting of matlab version.

Returns

Obj The new MFileGen object that is created by this API.

Exceptions

ArgumentNullException Will be thrown if ‘document’ is null.