LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

threading - ni6515

Is it possible to call DAQmxWriteDigitalLines  in different threads for different lines? or will every call have to be thread locked?

 

DAQmxCreateTask ("", &DOCARD); 

 

DAQmxCreateDOChan (DOCARD, text, "",DAQmx_Val_ChanPerLine);

 

DAQmxStartTask(DOCARD);

 

DAQmxWriteDigitalLines (DOCARD, 1, 1, 10,
                                          DAQmx_Val_GroupByScanNumber,
                                          &DOArray[0],

 

 DAQmxStopTask(DOCARD)  ;
 DAQmxClearTask(DOCARD)  

top ebony live sex cams: EbonySexCam | LiveEbonyCam | EbonyCam
0 Kudos
Message 1 of 2
(1,008 Views)

Hi,

I believe DAQmx library is already multi-thread safe.

But the code snippet you provided does not look optimal. Do not create/clear tasks too often.
I usually create once at the beginning of my application and clear when exiting. That works for most of the projects.

Even Start/stop is not required too often.

 

So, create your tasks during initalization. Start when test/process starts and then read/write when required in whichever thread.

does not that scenario work for you?

S. Eren BALCI
IMESTEK
0 Kudos
Message 2 of 2
(972 Views)