Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
LabVIEW-Measurements.pdf
Скачиваний:
61
Добавлен:
29.05.2015
Размер:
3.37 Mб
Скачать

Chapter 9 SCXI—Signal Conditioning

Two-Point Calibration

The following steps show you how to perform a two-point calibration calculation in LabVIEW. Use two-point calibration when you need to correct both the binary offset and the gain error in your SCXI module.

Note If you are using an E Series device, you should calibrate your DAQ device first using the E Series Calibrate VI.

To perform a two-point calibration calculation in LabVIEW, follow steps 1 through 5 in the previous section, One-Point Calibration, then complete the following steps.

6.Now apply a known, stable, non-zero voltage to your input channel at the terminal block. This input voltage should be close to the upper limit of your input voltage range for the given gain setting. For example, if your input voltage range is –5 to 5 V, apply an input voltage that is as close to 5 V as possible, but does not exceed 5 V.

7.Take another binary reading or average of readings. If your binary reading is the maximum binary reading for your DAQ device, try a smaller input voltage. This is your second volt/binary measurement.

8.Use the SCXI Cal Constants VI with the first volt/binary measurement from step 4 as Volt/Amp/Hz 1 and Binary 1 inputs, and the second measurement from step 7 as Volt/Amp/Hz 2 and Binary 2 inputs of the VI. Your input names may vary depending on your application setup.

9.If you are using SCXI-1102 or SCXI-1122 inputs, you can save the constants in the module user area in EEPROM. Store constants in the user area as you are calibrating, and use the SCXI Cal Constants VI again at the end of your calibration sequence to copy the calibration table in the user area to the default load area in EEPROM. Remember, constants stored in the default load area can be overwritten. If you want to use a set of constants later, keep a copy of the constants stored in the user area in EEPROM.

Note If you are storing calibration constants in the SCXI-1102 or SCXI-1122 EEPROM, your binary offset and gain adjust factors must not exceed the ranges given in the respective module user manuals.

For other analog input modules, you must store the constants in the memory. Unfortunately, calibration constants stored in the memory are lost at the end of a program session. You can solve this problem by creating a file and saving the calibration constants to this file. You can load them

LabVIEW Measurements Manual

9-40

www.ni.com

Chapter 9 SCXI—Signal Conditioning

again in subsequent application runs by passing them into the SCXI Cal Constants or the Scale Constant Tuner VIs.

Calibrating SCXI Modules for Signal Generation

When you output a voltage or current value to your SCXI analog output module, LabVIEW uses the calibration constants loaded for the given module, channel, and output range to scale the voltage or current value to the appropriate binary value to write to the output channel. By default, calibration constants for the SCXI-1124 are loaded into the memory from the EEPROM default load area.

Recalibrate your SCXI analog output module by following these steps.

1.Use the AO Single Update VI to output a binary value. If you are calibrating a voltage output range, enter 0 in the binary data input of the VI. If you are calibrating current range, enter 255 into the binary data input of the VI.

2.Measure the output voltage or current at the output channel with a voltmeter or ammeter. This is your first volt/binary measurement: Binary 1 = 0, and Volt/Amp/Hz 1 is the voltage or current you measured at the output.

3.Use the AO Single Update VI to output a binary value of 4,095.

4.Measure the output voltage or current at the output channel. This is your second volt/binary measurement: Binary 2 should be 4095 and Volt/Amp 2 is the voltage or current you measured at the output.

5.Use SCXI Cal Constants VI with the first voltage/binary measurement from step 2 as the Volt/Amp/Hz 1 and Binary 1 inputs and the second measurement from step 4 as the Volt/Amp/Hz 2 and Binary 2 inputs of the VI.

You can save the constants on the module in the user area in EEPROM. Use the user area as you are calibrating, and use the SCXI Cal Constants VI again at the end of your calibration sequence to copy the calibration table in the user area to the default load area in EEPROM. Remember, you can overwrite constants stored in the default load area. If you want to use a set of constants later, keep a copy of the constants stored in the user area in EEPROM.

Repeat the procedure above for each channel and range you want to calibrate. Subsequent analog outputs will use your new constants to scale voltage or current to the correct binary value.

© National Instruments Corporation

9-41

LabVIEW Measurements Manual

10

High-Precision Timing (Counters/Timers)

Things You Should Know about Counters

Counters add counting or high-precision timing to your DAQ system. Counters respond to and output TTL signals—square-pulse signals that are 0 V (low) or 5 V (high) in value. The following diagram shows a TTL signal.

+5 V

Signal Transitions or Edges 0 V

Although counters count only the signal transitions (edges) of a

TTL source signal, you can use this counting capability in many ways:

You can generate square TTL pulses for clock signals and triggers for other DAQ applications.

You can measure the pulse width of TTL signals.

You can measure the frequency and period of TTL signals.

You can count TTL signal transitions or elapsed time.

You can divide the frequency of TTL signals.

You can measure position using quadrature encoders.

Some of the advanced counters also allow you to make any of the above measurements successively and return the measured values in a data buffer.

© National Instruments Corporation

10-1

LabVIEW Measurements Manual

Chapter 10 High-Precision Timing (Counters/Timers)

Knowing the Parts of Your Counter

The following illustration shows a basic model of a counter.

GATE

OUT

Count Register

SOURCE (CLK)

A counter consists of a SOURCE (or CLK) input pin, a GATE input pin, an OUT output pin, and a count register. In plug-in device diagrams, these counter parts are called SOURCEn (or CLKn), GATEn, and OUTn, where n is the number of the counter.

Edges are counted at the SOURCE input. The count register can be preloaded with a count value, and the counter increments or decrements the count register for each counted edge. The count register value always reflects the current count of signal edges. Reading the count register does not change its value. You can use the GATE input to control when counting occurs in your application. You also can use a counter with no gating, allowing the software to initiate the counting operation.

The OUT pin can be toggled according to available counter programming modes to generate various TTL pulses and pulse trains.

Use the OUT signal of a counter to generate various TTL pulse waveforms. If you are incrementing the count register value, you can configure the OUT signal to either toggle signal states or pulse when the count register reaches a certain value. The highest value of a counter is called the terminal count (TC). If you are decrementing, the count register TC value is 0. If you chose to have pulsed output, the counter outputs a high pulse that is equal in time to one cycle of the counter SOURCE signal, which can be either an internal or external signal. If you chose a toggled output, the state of the output signal changes from high to low or from low to high. For more control over the length of high and low outputs, use a toggled output.

LabVIEW Measurements Manual

10-2

www.ni.com

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]