Jump to content
  • 0

Custom protocol analyzer from waveforms SDK


shabbirahmed

Question

Hi all

tagging some experts @jpeyron @attila

Thank you for all the help in previous questions!

From what I have gathered up till now is that I cannot access the protocol analyzers since they are at the application level and are not exposed to the SDK. However in my application I need a protocol analyzer along with the analog read of the AD2 simultaneously. (attaching previous post)

So my only hope is to make a custom protocol analyzer to get the logic bitstream from the digital pins along with the raw waveform data. I tried to do the same in the code snippet attached. However the program hangs at line #79 at FDwfAnalogInStatusData. And also the logic bits i have read at this point do not reflect the right logic levels. Is there something I am missing? What is the right way to get both analog and digital data from the oscilloscope?

 

EDIT: When it is not hanging at that line the digital values i have read from the digital pins are not the right value i am supposed to see (dont see the logic stream of the signal just half 1s and the other half 0s). How does it have to be setup to ready a signal with 500K - 1MHz signal levels?

Thanks in advance!

Shabbir

 

main.cxx

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Hi @shabbirahmed

I see the triggering in your C file is different as it was suggested in the Py file.

Please add the declaration of following function:
DWFAPI BOOL FDwfDigitalInMixedSet(HDWF hdwf, BOOL fEnable);

Use the following trigger; configure and status sequence:

FDwfDigitalInMixedSet(hdwf, true) // needed for v3.5.4, in the next version this will be redundant
FDwfDigitalInTriggerSourceSet(hdwf, trigsrcAnalogIn) 
FDwfAnalogInTriggerSourceSet(hdwf, ...)
....
FDwfDigitalInConfigure(hdwf, false, true);
FDwfAnalogInConfigure(hdwf, false, true);

for(){
   while(true){
      FDwfDigitalInStatus(hdwf, true, &sts); // first check digital
      if(sts != DwfStateDone) continue
      // the analog state should be also done
      // new acquisition automatically starts after this call, there is no need to configure it again

      FDwfAnalogInStatus(hdwf, true, &sts);
      break
   }
   ... process data
}

Link to comment
Share on other sites

14 hours ago, attila said:

Hi @shabbirahmed

I see the triggering in your C file is different as it was suggested in the Py file.

Please add the declaration of following function:
DWFAPI BOOL FDwfDigitalInMixedSet(HDWF hdwf, BOOL fEnable);

Use the following trigger; configure and status sequence:

FDwfDigitalInMixedSet(hdwf, true) // needed for v3.5.4, in the next version this will be redundant
FDwfDigitalInTriggerSourceSet(hdwf, trigsrcAnalogIn) 
FDwfAnalogInTriggerSourceSet(hdwf, ...)
....
FDwfDigitalInConfigure(hdwf, false, true);
FDwfAnalogInConfigure(hdwf, false, true);

for(){
   while(true){
      FDwfDigitalInStatus(hdwf, true, &sts); // first check digital
      if(sts != DwfStateDone) continue
      // the analog state should be also done
      // new acquisition automatically starts after this call, there is no need to configure it again

      FDwfAnalogInStatus(hdwf, true, &sts);
      break
   }
   ... process data
}

thanks @attila

Indeed that fixed the issue. Another comment for someone trying to do the same thing is to configure the digital trigger position as well so you can see the digital captures in the buffer because the analog buffer position is independent of the digital one.

 

Thanks,

Shabbir

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...