Jump to content

JohnT

Members
  • Posts

    1
  • Joined

  • Last visited

JohnT's Achievements

Newbie

Newbie (1/4)

0

Reputation

  1. I am trying to replicate an older device that uses the USB-2537 DAQ board. The device I am working on was designed in 2007 and replicated once in 2019. We are using software written in Visual Basic 6 to control the DAQ. We are running into an issue trying to use the cbDaqOutScan function. In hardware, Signal A is mapped to XDAC0 and Signal B is mapped to XDAC1. Channel numbers 0 and 1 are used accordingly with cbAOut to set static voltages on both successfully in other places in the code. In this specific section, we are trying to keep Signal A at 0V while Signal B is applied immediately using cbDaqOutScan. Interestingly, OutChanArray appears to be reversed from what I would expect ( [1, 0] instead of [0, 1] ). ReDim Wvfm(500) For x = 0 To 261 Step 2 Wvfm(x) = 32767 ' zero until 26.2ms Wvfm(x + 1) = intBvoltage Next x For x = 262 To UBound(Wvfm) - 1 Step 2 Wvfm(x) = intAvoltage Wvfm(x + 1) = intBvoltage Next x Wvfm(UBound(Wvfm) - 1) = 32767 ' force last sample to zero volts Wvfm(UBound(Wvfm) - 2) = 32767 ' force last sample to zero volts OutMemHandle = cbWinBufAlloc(500) DAQerr = cbWinArrayToBuf(Wvfm(0), OutMemHandle, 0, 500) ReDim OutChanArray(0 To 1) As Integer OutChanArray(0) = 1 OutChanArray(1) = 0 DAQerr = cbDaqOutScan(0, OutChanArray(0), ANALOG, BIP10VOLTS, 2, 5000, 500, OutMemHandle, BACKGROUND + NONSTREAMEDIO) Do DAQerr = cbGetStatus(0, DAQstatus, CurCount, CurIndex, DAQIFUNCTION) DoEvents Loop Until (DAQstatus = IDLE) Or (frmMain.tmrWait.Enabled = False) On the old devices, the A and B outputs are driven out as desired (A at 0V for 26.2ms, then goes high, B high immediately). On the new device, I see the A and B waveforms being reversed (A high immediately, B at 0V for 26.2ms then goes high). Based on the assumption that cbDaqOutScan reads the interleaved output buffer in the order of the provided channel array, the new device result seems logical. I do not understand why the results are different between the old and new devices. I am wondering if there has been a firmware update at some point for the USB-2537 boards that I am not able to find, or maybe the universal library has changed since we last replicated this device? Is there some setting on the PC or in Instacal that could cause the DAQ to read the output buffer incorrectly (shifted by 1 position maybe)?
×
×
  • Create New...