Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxStartTask returns error 15433, DAQmxGetErrorString has no information

I am trying to convert a traditional Nidaq program to Nidaqmx in Labwindows CVI 7. I figured out how to create tasks to read data. But now the program runs much slower than it used to. 
 
My program uses a loop to read the data. I found the DAQmxStartTask, the help said that you should use this if in a loop. So I put this in before the loop, I have 28 tasks, one for each channel, this is just some of the code.
 
iStatus = DAQmxStartTask (pressure1Task);
iStatus = DAQmxStartTask (pressure2Task);
DAQmxGetErrorString (iStatus,bigstring,7999);
MessagePopup("Error",bigstring);
iStatus = DAQmxStartTask (pressure3Task);
iStatus = DAQmxStartTask (pressure4Task);
iStatus = DAQmxStartTask (pressure5Task);
iStatus = DAQmxStartTask (pressure6Task);
iStatus = DAQmxStartTask (pressure7Task);
iStatus = DAQmxStartTask (pressure8Task);
The first one returns 0 but all following return 15433. DAQmxGetErrorString cant find anything about this error number. Once in the program only data on channel 1 is returned all others are 0. If all the DAQmxStartTask code is commented out, date is read on all channels but the program is noticeably slower than when running on the old PC with traditional Nidaq.
 
0 Kudos
Message 1 of 3
(3,356 Views)
Forgot to say that I am using a PCI-6259 card, we updated to this card so now we have to use Nidaqmx.
0 Kudos
Message 2 of 3
(3,337 Views)
kmagas,

Thanks for posting to the NI Forums.  You are correct in placing a Start Task outside the loop; however, their can only be one timed analog input task on a single M-Series board running at a time.  You can actually place all 28 channels in a single task.  If you place all the channels in a single task you will also be able to read with a single read call rather than 28 different calls.  The call will return samples for all the channels.

For example you can write:

    DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai0","",DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Volts,NULL));
    DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai1","",DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Volts,NULL));

and both channel 0 and 1 will be added to the task represented by taskHandle.  This will allow both to be controlled by the same DAQmxCfgSampClkTiming call.

As far as the speed is concerned it would be helpful to have a few more details about your application: Are you doing finite or continuous acquisition?  At what rate are you looking to aquire?  How are you performing the reads?  Are you registering a callback function?

If you haven't yet you may also want to check out the CVI examples that are included with DAQmx.  These can be found in c:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C

Hopefully this is helpful in getting started.  Let me know if you need clarification or if you have additional questions. 

Regards,

Neil Stoddard
Applications Engineer
National Instruments
0 Kudos
Message 3 of 3
(3,330 Views)