Waiting for a specific measurement, Using the library – Crystal 30 Series Digital Pressure Calibrator User Manual

Page 4

Advertising
background image

Overview

2

30 Series LabVIEW Drivers Manual

WAITING FOR A SPECIFIC MEASUREMENT

In order to store data for a specific measurement (for example, the pressure measurement of the low pressure port), there are two approaches that can be
taken: one, simply wait long enough to allow the unit to update all of the measurements within the cluster, which is typically less than 400 milliseconds; or
two, look for a value change of the cluster variable that contains the measurement.

In the first approach, simply maintain a value that specifies when the next sample is to be taken, and retrieve the data element from the cluster on those
intervals. This is the easiest approach and is typically sufficient for most applications. This is also the approach that is taken in the sample test panel provided
with the library.

With the second approach, initialize the data value within the cluster to something the unit cannot possibly report, such as -100 for the pressure reading.
When that reading changes to something other than -100, you can immediately take action on the received value. This works well when attempting to pro-
vide the quickest response time to measurement changes, or to maximize the measurement rate of the unit.

USING THE LIBRARY

The library is made up of two basic parts: the command VIs that implement the Model 30 commands such as Zero, Units, and Reset; and the data collecting
and parsing VIs that handle the reception and parsing of data packets. In addition, there is a sample

M30 Test Panel.vi that demonstrates the use of all com-

mands and the data collection components.

Note that the VISA handle must be opened by using

M30 Initialize.vi, as the serial port requires a special, non-standard setup to allow communication with

the Model 30. This handle should then be passed to all VIs. While each of the VIs also provides a VISA resource name (dup) output, it’s not required to use this
output, as the handle properties are not modified within any of the VIs. That standard LabVIEW VISA Close can be used to close the serial port.

In order to receive and parse the data,

M30 Collect Data.vi must be placed inside a loop structure, as the data is continuously streamed and therefore must be

read and parsed to populate the M30 cluster. A cluster with elements named as in the test panel (or copy of the cluster from the test panel) should be wired
into the inputs and outputs of the VI. The example test panel demonstrates the data collection process in the first three frames of the stacked sequence struc-
ture inside the main while loop.

Note that when collecting data, the Model 30 only outputs the values displayed on the LCD display. In order to receive a specific sensor’s information, either
manually select the units from the button on the front panel, or use

M30 Change Units Command.vi or M30 mA Command.vi to programmatically change the

units.

All commands can be executed asynchronously from the data collection loop.

Advertising