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

Access Model Hierarchy Function

LabVIEW 2012 Control Design and Simulation Module Help

Edition Date: June 2012

Part Number: 371894G-01

»View Product Info

Owning Palette: Model Hierarchy Functions

Requires: Control Design and Simulation Module

Accesses model parameters and signals in a hierarchy of Simulation functions and subsystems. You can use this function to collect signal values at run time. You also can use this function to configure parameters of multiple functions and subsystems rather than configuring them individually.

Tip  Use the configuration dialog box for this function to view the hierarchy of simulation nodes in a VI.

The following conditions must be true for you to access a model or signal, respectively:

Details  Examples

Dialog Box Options
Block Diagram Inputs
Block Diagram Outputs

Dialog Box Options

ParameterDescription
AccessorsLists accessors, which correspond to block diagram terminals on this function that access model parameters and signals. To associate an accessor with a model parameter or signal, click the name of the accessor, and then identify the item in the Browse Model Hierarchy section.
Tip  To edit the label associated with an accessor, single-click the accessor.
VI with SimulationSpecifies the location on disk of the VI that contains the simulation hierarchy you want to access. By default, this function selects the current VI.
Select VI in memoryDisplays a dialog box that lists all VIs in memory that contain a simulation diagram or diagrams. You can use this dialog box to select the VI with Simulation whose model hierarchy you want to access.
Accessor PropertiesContains the following options for configuring how accessors interact with a model parameter or signal:
  • Path to model parameter or signal—Identifies the model parameter or signal you want to access within the hierarchy of its simulation diagram. You can select a parameter or signal in the Browse Model Hierarchy section to automatically populate this path. By default, this text box contains <From Terminal>, which means you must specify the path through the parameter path input on the block diagram.
  • Get/Set—Specifies whether you want the accessor to read from or write to a model parameter you select. If you select a signal instead of a model parameter, LabVIEW disables this menu because you only can read signal values.
Browse Model HierarchyContains the following options for identifying a model parameter or signal to access:
  • Select a function or subsystem—Displays the hierarchy of simulation nodes in the VI with Simulation, including Control & Simulation Loops, functions, and any subsystems. Select a function or subsystem in this list so its model parameters and signals display in the list to the right.
  • Select a parameter or signal—Lists the model parameters and signals associated with the node you select. To identify a model parameter or signal you want to access, select an accessor, and then select the desired item in this list.

    The Source column displays whether the value of a model parameter is configured through a block diagram terminal or in a configuration dialog box. To access a parameter whose source is a wired block diagram input, you must remove the wire to the input or change the source to be from the configuration dialog box for the function or subsystem.
    Note  Only signals on wires display in this table.
Parameter ValueAllows you to specify a value to set for the model parameter you select in the Select a parameter or signal list. When you configure the Get/Set option to Get, LabVIEW disables this section. You only can get signals, so LabVIEW also disables this section for accessors associated with signals.

When this function executes, any values you wire to block diagram inputs take precedence over values you specify in this section.

Block Diagram Inputs

ParameterDescription
VI reference inContains a reference to the VI whose model hierarchy you want to access. Leave this input unwired to access the VI specified in the configuration dialog box.

This input is useful for accessing model parameters or signals of VIs in other application instances.
error inDescribes error conditions that occur before this node runs.
accessor pathSpecifies the location of the model parameter or signal you want to associate with the accessor. If you specify a path in the Path to model parameter or signal dialog box option, this function does not display this input.

Refer to the Details section for information about the format of this path.
valueSpecifies the value to set for the model parameter associated with this accessor. When this function executes, values you wire to this input take precedence over values you specify in the configuration dialog box.

If you configure an accessor to get a model parameter or a signal, the function does not display this input.
Note  If you specify the path of the parameter or signal on the block diagram with the parameter path input, the value you specify must be of the variant data type.

Block Diagram Outputs

ParameterDescription
VI reference outReturns the reference to the VI.
error outContains error information. This output provides standard error out functionality.
valueReturns the value from the model parameter or signal associated with this output.

If you configure this function to set the value of a model parameter, the function does not display this output.
Note  If you specify the path of the parameter on the block diagram with the parameter path input, value is of the variant data type.

Access Model Hierarchy Details

You can access multiple parameters and signals using a single Access Model Hierarchy function. Use the configuration dialog box for the function to add accessors, or resize the function on the block diagram to add new terminals. A small direction arrow to the right of the accessor value terminal indicates a read operation. A small direction arrow to the left of the terminal indicates a write operation. To change the operation of an accessor associated with a model parameter, right-click the terminal and select Change Item to Get or Change Item to Set from the shortcut menu. You cannot perform a set operation on a signal.

Accessors have short, long, and alias names you can change by right-clicking this function and selecting Name Format from the shortcut menu. You configure the alias for an accessor in the configuration dialog box.

Note  This function must execute while the VI or subsystem that contains the model parameters or signals is running or reserved for execution. Otherwise, LabVIEW ignores the configuration when the function runs and returns warning –2387.

Formatting Parameter Paths

The strings that identify model parameter and signals are in the format loop label (if any).top subsystem label (if any).nested subsystem label (if any).function label.parameter.

Examples

Refer to the following VIs for examples of using the Access Model Hierarchy VI:

  • SimEx Initializing Model Parameters VI: labview\examples\Control and Simulation\Simulation\Get-Set Model Parameters
  • SimEx Setting Model Parameters at Runtime VI: labview\examples\Control and Simulation\Simulation\Get-Set Model Parameters
  • labview\examples\Control and Simulation\Simulation\Real-time\SimEx Setting Model Parameters to RT.lvproj
  • SimEx Collecting Model Signals VI: labview\examples\Control and Simulation\Simulation\Signal Collection
  • SimEx Getting Model Signals at Runtime VI: labview\examples\Control and Simulation\Simulation\Signal Collection

 

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