National Instruments 321645c-01 Welding System User Manual


 
Chapter 2 Function Reference SCXI_Cal_Constants
©
National Instruments Corporation 2-327 NI-DAQ FRM for PC Compatibles
4. Ground your SCXI input channel. If you are using an SCXI-1100, SCXI-1122, or
SCXI-1141, you can use the
SCXI_Calibrate_Setup function to internally ground the
module amplifier inputs. For other analog input modules, you need to wire the positive
and negative channel inputs together at the terminal block.
5. Take several readings using the
DAQ functions and average them for greater accuracy.
You should use the DAQ device gain/range settings you will be using in your application.
If you are using an AT-MIO-16F-5, AT-MIO-64F-5, or AT-MIO-16X, you can enable
dither using the
MIO_Config function to make your averaging more accurate. You
should average over an integral number of 60 Hz or 50 Hz power line cycles to eliminate
line noise.
You now have your first input value/binary pair: scaled1 = 0.0, and binary1 is your
binary reading or binary average.
6. Now apply a known, stable, non-zero input value to your input channel at the terminal
block. Preferably, your input value should be close to the upper limit of your input range
for the given gain setting.
7. Take another binary reading or average. If your binary reading is the maximum binary
reading for your DAQ device, you should try a smaller input value. This is your second
input value/binary pair: scaled2 and binary2.
8. Call
SCXI_Cal_Constants with your two input value/binary pairs and opCode = 2.
Make sure you pass the correct SCXIgain you used and pass the gain code you used in
AI_Read or DAQ_Op in the DAQgain parameter.
If you are using an SCXI-1122, SCXI-1126, or SCXI-1141, you can save the constants
in the module EEPROM (calibrationArea = 1 or 3). Refer to the EEPROM
Organization section later in this function for information about constants in the
EEPROM. It is best to use calibrationArea = 3 (user EEPROM area) as you are
calibrating, and then call
SCXI_Cal_Constants again at the end of your calibration
sequence with opCode = 4 to copy your EEPROM area to the default EEPROM load
area. That way there will be two copies of your new constants, and you can revert to the
factory constants using opCode = 4 without wiping out your new constants entirely.
For other analog input modules, you must specify calibrationArea = 0 (NI-DAQ
memory). Unfortunately, calibration constants stored in NI-DAQ memory will be lost at
the end of the current NI-DAQ session. You might want to create a file and save the
constants returned in calConst1 and calConst2 so that you can load them again in
subsequent application runs using
SCXI_Cal_Constants with opCode = 3.
Any subsequent calls to
SCXI_Scale for the given module, channel, and gain setting will use
the new calibration constants when scaling. You can repeat steps 2 through 8 for any other
channel or gain settings you want to calibrate.
You can use a different input value for the first measurement instead of grounding the input
channel. For instance, if you know you will be using a specific input value range, you might