When you enable database access, the inputs and outputs of the subVI actually act as outputs, returning their logged data to the front panel of the current VI.
Note If you display a subVI or Express VI as expandable, you cannot enable database access for that node.
Complete the following steps to retrieve logged front panel data using a subVI.
Click the Select a VI icon or text on the Functions palette.
Right-click the VI and select Enable Database Access from the shortcut menu. A yellow box that looks like a file cabinet appears around the VI.
Right-click the record # terminal and select Create»Control from the shortcut menu. LabVIEW adds a numeric control to the front panel you use to enter a record number.
Right-click the invalid record # terminal and select Create»Indicator from the shortcut menu. LabVIEW creates a round LED that indicates whether the record is valid.
Right-click the front panel data terminal and select Create»Indicator from the shortcut menu. LabVIEW creates a cluster that contains the front panel data.
Right-click the time stamp terminal and select Create»Indicator from the shortcut menu. LabVIEW creates a cluster that contains the time stamp value.
Run the VI. The front panel cluster and time stamp cluster return the data to the front panel of the current VI, according to the record number wired at the input. It also returns a Boolean value that indicates whether the indicated record number is invalid.
You can access records relative to the last logged record using negative record numbers. –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 to n – 1 to the record # terminal, the invalid record # output is TRUE, and the subVI retrieves no data.
Complete the following steps to retrieve values for specific inputs and outputs.
Click the Select a VI icon or text on the Functions palette.
Navigate to the VI that logged the front panel data and place it on the block diagram.
Right-click the VI and select Enable Database Access from the shortcut menu. A yellow box that looks like a file cabinet appears around the VI.
Right-click the record# terminal and select Create»Control from the shortcut menu. LabVIEW adds a numeric control to the front panel you use to enter a record number.
Instead of creating indicators to retrieve front panel data and time stamp data, wire directly to a terminal on the subVI and create indicators.
Run the VI. The VI returns data to the VI front panel according to the terminals you wired.
To disable database access, right-click a subVI and select Disable Database Access from the shortcut menu.