Question (1):
SG04 does work in DAQmax Explorer. However, following show all data as 0.00000, how to display correct data?
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();
}
Question (2)
Suppose sampling rate is 1000 samples per second, number of 1024x2 data acquired every time, SG04 has two channels (0,1), how to let chan0 and chan1 get the data at the same time, i.e., DataChan0[i] and DataChan1[i] acquire data at the same time? What is their relationship with data[i] as defined above?