Hi all,
I'm currenly using a new PCI-MIO-16E-1 board , with the most recent driver. I am programming using VC++ in Window NT environment.
However, when I implement the "DOonePORT.c" example program using "NIDAQdelay" in a for loop, the program functions for a while but stops functioning in the middle of the process. The coding works well if I used a software implement delay "Sleep" but that's not imprecise when it gets into milliseconds.
Any ideas why NIDAQdelay not work?
The C code in included as follows:
i16 iStatus = 0;
i16 iRetVal = 0;
i16 iDevice = 1;
i16 iPort = 0;
i16 iMode = 0;
i16 iDir = 1;
i32 iPattern = 0;
i32 iNumLoops = 16;
i16 iIgnoreWarning
= 0;
i16 iYieldON = 1;
/* Configure port as output, no handshaking. */
iStatus = DIG_Prt_Config(iDevice, iPort, iMode, iDir);
iRetVal = NIDAQErrorHandler(iStatus, "DIG_Prt_Config",
iIgnoreWarning);
while ((iPattern < iNumLoops) && (iStatus == 0)) {
iStatus = DIG_Out_Prt(iDevice, iPort, iPattern);
iRetVal = NIDAQErrorHandler(iStatus, "DIG_Out_Prt",
iIgnoreWarning);
printf(" The digital pattern on port %d is set to (DECIMAL) %ld\n", iPort, iPattern);
iRetVal = NIDAQDelay(2);
//Sleep(1000);
++iPattern;
iRetVal = NIDAQYield(iYieldON);
}
}
Thanks in advance
Ric