FromModelica
Takes diagram and a locked version of the history of the diagram and unlocks it.
Syntax
FromModelica(ActivatePath)
FromModelica(ActivatePath,paramname)
FromModelica(ActivatePath,args)
FromModelica(ActivatePath,paramname,args)
FromModelica(ModelicaPath)
FromModelica(ModelicaPath,paramname)
FromModelica(ModelicaPath,args)
FromModelica(ModelicaPath,paramname,args)
R = FromModelica(...)
Inputs
- ActivatePath
- Path with slash notation representing an Activate address of a component in a model. This path can be either relative or absolute, starting respectively with './' and '/'.
- ModelicaPath
- Path with dot notation representing an object in the Modelica environment, following the standard Modelica syntax. For example, for object in MSL, the path starts with 'Modelica'.
- paramname
- A name representing a parameter of a component, a record element, a package name, a function, etc. It may contain dots to allow recursive access of the element inside the object specified by the first argument of the function.
- args
- Used to specify a Modelica modification or the arguments of a function. In case of modifiers and function call with named arguments, an OML struct is used. For positional function call, an OML cell is used.
Examples
FromModelica('/path/to/component')
FromModelica('./path/to/component')
FromModelica('path.to.entity')
FromModelica('path','name')
FromModelica('path').name
FromModelica ('path',struct('pname',pvalue,…))
FromModelica ('path','name',struct('pname',pvalue,…))
FromModelica ('path')(struct('pname',pvalue,…))
FromModelica ('path','name')(struct('pname',pvalue,…))
FromModelica ('path').name(struct('pname',pvalue,…))
FromModelica(…)(i)
FromModelica(…)(i,j)
FromModelica(…).name(i)
FromModelica(…).name(i,j)
FromModelica('funpath',{arg1,arg2,…})
FromModelica('funpath')({arg1,arg2,…})
FromModelica('funpath',struct('arg1name',arg1,…))
FromModelica('funpath')( struct('arg1name',arg1,…))
Comments
The retrieved elements can also be used in simple OML expressions including OML variables defined in the diagram workspace. The retrieved values themselves can be assigned to OML variables in Diagram contexts and thus be available in the diagram workspace.
Denoting these OML variables retrieved by FromModelica modexpr1, modexpr2…, and regular OML variables in the workspace, var1, var2…, the following commands provides examples of supported OML expressions for the definition of component parameter values. They are chosen to illustrate what kind of operations are supported and do not correspond to real usages, where the expressions are in general much simpler.
- var1+4*modexpr1+3
- [var1,var2*modeexpr1,modexpr2,pi]
- sin(modexpr1*modeexpr2+var1)/FromModelica('Modelica.Constants.eps')
- FromModelica('Modelica.Electrical.MultiPhase.Functions.quasiRMS')({1:6})/var1+modexpr1
- FromModelica('./DD/BB',var1)(2)*cos(modexpr1)
- var1-[FromModelica('/DD/BB1').cc FromModelica('/DD/BB2').dd]