Multifunction DAQ

Showing results for 
Search instead for 
Did you mean: 

DAQmx Error -50150 using the fonction DAQmxCreateTask



Currently, I use Scientific Linux 5.11 with the kernel 2.6.18-398.el5 to be able to use the driver NI-DAQmx 8.0.2 on linux.

I succesfully installed the driver and now I want to use it for a program in C.

So I took this example code to start programming but I have this error when using the fonction DAQmxCreateTask :


"DAQmx Error: NI Platform Services:  The software has entered an unknown state - usually as a result of a cascade failure induced by an unexpected series of state inputs. The operation could not be completed as specified and you should immediately terminate all further transactions if you are able to do so.
Task Name:

Status Code: -50150"


Example code : (found in


#include <stdio.h>
#include <stdlib.h>
#include <NIDAQmx.h>

#define DAQmxErrChk(functionCall) if( DAQmxFailed(error=(functionCall)) ) goto Error; else

int main(void)


       int32       error=0;

       TaskHandle  taskHandle=0;

       int32       read;

       float64     data[1000];

       char        errBuff[2048]={'\0'};

// DAQmx analog voltage channel and timing parameters

      DAQmxErrChk (DAQmxCreateTask("", &taskHandle));

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

    DAQmxErrChk(DAQmxCfgSampClkTiming(taskHandle, "", 10000.0, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, 1000));

// DAQmx Start Code


// DAQmx Read Code

     DAQmxErrChk(DAQmxReadAnalogF64(taskHandle, 1000, 10.0, DAQmx_Val_GroupByChannel, data, 1000, &read, NULL));

// Stop and clear task*/


       if( DAQmxFailed(error) )


       if( taskHandle!=0 )  {




       if( DAQmxFailed(error) )

              printf("DAQmx Error: %s\n",errBuff);

              return 0;




Thanks in advance.

0 Kudos
Message 1 of 2

Hello Vanessa26,


First I want to remind you the process that lead to a perfect installation (it is for ubuntu but it also apply for

scientific linux) please check that you did every step.


Second please upgrade your scientic kernel for something like : Scientific Linux 6.x (x86/x86_64) and then download the last version of daqmx compatible 

with Scientific Linux 6.x (x86/x86_64) : and apply the installation tutorial mentioned above.

Why upgrading ? because it is best pratice to have alway the best software configuration, less error, more reliable...


Best regards,




0 Kudos
Message 2 of 2