Jump to content

Sam S.

Members
  • Posts

    3
  • Joined

  • Last visited

Sam S.'s Achievements

Newbie

Newbie (1/4)

0

Reputation

  1. Yeah -- I've been using the single acquisition mode already. I'm trying to write a strip-chart style tool, which streams data directly from the AD2 instead of storing it in the capture buffer first. I chose 100Hz and 1000 samples as an easy consistency test, but I want to use this method to capture millions of samples further down the line. Is it possible to control the capture rate when using the record feature?
  2. Hi all, I've been working on a Network Analyzer tool (similar to the one in waveforms) for the past few weeks. My tool uses the Wavegen to output a sine wave, and measures the stimulus and response signals on the two ADC channels. Even though I think I'm configuring the AD3 as described in the reference manual, the triggering doesn't seem to be configured properly (I configured the scope to trigger on channel 0, 0V threshold, rising edge, and I've included the output below). Is there something I'm doing wrong? Also, it seems like there's internal crosstalk at ~-50-60 dB. Does the Waveforms Network Analyzer just subtract it off, or is there something else I'm missing? FDwfAnalogInReset(*pd); //Reset the Oscilloscope parameters (it won't trigger here) FDwfDeviceAutoConfigureSet(*pd, 0); //Disable AutoConfigure, meaning that we only communicate with the device once to configure it //Configure wavegen //*DEFAULT_WAVEGEN_CHANNEL is 0 for this example* FDwfAnalogOutConfigure(*pd, DEFAULT_WAVEGEN_CHANNEL, false);// stop signal generation FDwfAnalogOutNodeEnableSet(*pd, DEFAULT_WAVEGEN_CHANNEL, AnalogOutNodeCarrier, true); // set sine function FDwfAnalogOutNodeFunctionSet(*pd, DEFAULT_WAVEGEN_CHANNEL, AnalogOutNodeCarrier, funcSine); FDwfAnalogOutNodeFrequencySet(*pd, DEFAULT_WAVEGEN_CHANNEL, AnalogOutNodeCarrier, cF); //set frequency // Set RMS Amplitude FDwfAnalogOutNodeAmplitudeSet(*pd, DEFAULT_WAVEGEN_CHANNEL, AnalogOutNodeCarrier, ext->Wavegen_RMS); // Set offset FDwfAnalogOutNodeOffsetSet(*pd, DEFAULT_WAVEGEN_CHANNEL, AnalogOutNodeCarrier, ext->Wavegen_Offset); FDwfAnalogOutConfigure(*pd, DEFAULT_WAVEGEN_CHANNEL, true);// start signal generation //Configure Oscilloscope //set offset FDwfAnalogInChannelOffsetSet(*pd, ext->Feedback_Channel, ext->ADC_Offset[ext->Feedback_Channel]); //Both offsets are 0, p2p ranges are 5V //set pk2pk input range FDwfAnalogInChannelRangeSet(*pd, ext->Feedback_Channel, ext->ADC_P2P_Range[ext->Feedback_Channel]); // set offset(2) FDwfAnalogInChannelOffsetSet(*pd, ext->DUT_Response_Channel, ext->ADC_Offset[ext->DUT_Response_Channel]); //set pk2pk input range FDwfAnalogInChannelRangeSet(*pd, ext->DUT_Response_Channel, ext->ADC_P2P_Range[ext->DUT_Response_Channel]); //Enable the two oscilloscope channels FDwfAnalogInChannelEnableSet(*pd, ext->Feedback_Channel, 1);//CH1 FDwfAnalogInChannelEnableSet(*pd, ext->DUT_Response_Channel, 1);//CH0 //Verify that the requested channels are valid if (ext->DUT_Response_Channel < 0 || ext->DUT_Response_Channel >= Channels){ #if MEX==1 mexPrintf("Error in specified DUT_Response channel\n"); #else printf("Error in specified DUT_Response channel\n"); #endif exit(-1); } if (ext->Feedback_Channel < 0 || ext->Feedback_Channel >= Channels){ #if MEX==1 mexPrintf("Error in specified DUT_Response channel\n"); #else printf("Error in specified DUT_Response channel\n"); #endif exit(-1); } //Configure the trigger for the device for the zero crossing (rising edge) of the feedback channel FDwfAnalogInTriggerSourceSet(*pd, trigsrcDetectorAnalogIn); FDwfAnalogInTriggerTypeSet(*pd, trigtypeEdge); FDwfAnalogInTriggerChannelSet(*pd, ext->Feedback_Channel);//CH1 printf("SMS_DEBUGGING -- TRIGGERING ON CH %d\n",ext->Feedback_Channel); FDwfAnalogInTriggerLevelSet(*pd, 0.0); FDwfAnalogInTriggerConditionSet(*pd, trigcondRisingPositive); //FDwfAnalogInTriggerAutoTimeoutSet(hdwf, 0); //Set the ADC frequency if ((ext->Sample_Rate_Hz > minSampleFreqHz) && (ext->Sample_Rate_Hz < maxSampleFreqHz)) FDwfAnalogInFrequencySet(*pd, ext->Sample_Rate_Hz); //Set the Frequency else fprintf(stderr, "Requested Frequency outside device range \n"); FDwfAnalogInBufferSizeSet(*pd, ext->Num_Samples); //Set the Frequency //dynamic acquisition mode 4 -- SAMPLE_AV_PERIOD if (useAveraging) { int fsfilter; FDwfAnalogInChannelFilterInfo(*pd, &fsfilter); if (IsBitSet(fsfilter, filterAverage)) { FDwfAnalogInChannelFilterSet(*pd, -1, filterAverage); } (void)fsfilter; } FDwfAnalogInConfigure(*pd, true, true); //Reconfigure the analogIn device FDwfAnalogInTriggerAutoTimeoutSet(*pd, 10.0); //Set the auto-timeout to a long time (Debugging: to show that it's not auto triggering) // wait "at least 2 seconds"(testing this) for the offset to stabilize, before the first reading after device open or offset/range change Wait_S(configTime);
  3. Hi all, In the "AD3 Specifications" Document, the maximum sample buffer size is listed as 32K for two channels, or 64K for one. However, in the C SDK, FDwfAnalogInBufferSizeInfo returns 16384 as the maximum buffer size. Am I missing something? How can I capture 32K samples instead? Thanks, Sam
×
×
  • Create New...