SCC-SG04 works normally when using DAQmax. But, in VC6...
See example in C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Analog In\Measure Strain\Cont Strain Samples, when it is run in VC6 in Windows 2000, all data are 0.000000, how to solve the problem?
int32 error=0;
TaskHandle taskHandle=0;
int32 read,totalRead=0;
float64 data[1000];
char errBuff[2048]={'\0'};
char ch;
int i;
DAQmxErrChk (Configure_StrainSamps("SCC1Mod1/ai0",-0.001,0.001,0,0.001,10.0,2.0,120.0,0.285,DAQmx_Val_FullBridgeI,0.0,0.0,DAQmx_Val_Internal,2.50,0,&taskHandle,NULL));
DAQmxErrChk (Start_StrainSamps(taskHandle));
printf("Acquiring samples continuously. Press any key to interrupt\n");
while( !_kbhit() ) {
DAQmxErrChk (Read_StrainSamps(taskHandle,data,1000,&read));
if( read>0 ) {
totalRead += read;
printf("Acquired %d samples. Total %d\r",read,totalRead);
}
}
printf("\nAcquired %d total samples.\n",totalRead);
for (i = 0; i < 1000; i++)
{
printf("data[%d]= %8.5f\n", i, data[i]);
}
ch = _getch();
Error:
if( DAQmxFailed(error) )
DAQmxGetExtendedErrorInfo(errBuff,2048);
if( taskHandle!=0 )
Stop_StrainSamps(taskHandle);
if( DAQmxFailed(error) )
printf("DAQmx Error: %s\n",errBuff);
printf("End of program, press any key to quit\n");
while( !_kbhit() ) {}
ch = _getch();
return 0;