05-20-2016 07:09 AM
Hi,
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 http://www.ni.com/tutorial/5409/en/)
#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
DAQmxErrChk(DAQmxStartTask(taskHandle));
// DAQmx Read Code
DAQmxErrChk(DAQmxReadAnalogF64(taskHandle, 1000, 10.0, DAQmx_Val_GroupByChannel, data, 1000, &read, NULL));
// Stop and clear task*/
Error:
if( DAQmxFailed(error) )
DAQmxGetExtendedErrorInfo(errBuff,2048);
if( taskHandle!=0 ) {
DAQmxStopTask(taskHandle);
DAQmxClearTask(taskHandle);
}
if( DAQmxFailed(error) )
printf("DAQmx Error: %s\n",errBuff);
return 0;
}
Thanks in advance.
05-23-2016 04:14 AM
Hello Vanessa26,
First I want to remind you the process that lead to a perfect installation https://decibel.ni.com/content/docs/DOC-15450 (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) : http://www.ni.com/download/ni-daqmx-base-15.0/5644/en/ 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,
Dasso