Channel selection in 4824A trouble

Post your C and C++ discussions here
Post Reply
aorlov
Newbie
Posts: 0
Joined: Thu Mar 01, 2012 9:20 pm

Channel selection in 4824A trouble

Post by aorlov »

I am trying to select one of the channels in 4824A for Block acquisition, but for some reason the selection only works "one way" , i.e. as soon as I switch from, say channel B to channel C, I cannot go back. Range (called sensitivity in the code) easily changes , but channel selection fails to go back when I try to reduce the value of selectedChannel. For example, if I try to switch back from PS4000A_CHANNEL_C to B it stays on C. I must be doing something stupid, but not sure what it can be

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);

Post Reply