Programmatically retrieve logged LabVIEW front panel data from a subVI by enabling database access and selecting records to examine. Return time stamp metadata, record validity, and I/O terminal values as a cluster or individually.

Note If you display a subVI or Express VI as expandable, you cannot enable database access for that node. To facilitate database access, right-click the subVI or Express VI and place a checkmark on View As Icon.

By enabling database access for a subVI, you can examine specific records of the front panel values for that subVI.

  • Retrieve metadata about each record
  • Retrieve specific front panels values for each record:
    • From all terminals of the subVI at once in a single cluster
    • For specific terminals of the subVI

When you enable database access for a subVI, the inputs and outputs of the subVI act as outputs to datalog records. If you run the VI, the subVI does not run. Instead, the subVI returns its logged data to the front panel of the VI that contains the subVI.

To programmatically log front panel data from a subVI, complete the following steps.

  1. Click the Select a VI icon or text on the Functions palette.
  2. Navigate to the VI that logged the front panel data and place it on the block diagram.
  3. Right-click the VI and select Enable Database Access
    A yellow box that looks like a file cabinet appears around the VI.
  4. Right-click the record # terminal and select Create » Control.
    LabVIEW adds a numeric control to the front panel you use to enter a record number.
  5. To retrieve a specific record, enter a negative value in the record # control.

    –1 represents the last record, –2 represents the second to the last, and so on, through –n, which represents the first record.

    If you wire a number outside the range [–n, n – 1] to the record # terminal, the invalid record # output is TRUE, and the subVI retrieves no data.

  6. Retrieve metadata about the records.
    • Indicate whether a record is valid: Right-click the invalid record # terminal and select Create » Indicator.

      LabVIEW creates a round LED that indicates whether the record is valid.

    • Create a cluster that contains the time stamp value: Right-click the time stamp terminal and select Create » Indicator.

      LabVIEW creates a cluster that contains the time stamp value.

  7. Retrieve logged front panel values from the subVI.
    OptionDescription
    Retrieve values of all I/O together as a cluster Right-click the front panel data terminal and select Create » Indicator.
    LabVIEW block diagram that shows logging of front panel values as a cluster with database access to a subVI.

    LabVIEW creates a cluster that contains the front panel data of the subVI.

    Retrieve values of individual terminals
    • Wire directly to a terminal on the subVI, rather than to the database terminals, and create indicators.
    • If you created a front panel data cluster of all terminals but also want to process values individually, wire the cluster to the Unbundle function.
    LabVIEW block diagram that shows logging of the values on specific terminals of a subVI with database access.

    The VI returns data to the VI front panel according to the terminals you wired.

  8. Run the VI.

The VI returns values as follows, according to the record number that you wire at the input:

  • The time stamp of the record
  • A Boolean value that indicates whether the record is invalid
  • Front panel values as follows:
    • If you retrieve all front panel values as a cluster: A cluster that contains the front panel data
    • If you retrieve values for specific inputs and outputs: Individual indicators according to the terminals you wired

To disable database access for a subVI, right-click the subVI and select Disable Database Access.