SG04 does work in DAQmax Explorer. However, following show all data as 0.00000, how to display correct data?
iStatus = DAQmxStartTask (0);
DAQmxCfgSampClkTiming (
0, //TaskHandle taskHandle,
"", //const char source[],
1000, //float64 rate,
DAQmx_Val_Rising, //int32 activeEdge,
DAQmx_Val_ContSamps, //int32 sampleMode, DAQmx_Val_FiniteSamps
1000); //uInt64 sampsPerChanToAcquire);
iStatus=DAQmxCreateAIStrainGageChan
(0, //TaskHandle taskHandle,
"SCC1Mod1/ai0", //const char hysicalChannel[],
"ai0", //const char nameToAssignToChannel[], ???
-0.001, //float64 minVal,
0.001, //float64 maxVal,
1, //int32 units,
DAQmx_Val_FullBridgeI, //int32 strainConfig,
DAQmx_Val_Internal, //int32 excitSource,
2.5, //float64 excitVal,
2.0, //float64 gageFactor,
0.0, //float64 initialBridgeVoltage,
120, //float64 nominalGageResistance,
0.285, //float64 poissonRatio,
0.0, //float64 leadWireResistance,
NULL //const char customScaleName[]
);
for (int i=0; i<1024; i++)
{
iStatus=DAQmxReadAnalogF64 (
0, //TaskHandle taskHandle,
1024, //int32 numSampsPerChan,
10000, //float64 timeout,
DAQmx_Val_GroupByScanNumber, //bool32 fillMode, ???
data, //float64 readArray[],
10000, //uInt32 arraySizeInSamps,
NULL, //int32 *sampsPerChanRead, ???
NULL //bool32 *reserved
);
sprintf(buff,"%f",data[i]);
GetDlgItem(IDC_BUFFER)->SetWindowText(buff);
GetDlgItem(IDC_BUFFER)-> UpdateWindow();
}
please send me an email to hollychen16@yahoo.ca
Thanks you for your help!