beautypg.com

Measurement Computing UL for NI LabVIEW User Manual

Page 20

background image

Universal Library Virtual Instruments (VIs)

Analog Input VIs

Rate

(input)

This is the rate at which scans are triggered. If you are sampling four channels, 0-3,

specifying a rate of 10,000 scans per second (10 kS/s) will result in the A/D
converter rate of 40 kS/s: (4 channels at 10,000 samples per channel per second).
This is different from some software where you specify the total A/D chip rate. In
those systems, the per channel rate is equal to the A/D rate divided by the number
of channels in a scan. This argument also returns the value of the actual rate set.
This may be different from the requested rate because of pacer limitations.

Caution!

You will generate an error if you specify a total A/D rate beyond the capability of the board.
For example; if you specify

LowChan

= 0,

HighChan

= 7 (8 channels total) and

Rate

= 40,000

and you are using a PCI-DAS6025, you will get an error. You have specified a total rate of 8
x 40,000 = 320,000.
The PCI-DAS6025 is capable of converting 200,000 samples per second. The maximum
sampling rate depends on the A/D board that is being used and on the sampling mode options.

Range

If the selected A/D board does not have a programmable range feature, this

argument is ignored. Otherwise the gain can be set to any of the following ranges
that are supported by the selected A/D board. Refer to the board-specific
information for the list of ranges supported by each board. See the "

Range

input

values

" table on page 19 for valid values. Refer to board-specific information

contained in the Universal Library User's Guide (available at

www.mccdaq.com/PDFmanuals/sm-ul-user-guide.pdf

) for a list of the A/D ranges

supported by each board.

Continuous

This option (True) puts the VI in an endless loop. After it collects the required

number of samples, it resets to the start of the buffer and begins again. The only
way to stop this operation is with StopBg.VI.

Options

For a detailed explanation of the

Options

field, refer to OptAIn.VI on page 30. The

OptAIn.VI must be wired to this input.

InterChannel Delay

Delay in seconds between channels in a scan. Negative values indicate that the

interchannel delay will automatically be minimized. Currently, positive values will
result in interchannel delays corresponding to the

Rate

sampling rate. For example:

1/(

Rate

*(

HighChan

-

LowChan

+1)).

Rate

(output)

Actual sampling rate in channel scans per second. This may be different from the

requested rate because of pacer limitations.

Context

Data structure containing information from a background operation. Some of the

information included is the board number, the data array, the array size, and the
initial status of the background operation.

Follow the steps below when wiring this VI:

1.

Start a background operation.

2.

GetStatus.VI checks for completion (boolean output called
"Running").

3.

StopBg.VI terminates the operation, if not already done, and
frees memory aliases.

4.

Data output from the background operation is passed to
GetStatus.VI and StopBg.VI via "Context", and can be wired
from one or both of them for intermediate or final actions,
respectively.

The demo VIs illustrate this process effectively.

ErrCode

Error code returned from the Universal Library. Zero if no error occurred. Use the

ErrMsg VI to convert ErrCode into a readable string.

Important - Read board-specific information in UL User's Guide

In order to understand the functions, read the board-specific information contained in the Universal Library
User's Guide (available on our web site at

www.mccdaq.com/PDFmanuals/sm-ul-user-guide.pdf

). The

example programs should be examined and run prior to attempting any programming of your own.

20