Multifunction DAQ

Showing results for 
Search instead for 
Did you mean: 

NI DAQmx base and openGL

I'm trying to write a program that both reads a voltage and then displays this with openGL. However I have the problem that I can't get both to run at the same time.

Is it possible to set up a task using:
DAQmxErrChk (DAQmxBaseCreateTask("",&taskHandle));

Which can then be read from anywhere else in the program (maybe in the openGL loop) with:
DAQmxErrChk (DAQmxBaseReadAnalogF64(taskHandle,-1,timeout,DAQmx_Val_GroupByScanNumber,data,bufferSize,&pointsRead,NULL));

Or can the initialisation and reading only be performed in the same loop?

Any help would be much appreciated,

0 Kudos
Message 1 of 2
"anywhere else" covers a lot of territory. DAQmx Base cannot be used from multiple threads. As long as the calls are all in the same thread you should be OK.
John Weeks

WaveMetrics, Inc.
Phone (503) 620-3001
Fax (503) 620-6754
0 Kudos
Message 2 of 2