Sets the analog input measurement sample rate.
Gx3788AnalogInScanSetSampleRate (nHandle, dSampleRate, pnStatus)
Name |
Type |
Comments |
nHandle |
SHORT |
Handle to a GX3788 board. |
dSampleRate |
DOUBLE |
Sets the sample rate of the analog in scan operation in Hz, Valid range is 1 to 75000. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
The actual sample rates possible is limited by the master clock and clock divider. This is more noticeable at higher frequencies (see table below). After calling this API, you should call Gx3788AnalogInScanGetSampleRate() API to see the actual programmed sample rate.
1 to 20,000, accuracy ± 0.5%.
20,000 to 50,000, accuracy ± 1.5%.
50,000 to 75,000, accuracy ± 3.0%.
Note: See the Gx3788AnalogInScanStart() API for a complete example code.
The following example sets the analog in scan rate to 100 Hz, and gets the analog in scan rate:
SHORT nStatus;
DOUBLE dSampleRate;
Gx3788AnalogInScanSetSampleRate (nHandle, 100, &nStatus);
Gx3788AnalogInScanGetSampleRate (nHandle, &dSampleRate, &nStatus);
Gx3788AnalogInScanGetLastRunCount, Gx3788AnalogInScanIsRunning, Gx3788AnalogInScanReadMemoryRawData, Gx3788AnalogInScanReadMemoryVoltages, Gx3788AnalogInScanSetChannelListIndex, Gx3788AnalogInScanSetCount, Gx3788AnalogInScanGetSampleRate, Gx3788AnalogInScanStart, GxFpgaGetErrorString