3.1 Performing an AD Conversion
Description
When you perform an A/D conversion, you are getting a digital reading of an analog voltage signal applied to one of the A/D board's analog input channels. The A/D board uses a device called an analog-to-digital (A/D) converter to convert the real-world analog signal (temperature, pressure, tank level, speed, etc.) into a digital value that the digital computer electronics can handle. This digital value can be translated back to the input voltage using the conversion formulas provided in the board's user manual.
Typically the digital value, or the underlying voltage, is then converted to engineering units, such as temperature or speed, using the appropriate conversion formula for the device or sensor that generated the original voltage signal. These conversion formulas are provided by the manufacturer of the device or sensor. Both conversions (digital to volts and volts to engineering units) can be combined into a single formula if desired. The Universal Driver function name for A/D conversions is dscADSample.
Step-By-Step Instructions
Create and initialize an A/D settings structure (DSCADSETTINGS). Call DscADSetSettings and pass it a pointer to this structure in order to setup the driver for A/D operations.
Call dscADSample and pass it a pointer to your sample variable (DSCSAMPLE) this will generate an A/D conversion and the result will be stored in your sample variable.
Example of Usage for dscADSample
Last updated