12-06-2011 06:37 AM
Hi all,
I made the attached program to use the rotary encoder to USB6211 ctr0.
It works well after executing the finite number of for-loops and it shows the rotation angle in real time.
However, if I interrupted the execution (for-loop) by pressing CTRL+C, the system crashed and the blue screen appeared with the following message.
STOP 0x00000050 (0XAF7B1AF4, 0x ....)
nimxdfk.dll
PAGE_FAULT_IN_NO_PAGED_AREA
..
..
..
nimxdfk.dll
Adress DB3C96F0F base at B3C7C000,
Datestamp 4e0e2d19...
Is it the bug of daqmx?
I'm using
Windows XP SP3
Visual C++ 2010
NI-DAQmx Device Driver 9.4.0f1
DAQmx ver 5.0
Thank you for your help...
----
#define DAQmxErrChk(functionCall) if( DAQmxFailed(error=(functionCall)) ) goto Error; else
void testencoder()
{
int error=0;
TaskHandle taskHandle=0;
int32 read;
float64 data[1000];
char errBuff[2048]={'\0'};
int ix;
/*********************************************/
// DAQmx Configure Code
/*********************************************/
DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxCreateCIAngEncoderChan(taskHandle,"Dev3/ctr0","",DAQmx_Val_X4,0,0.0,
DAQmx_Val_AHighBHigh,DAQmx_Val_Degrees,24,0.0,""));
//DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"/Dev1/PFI9",1000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));
/*********************************************/
// DAQmx Start Code
/*********************************************/
DAQmxErrChk (DAQmxStartTask(taskHandle));
printf("Continuously reading. Press Ctrl+C to interrupt\n");
for( ix=0;ix<1000;ix++) {
/*********************************************/
// DAQmx Read Code
/*********************************************/
DAQmxErrChk (DAQmxReadCounterScalarF64(taskHandle,10.0,data, NULL));
printf("data %f \n", data[0]);
}
Error:
if( DAQmxFailed(error) )
DAQmxGetExtendedErrorInfo(errBuff,2048);
if( taskHandle!=0 ) {
DAQmxStopTask(taskHandle);
DAQmxClearTask(taskHandle);
}
if( DAQmxFailed(error) )
printf("DAQmx Error: %s\n",errBuff);
printf("End of program, press Enter key to quit\n");
getchar();
return ;
}
Solved! Go to Solution.
12-06-2011 08:29 AM
Hi ytaku,
I was able to reproduce this issue locally here at National Instruments, and I filed CAR 327912 to R&D to do further investigation. I'll let you know if we come up any workarounds or further information.
Is this issue holding you back or anything?
Sorry for the inconvenience!
12-06-2011 09:15 AM
Hello once again,
After some investigation this appears to be the same problem that was identified in this post: http://forums.ni.com/t5/Multifunction-DAQ/Re-nimxdfk-dll-causes-blue-screen/td-p/1752434. BradK, another R&D developer, identified some potential workarounds. After deploying one of the workarounds mentioned ("net start nicdcck" in an Administrator command prompt) I wasn't able to reproduce the issue after a handful of attempts.
I hope this helps!
12-06-2011 06:42 PM
Hello Zach,
Thank you for your reply.
I tried "net start nicdcck" and it worked well. I mean, my program does not crash the system.
Thank you very much!!