Table of contents |
BYTE dscVoltageToADCode(DSCB board, DSCADSETTINGS adsettings, DFLOAT voltage, DSCADSAMPLE *adsample);
Name | Description |
---|---|
board | The board handle |
adsettings | AD settings to be used in unit conversion |
voltage | The voltage to be converted |
adsample | Pointer to the variable that will hold the converted units |
Error code or 0.
ERRPARAMS errparams; DSCADSETTINGS adsettings; DSCB dscb; DSCADSAMPLE adsample; DFLOAT voltage; BYTE result; /* Board initialization code omitted */ voltage = 2.0; if ((result = dscVoltageToADCode(dscb, adsettings, voltage, &adsample)) != DE_NONE) { dscGetLastError(&errparams); fprintf(stderr, "dscVoltageToADCode failed: %s (%s)\n", dscGetErrorString(result), errparams.errstring); return result; } printf("Voltage: %5.3lfV, AD code: %d\n", voltage, adsample);
This page was last modified 22:14, 30 Jun 2004.
Copyright (c) 2004 Diamond Systems. All Rights Reserved.