Jump to content
  • 0

Analog Discovery 3 software compatibility problem with Analog Discovery 2 software


Walid

Question

I have an Analog Discovery 3 that I am trying to use with some software I wrote using the Analog Discovery 2, and have downloaded the latest SDK. The program is running analog input CH1 and CH2 continuously triggering on an arbitrary waveform from W1. Everything works fine with the AD2, but when switching to the AD3, data is only read once and then AnalogInStatus always returns 1 (it should return 2 when data is ready).

nRet = FDwfAnalogInStatus(hdwf, 1, sts) 'with AD3, returns 3 first, then 2 and data can be read, then always stuck in 1 state 

The only way I have been able to get the AD3 to continuously read is to reset the AnalogOutputConfigure on every iteration in order to get it to work, as shown below, but this creates a very loud "click" on each iteration and is definitely not the correct approach:

nRet = FDwfAnalogOutConfigure(hdwf, -1, 3) 'restart analog output on CH1

which is very strange as I have set the AnalogOutput trigger to none so I expect it to be running continuously and allowing CH1 to trigger on it.

Is there any reason the behavior would be different with the AD3 than the AD2 with respect to the AnalogOutput running continuously? 

I can add detailed example code if needed.

Thanks,

Walid         

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

Hi @Walid

To fix it use FDwfAnalogInTriggerSourceSet(hdwf, trigsrcAnalogOut2) or set run time to 1.0/frequency

The reason why AnalogOut1 trigger is not working with AD3 is a bit complicated but if will be fixed in the next version.
The trigger output of AnalogOut channels is toggled when half of the buffer output is reached, based on the most significant carrier addressing bit. When providing less than half of device buffer size (default 16k for AD3) custom samples the msb won't toggle so the output trigger event (rising edge) is only generated at start.
The standard waveforms (sine, triangle) use the entire device buffer and for AD2 the custom waveforms is always stretched to the buffer size, so these generate trigger.

Thank you for the observation.

Link to comment
Share on other sites

  • 0

Thank you Attila, that worked, but a couple questions:

1. What if I want both channel 1 and channel 2 analogout waveforms to be custom and a smaller buffer size (which is my actual use case)?

2. Can you explain what you mean by "set run time to 1.0/frequency"?

Thanks,

Walid

Link to comment
Share on other sites

  • 0

Hi @Walid

1. It will be fixed in the next version by stretching the custom waveform by N (having repeated samples in the device buffer without affecting actual output) to make sure the number of samples is above buffer size / 2

2. FDwfAnalogOutRunSet(hdwf, -1, 1.0/DACFreq)
FDwfAnalogOutWaitSet(hdwf, -1, 0.0)
FDwfAnalogOutRepeatSet(hdwf, -1, 0)

image.png

Link to comment
Share on other sites

  • 0

Hi @Walid

Regarding your question in message:
The power supplies can also be used as slow AWGs controlled by analog-out functions.
For AD2 this was available in one configuration and for AD3 it is available in each configuration.
Calling with FDwfAnalogOutNodeEnableSet(hdwf, -1, ...  will apply to all 4 AWG channels (0=W1, 1=W2, 2=V+, 3=V-)
So, make sure to call enable specific for each channel if you don't want to be applied on all 4
FDwfAnalogOutNodeEnableSet(hdwf, 0=W1 and 1=W2, ...

(To be honest, I also made this mistake when writing the board test&calibration application.)

image.png

image.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...