Hi,
I'm hoping someone on these forums can help with this.
I'm looking for a very simple example VI that uses VB6 to read a USB-9215, (one channel). I am trying to build off of a C example (as per a knowledgebase link) and I'm having difficulties getting it going. (I am stuck with VB6 for this application, but I need to use the 9215).
I am trying to scan 40000 readings at 40000 samples per second, and get the data into VB. I only need one channel and the signal is around 5 volts. I am confused about how to pass the array to the function, how to verify any errors.
Here's all I have so far. Not sure if this should work:
Call DAQmxCreateTask("", DaqTaskHandle)
Call DAQmxCreateAIVoltageChan(DaqTaskHandle, "dev1/ai0", "", DAQmx_Val_InputTermCfg_Diff, -10, 10, DAQmx_Val_VoltageUnits2_Volts, "")
Call DAQmxCfgSampClkTiming(DaqTaskHandle, "", 40000, DAQmx_Val_Rising, DAQmx_Val_AcquisitionType_FiniteSamps, 40000)
Call DAQmxStartTask(DaqTaskHandle)
Call DAQmxReadAnalogF64(DaqTaskHandle, 40000, 5, DAQmx_Val_GroupByChannel, (LiveData2(0)), 40000, 40000, "")
Call DAQmxStopTask(DaqTaskHandle)
Call DAQmxClearTask(DaqTaskHandle)
DaqTaskHandle is defined as a long
LiveData2 is defined as an array of 40000 ?? (LiveData2(40000) as Double)
I see no errors but it doesn't work.
Any help is greatly appreciated as I am stuck trying to understand how to properly configure, start, and stop a task, and get the data into an array.
Thanks for any help you can offer.
Jeff