DNx-MUX-414 / DNR-MUX-418 1x3 Multiplexer Board
Chapter 3
21
Programming with the Low-Level API
May 2019
www.ueidaq.com
508.921.4600
© Copyright 2019
United Electronic Industries, Inc.
3.6
Reading
Diagnostic
Voltage,
Temperature,
and Status
You can read diagnostic data for the MUX-414 / MUX-418 using the
DqAdv414ReadADC
API.
Data is returned as
DQ414ADC
data structure and includes onboard voltage
supply readings, onboard temperature readings, and status:
typedef struct {
double adc_in; // Reserved
double adc_3_3; // monitor internal 3.3V supply
double adc_2_5; // monitor internal 2.5V supply
double adc_deg_c; // adc temperature in degrees C
uint32 status; // status identical to .status
// returned by DqAdv414ReadStatus()
} DQ414ADC, *pDQ414ADC;
NOTE:
Before reading data, call
DqAdv414ReadADC(hd, devn, NULL)
once to initialize the ADC.
Example:
// startup ADC reads
DqAdv414ReadADC(hd, DEVN, NULL);
// Get voltages and temperature along with status
DqAdv414ReadADC(hd, DEVN, &adc_reads);
printf(" Internal 3.3V supply = %lf\n", adc_reads.adc_3_3);
printf(" Internal 2.5V supply = %lf\n", adc_reads.adc_2_5);
printf(" Internal temperature = %lf\n", adc_reads.adc_deg_c);
printf(" status = %x\n", adc_reads.status);
NOTE:
Refer to
DqAdv414ReadStatus
API for
status
bit meanings.