Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Caveats and Recommendations when using the Simulation Model Converter (Control Design and Simulation Module)

LabVIEW 2012 Control Design and Simulation Module Help

Edition Date: June 2012

Part Number: 371894G-01

»View Product Info

If the Simulation Model Converter cannot find a value for a parameter in your .mdl file it is converting, LabVIEW displays a warning. In these cases, the Simulation Model Converter uses the default value of the parameter in the corresponding LabVIEW function.

Note  In some cases, the Simulation Model Converter cannot find a value for a parameter because the parameter contains an expression instead of a constant value. If you have a licensed copy of The MathWorks, Inc. MATLAB® software version 5.0 or later installed on your computer, the Simulation Model Converter attempts to evaluate the MATLAB software expressions in your .mdl file prior to converting the file. If the Simulation Model Converter successfully evaluates the expression, the Simulation Model Converter uses the result of that evaluation as the parameter value and does not produce a warning.

The Simulation Model Converter cannot fully convert all functions of every model to LabVIEW block diagram code. If the Simulation Model Converter encounters a block it cannot convert, you receive a warning. In these cases, the Simulation Model Converter creates a placeholder simulation subsystem in LabVIEW. You must create a simulation subsystem using a LabVIEW VI to accomplish the same functionality as the block to replace this placeholder simulation subsystem in LabVIEW.

Because LabVIEW is strict about data types, the converted simulation subsystem might have broken wires. In this case, add block diagram code to convert between converted data types.

Converting Stateflow® Diagrams with the Simulation Model Converter

You can use the Simulation Model Converter to convert statecharts developed with The MathWorks, Inc. Stateflow® application software into statecharts usable within the LabVIEW Statechart Module. This topic describes the differences between the Stateflow® statechart code and the converted code in the LabVIEW Statechart Module.

Note  To convert statecharts developed with The MathWorks, Inc. Stateflow® application software to statecharts usable within the LabVIEW Statechart Module, you must install the LabVIEW Statechart Module. You can visit the National Instruments website for more information about the LabVIEW Statechart Module.

Unsupported Stateflow® Features

The following Stateflow® features are unsupported in the LabVIEW Statechart Module.

  • Super-step semantics
  • Initial transitions to a junction
  • Temporal logic
  • Output events
  • Bus signals
  • Guards on a default transition

The Simulation Model Converter converts any Stateflow® diagram regardless of whether or not it contains unsupported features. If your model includes any of these features, the Simulation Model Converter displays a warning after completing the conversion. You can edit the converted code using the LabVIEW Statechart Module.

Graphical Differences

The following graphical differences exist between the Stateflow® diagram code and the converted code in the LabVIEW Statechart Module.

Regions

In a Stateflow® diagram, states can exist within other states. In the LabVIEW Statechart Module, states only can exist within a region to create hierarchical states. The following image shows using a region within a state to create hierarchical states.

Transition Nodes

A Stateflow® diagram represents transitions between states as splines with labels containing code that defines the behavior of the transition. The LabVIEW Statechart Module represents transitions as wires with transition nodes that contain the same information as the Stateflow® label. You use these transition nodes to define the trigger(s), guard, and action of the transition.

State Names

In a Stateflow® diagram, states have labels that contain information about the behavior of the state. When you convert a Stateflow® diagram using the Simulation Model Converter, LabVIEW converts the information from the label in Stateflow® into guards and actions.


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit