Download (NI ELVIS) User Manual

Transcript
Chapter 4
Programming NI ELVIS
perform counter/timer measurements using NI-DAQmx, refer to the
NI-DAQmx documentation that shipped with the DAQ device.
NI ELVIS also provides access to the programmable function input
(PFI) pins on the DAQ device. These pins are typically used in advanced
applications that require external control of a measurement. Examples of
these advanced applications include triggering and scan clock control.
For more information on the PFI pins, refer to the DAQ device
documentation. For more information on how to use the PFI pins using
NI-DAQmx, refer to the NI-DAQmx documentation that shipped with the
DAQ device.
Programming NI ELVIS Using the NI ELVIS LabVIEW API
An instrument driver is a set of software routines that control a
programmable instrument. Each routine corresponds to a programmatic
operation such as configuring, reading from, writing to, and triggering the
instrument. Instrument drivers simplify instrument control by eliminating
the need to learn the programming protocol for the instrument.
The NI ELVIS instrument driver is a collection of LabVIEW VIs that
provides an API for controlling the NI ELVIS hardware. The API allows
the user to connect VIs in a logical manner to control the hardware
functionality of the NI ELVIS Benchtop Workstation—the variable power
supplies, function generator, DMM, and DIO circuitry.
The general programming flow when using the NI ELVIS instrument
driver is Initialization - Action - Close. The initialization VIs establish
communication with the NI ELVIS Benchtop Workstation and configure
the selected components to a defined state. A reference (refnum) to the
specific component is generated and then used by subsequent VIs to
perform the desired actions.
The instrument driver handles the resource sharing that occurs between the
components of the NI ELVIS. For example, the DMM uses the function
generator for its measurements. Without resource management, if an
application using the function generator is running, when a DMM
application runs, one or both applications might return incorrect results. To
prevent this problem, if the driver detects that a resource is in use, an error
is returned. Resource management is valid within one LabVIEW process
only. Therefore, if an application (executable) built using the NI ELVIS
instrument driver is running at the same time as another application using
NI ELVIS User Manual
4-4
ni.com