Real-Time Measurement and Control

Showing results for 
Search instead for 
Did you mean: 

NI-DAQ on Ubuntu 18.04

I have a NIDAQ 6221 board and I am trying to install NI drivers on my ubuntu 18.04 system. I am trying to install as per the website here:


The installation has completed with no error. I am trying to run the following script:


#include <stdio.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;


I can make the file successfully. But while running the script, it is throwing out the following error. failed to initialize
Verify that nipalk.ko is built and loaded.
Aborted (core dumped)


It will be a great help if anyone can guide me on what to do. Thanks!



0 Kudos
Message 1 of 2

I am using NIDAQ-6211. Sorry for the mistake. 

0 Kudos
Message 2 of 2