NI Home > Community > NI Discussion Forums

Multifunction DAQ

Showing results for 
Search instead for 
Do you mean 
Reply
Member
tudmuis
Posts: 4
0 Kudos

nidaqmxStartTask call finite samples

I'm running a project with ansi-c under linux.

 

I created a task, 16 diff voltage channels and 2 samples per/channel. samplerate=8kHz so my conversionrate=240kHz. Just within the limits of the PCI-6229.

Now when i want to read the data i use daqmxreadBinaryI16.

 

The question is; Do i have to start the daqmxstartTask before every read because it is a finite amount of data?

And second can i gain a performance boost if i adapt the inputbuffer? Now i clock my function on 256 useconds.

 

Andries

 

 

Active Participant
Hossein128
Posts: 342
0 Kudos

Re: nidaqmxStartTask call finite samples

Hello,

 

First I will thank you to contact with National Instrument.

I hope that you can use the examples which are in the Example Finder (see screenshot). There you can find that if you have a finite amount of data it is better to start the task and then read. For your second question I need more info what you exactly wants to do.

 

Hope hear from yo very soon.

 

Regards,

 

Member
Steven_K.
Posts: 138
0 Kudos

Re: nidaqmxStartTask call finite samples

Hi tudmuis,

 

It sounds like you are using DAQmx 8.0.x for Linux. To answer your first question, no, DAQmxStartTask is not needed. DAQmxRead will implicitly start the task if it is not already running. If you set the "number of samples per channel" for DAQmxRead to be the number of samples for your finite task, every time you execute the DAQmxRead your task will run once.

 

You can improve performace by setting the task state to commit right after all the task configuration is done, but before doing the first DAQmxStartTask or DAQmxRead call. By doing this, much of the hardware configuration pushed to the hardware so that it does not need to be done every time DAQmxStartTask or DAQmxRead is called. You can set this by using this function definition:

 

 

taskcontrol.PNG

 

 

Steven K.
National Instruments
DAQ Software Engineer