Ul extension vi example programs – Measurement Computing UL for NI LabVIEW User Manual

Page 15

Advertising
background image

How to use the

NI LabVIEW Extensions (VIs) UL Extension VI example programs

UL function contexts: foreground (__Fg) and background (__Bg)

There are two distinct VIs for every UL function featuring background operation. One is for foreground
operation only, and the other is for background operation only. The last two letters of the function names are
"Fg" and "Bg" for foreground and background, respectively. Their parameter lists differ, in that background
VIs have a

Context

output that must be wired to subsequent VIs (GetStatus.VI and StopBg.VI).

Context

is an output data structure that contains information such as the board number, the data array, the size

of the data array, the initial status of the operation, and the error code. Connecting a probe to the

Context

wire

displays the elements in the data structure. You can check the intermediate values if desired. In general, the
background VIs should conform to the wiring pattern shown in Figure 1. There are several example programs
that effectively demonstrate the correct wiring and use of Contexts. Please refer to example VIs whose names
end in "BG."

Figure 1. Background VIs General Wiring Pattern

UL Extension VI example programs

The UL for LabVIEW software package includes example programs which demonstrate how to use the
Universal Library low-level extension VIs. We strongly suggest that you review the example programs to help
you understand how to integrate the VIs into your program. The following example programs are included to
demonstrate the LabVIEW interface:

Example VI

explanation

XAIN

Single analog input in a while loop with a metered display.

XAINSCBG

Analog input scan in the background. Display data on a graph. Uses GetStatus.VI,

StopBg.VI and OptAIn.VI.

XAICNBG

Analog input scan in the background in the CONTINUOUS mode. Same as

XAINSCBG but runs continuously displaying data in real time.

XAINSCFG

Analog input scan in the foreground. Displays data on a graph. Uses SelChan.VI

and OptAIn.VI.

XAIOSCB

Demonstrates concurrent analog input and output scans.

XAOUT

Single analog output. Demonstrates sequences, case statements, for loops, and

while loops.

XAOUTSCB

Analog output scan in the background. Uses GetStatus.VI and StopBg.VI.

XAOUTSCF

Analog output scan in the foreground. Generates sinusoidal data.

XAPRETRB

Analog pre-trigger in the background. Display data on a graph. Uses GetStatus.VI,

StopBg.VI and ACnvPrDt.VI.

XAPRETRF

Analog pre-trigger in the foreground. Displays data on a graph. Uses SelChan.VI

and ACnvPrDt.VI.

XASCFILE

Analog input to a file. Displays data on a graph. Uses FileAInS.VI and

FileRead.VI.

XASCMEM

Analog input to memory board. Displays data on a graph. Uses MemReset.VI and

MemRead.VI.

XCFREQ

Displays frequency of signal at counter input. Uses C9513Init.VI and CFreqIn.VI.

15

Advertising