The following code attempts to output a ramp on a USB-231 or USB-234.
At times the ramp occurs... other times, there is no output from the AO channel
This is VB6 on Windows 10 using CBW32.DLL ver 6.73
lngStatus = cbDeclareRevision(CURRENTREVNUM)
lngStatus = cbErrHandling(DONTPRINT, DONTSTOP)
' intWaveformArray >> array of voltages from 0 to 2 back to 0 converted to integer
mccdevice.intBoardNum=0
mccdevice.intChannel=0
lngDownPoints=1000
lngCBRate=56
mccdevice.intRange=1
mccdevice.lngMemoryAddress = cbWinBufAlloc(lngDownPoints)
lngFirstPoint = 0
lngStatus = cbWinArrayToBuf(intWaveformArray(0), _
mccdevice.lngMemoryAddress, lngFirstPoint, lngDownPoints)
lngStatus = cbStopBackground(mccdevice.intBoardNum, AOFUNCTION)
' force to background so code can continue
intOptions = BACKGROUND
' trigger the waveform output
lngStatus = cbAOutScan(mccdevice.intBoardNum, mccdevice.intChannel, mccdevice.intChannel, _
lngDownPoints, lngCBRate, mccdevice.intRange, mccdevice.lngMemoryAddress, intOptions)
Sometimes, restarting program the sequence will work fine. This occurs on both a USB-231 and USB-234.
All statuses result in no errors but a voltage output does not occur. This module is ONLY used for AO, no
other functions are used.
As an aside, this code works fine with a PCI board.