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

10. Configuring Simulation Parameters Programmatically (Control Design and Simulation Module)

LabVIEW 2012 Control Design and Simulation Module Help

Edition Date: June 2012

Part Number: 371894G-01

»View Product Info

Earlier in this example, you used the Configure Simulation Parameters dialog box to configure the parameters of Spring-Mass Damper Example.vi. You also can configure simulation parameters programmatically by using the Input Node of the Control & Simulation Loop. Complete the following steps to configure simulation parameters programmatically.

  1. View the simulation diagram of Spring-Mass Damper Example.vi.
  2. Move the cursor over the Input Node to display resizing handles.
  3. Drag the bottom handle down to display all available Node inputs. You use these inputs to configure the simulation parameters without displaying the Configure Simulation Parameters dialog box.
    Tip  You also can right-click the Input Node and select Show All Inputs from the shortcut menu.


    Notice the gray boxes next to each input. These boxes display values you configure in the Configure Simulation Parameters dialog box. For example, the third gray box from the top displays 10.0000, which is the value of the Final Time numeric control that you configured. The fifth gray box from the top displays RK 23. This box specifies the current ODE solver, which you configured as Runge-Kutta 23 (variable).
    Tip  Move the cursor over the left edge of each Node input to display the label of that input.
  4. Right-click the input terminal of the ODE Solver input and select Create»Constant from the shortcut menu. A block diagram constant appears outside the Control & Simulation Loop. The value of this constant is Runge-Kutta 1 (Euler), which is different than what you configured in the Configure Simulation Parameters dialog box. However, the gray box disappears from the Input Node, indicating that the value of this parameter does not come from the Configure Simulation Parameters dialog box. Values that you programmatically configure override any settings you made in the Configure Simulation Parameters dialog box.

    The Input Node now resembles the following image.

    Tip  You also can use this method to create a front panel control instead of a block diagram constant.
  5. Right-click the constant you created and select Delete from the shortcut menu.
Previous
9. Editing the Simulation Subsystem
Home
Tutorial: Getting Started with Simulation
Next
11. Linearizing a Subsystem

 

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