Figure 22: Ports for signal flow in SysML

Click on the image to view it full size

model Spring
  in Real u;
  out Real y;
end Spring;
There is an error in the spec's example Modelica code, it is probably meant (for consistency with later spec examples) to be input and output:

Note that you can't connect directly to input Real u; or output Real y; in Modelica. They can, however, be referenced internally as is shown later in more detail in Figure 25: Constraint block for signal flow in SysML.

Export of block Spring to Modelica from the MagicDraw SysML Plugin or Magic Cyber-Systems Engineer ® (Cameo Systems Modeler®) gives:

model Spring
  Modelica.Blocks.Interfaces.RealInput u;
  Modelica.Blocks.Interfaces.RealOutput y;
end Spring;
Where Modelica.Blocks.Interfaces.RealInput is just:

connector RealInput = input Real "'input Real' as connector";
And Modelica.Blocks.Interfaces.RealOutput is just:

connector RealOutput = output Real "'output Real' as connector";
Up next
Snippets (quotes/extracts)
Visit also
Visit also (backlinks)
Related slides (includes other tutorials)
Related slides (backlinks, includes other tutorials)