Jump to content

alpanth

Members
  • Posts

    10
  • Joined

  • Last visited

alpanth's Achievements

Member

Member (2/4)

1

Reputation

  1. Hi @attila, right so in case of the ADP3450 there are only two ranges (~2V and ~50V), so two possible return values from the "FDwfAnalogInChannelRangeGet"? Meaning there is no actual difference in setting a range of 5 or 50 V?
  2. Similar problem with "FDwfAnalogInChannelRangeSet" and Get. I used the provided "analogin_acquisition.cpp" example and just called "FDwfAnalogInChannelRangeGet" after the Wait(2) to check if the range on channel 0 is actually set to 5 V. But the range I get back is always 54.49315154 V. Below part of the example with the get method added. // enable channels for(int c = 0; c < cChannel; c++){ FDwfAnalogInChannelEnableSet(hdwf, c, true); } // set 5V pk2pk input range for all channels FDwfAnalogInChannelRangeSet(hdwf, -1, 5); // 20MHz sample rate FDwfAnalogInFrequencySet(hdwf, 20000000.0); // get the maximum buffer size FDwfAnalogInBufferSizeInfo(hdwf, NULL, &cSamples); FDwfAnalogInBufferSizeSet(hdwf, cSamples); rgdSamples = new double[cSamples]; // configure trigger FDwfAnalogInTriggerSourceSet(hdwf, trigsrcDetectorAnalogIn); FDwfAnalogInTriggerAutoTimeoutSet(hdwf, 10.0); FDwfAnalogInTriggerChannelSet(hdwf, 0); FDwfAnalogInTriggerTypeSet(hdwf, trigtypeEdge); FDwfAnalogInTriggerLevelSet(hdwf, 1.0); FDwfAnalogInTriggerConditionSet(hdwf, trigcondRisingPositive); // wait at least 2 seconds with Analog Discovery for the offset to stabilize, before the first reading after device open or offset/range change Wait(2); double range = 0; FDwfAnalogInChannelRangeGet(hdwf, 0, &range); printf("range: %f\n", range);
  3. Indeed thank you is there some indicator that i missed which would have pointed me to this? Or did I just miss it in the documentation? Because just from the API calls / checking if it was set with the get method as recommended in the doc I could not know that the sample rate is initially at max. In turn "blocking" the average filter.
  4. int st = 0; int fsfilter; st = FDwfAnalogInChannelFilterInfo(DWF.hdwf, &fsfilter); assert(st); if(IsBitSet(fsfilter, filterAverage)) { st = FDwfAnalogInChannelFilterSet(DWF.hdwf, 0, filterAverage); assert(st); FILTER filter; st = FDwfAnalogInChannelFilterGet(DWF.hdwf, 0, &filter); assert(st); assert(filter == filterAverage); } Hi, I am using ADP3450, where I am trying to set the average filter on channel 0 (first thing after opening the device). It is always failing at the last assert when comparing the filter. Where it should be set to average but it is set to normal. Is there something wrong with the code or what could be the problem here? Best regards, Alex
  5. Hello, I think I found an inconsistency in the Documentation and the source code. The Documentation says: (https://digilent.com/reference/software/waveforms/waveforms-sdk/reference-manual#trigger) The source code (dwf.h) says: Same also found for the method "FDwfAnalogInTriggerLevelInfo". I was not sure if this is the right place to post this, please let me know otherwise. I guess its a typo in the Manual since nSteps in other functions are also double. Best regards, Alex
  6. Thank you, exactly what i was looking for!
  7. Hello, I am quite new to the WaveformSDK and I am building an Application in C which uses the library to do measurements with an ADP3450. Now for the AnalogIn (Oscilloscope) module I kind of expected some measurement API. In the Waveforms GUI you can add measurements for each channel see attachment. But I can not find anything similar in the SDK, so I guess you would have to do this through sampling the signal and do some further processing to get those measurements. Is this the correct approach? If so is there a package which one can recommend to implement such methods for those measurements, since it is already done in the GUI? Best regards, Alex
  8. Thanks everyone for the fast responses and clarification! Yeah it makes sense now. I guess I was too focused on the code, maybe a small comment would be indeed helpfull. Thanks again :)
  9. Hello, first time working with the WaveformSDK and when looking at the DwfState's I saw something weird. DwfStateTriggered and DwfStateRunning is set to same value 3. Is there a reason for that? It seems like the number 6 is missing. If it is a typo I would like to know which state should be 6. From dwf.h with /************************************************************************/ /* Revision History: */ /* */ /* 06/6/2009(KovacsLA) : Created */ /* */ /************************************************************************/ Starting at line 104: // instrument states: typedef unsigned char DwfState; const DwfState DwfStateReady = 0; const DwfState DwfStateConfig = 4; const DwfState DwfStatePrefill = 5; const DwfState DwfStateArmed = 1; const DwfState DwfStateWait = 7; const DwfState DwfStateTriggered = 3; const DwfState DwfStateRunning = 3; const DwfState DwfStateDone = 2;
×
×
  • Create New...