Jump to content
  • 0

USB-2537 Analog Output Scan Issue


JohnT

Question

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)?

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hello,

The USB-2537 firmware has remained unchanged for 10+ year or longer. I don't have records that go back far enough to know when the last occured, but I suspect it was around 2005 or 2006.

The AOutScan is easy enough to test, create an array that has one channel fixed at 16384 (-5 volts) and the other channel at 32767 (zero volts). I pick these values because Visual BASIC (VB6) uses signed integers and any number greater 32767 is treated as a negative. Check out the function named cbFromEngUnits. It takes a float or single value and returns the correct integer for analog output.

best regards,

John 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...