Channel selection in 4824A trouble
Channel selection in 4824A trouble
Here is my simple code (I skip error handling if (status != PICO_OK) for clarity) :
int32_t preTriggerSamples = 1000;
int32_t postTriggerSamples = 0;
int32_t timeIndisposedMs = 0;
uint32_t segmentIndex = 0;
uint32_t startIndex = 0;
uint32_t downSampleRatio = 0;
PS4000A_RATIO_MODE ratioMode = PS4000A_RATIO_MODE_NONE;
int16_t overflow=0;
// Set up single channel with the desired configuration
status = ps4000aSetChannel(handle, selectedChannel, 1, PS4000A_DC, sensitivity, 0.0);
// Collect data
status = ps4000aRunBlock(handle, preTriggerSamples, postTriggerSamples, timebase, &timeIndisposedMs, segmentIndex, NULL, NULL);
// Wait for the capture to complete
int16_t ready = 0;
while (!ready)
{ status = ps4000aIsReady(handle, &ready); Delay(0.001); }
// Set up single buffer
status = ps4000aSetDataBuffer(handle, selectedChannel, buffer, bufferLength, segmentIndex, ratioMode);
// Get the collected data
status = ps4000aGetValues(handle, startIndex, &numSamples, downSampleRatio, ratioMode, segmentIndex, &overflow);