4. UD Function Reference

byte dscInit(ushort DSC_VERSION)

Initializes the Universal Driver. Must be called once at the beginning of each program.

byte dscFree() (void)

Frees the system resources used by the universal driver. Must be called once at the end of each program. This function will automatically call DscFreeBoard for all initialized boards.

byte dscInitBoard(byte DSC_DMM16RPAT, ref DSCCB dsccb, ref short board)

Initializes and sets the hardware settings of the given board. Must be called once for each board before using that board.

byte dscPCIInitBoard(byte DSC_DMM16RPAT_PCI, ref DSCCBP dsccbp, ref short board)

Initializes and sets the hardware settings of the given PCI board. Must be called once for each board before using that PCI board.

A/D Functions

byte dscADSetSettings(short board, ref DSCADSETTINGS settings)

Sets the configuration for future A/D conversions.

byte dscADSetChannel(short board, byte low_channel, byte high_channel)

Sets the channel range for future A/D conversions.

byte dscADSample(short board, ref short sample)

Performs a single A/D conversion on the currently selected channel.

byte dscADScan(short board, ref DSCADSCAN dscadscan, IntPtr sample_values)

Performs a set of A/D conversions on the selected range of channels.

D/A Functions

byte dscDAConvert(short board, byte channel, UInt32 output_code)

Performs a single D/A conversion on the given channel.

byte dscDAConvertScan(short board, ref DSCDACS dscdacs)

Performs a set of D/A conversions on multiple target channels.

DIO Functions

byte dscDIOSetConfig(short board, ref byte config)

Sets the DIO port configuration for future DIO operations.

byte dscDIOInputByte(short board, byte port, ref byte digital_value)

Receives a BYTE from a given digital input port.

byte dscDIOOutputByte(short board, byte port, byte digital_value)

Sends a BYTE to a given digital output port.

byte dscDIOInputBit(short board, byte port, byte bit, ref byte digital_value)

Receives a bit value from a given digital input port at a specified bit location (0-7).

byte dscDIOOutputBit(short board, byte port, byte bit, byte digital_val)

Sends a bit value to a given digital output port at a specified bit location (0-7).

Counter Functions

byte dscCounterSetRateSingle(short board, float hertz, UInt32 ctr)

Sets the clock rate for a specific counter or group of counters.

byte dscCounterRead(short board, ref DSCCR dsccr)

Reads the configuration for all individual counters.

Calibration Functions

byte dscSetCalMux(short board, int on)

Turns the calibration multiplexer on or off.

byte dscADAutoCal(short board, ref DSCAUTOCAL ADCALparams)

Performs an A/D auto-calibration on a selected A/D mode or on all A/D modes.

byte dscDAAutoCal(short board, ref DSCDACALPARAMS DACALparam)

Performs a D/A auto-calibration.

byte dscADCalVerify(short board, ref DSCAUTOCAL ADCALparams)

Verifies the accuracy of the A/D calibration.

byte dscDACalVerify(short board, ref DSCDACALPARAMS DACALparam)

Verifies the accuracy of the D/A calibration.

byte dscGetReferenceVoltages(short board, IntPtr refs)

Reads the reference voltages from the EEPROM.

byte dscSetReferenceVoltages(short board, IntPtr refs)

Sets the reference voltages in the EEPROM.

Error Functions

byte dscGetLastError(ref ERRPARAMS errparams)

Returns the most recent error that occurred during a Universal Driver function call.

IntPtr dscGetErrorString(byte error_code)

Returns the corresponding error string for the given error code.

Miscellaneous Functions

BYTE dscSleep (DWORD ms)

Waits for a specified number of milliseconds.

byte dscGetEEPROM(short board, UInt32 address, ref byte data)

Reads data from the EEPROM at the specified address.

byte dscInp(uint address, ref byte value)

Direct I/O read a byte from the address

byte dscADCodeToVoltage(short dscb, DSCADSETTINGS adsettings, short adcode, ref double voltage)

Unit conversion utility function for converting AD units to voltage.

byte dscLEDTest(short board, int enable)

Toggles LED on/off

Last updated