I am using an Analog Discovery 2 module and Windows 10. Up until now I have used the WaveForms GUI to control the AD2. For the current project however, I need to use the WaveForms SDK (dwf.dll version: 3.14.3) from a C/C++ application developed under Visual Studio. Basically I want to have a 200 Hz sine wave trigger the acquisition on scope channels 1+2. I have made a workspace that does exactly what I want it to do using the WaveForms GUI but so far trying to accomplish the same using the SDK and C does not work correctly. Electrically I have connected W1 to 1+ and 2+. The following screen dump shows the WaveForms GUI:
Repeatedly hitting the Record button and then exporting the data to file works fine. All data files starts at the beginning of the sine wave and have a zero crossing at the mid-point trigger position (0 ms).
The enclosed source code started it's life as a C implementation of the AnalogIn_Record_Trigger.py sample file but has since grown in the effort trying to make it work. Looking at the captured data I get larger than expected variations in where scope signals start. As seen in the screen shot the first sample of C1 and C2 should be very close to zero voltage. However, for the SDK version I the first sample of C1 and C2 varies by more that 100 ms.
If someone could shed some light on what possibly could make my code work as intended I would be very happy.
Question
eivind_k
Hi,
I am using an Analog Discovery 2 module and Windows 10. Up until now I have used the WaveForms GUI to control the AD2. For the current project however, I need to use the WaveForms SDK (dwf.dll version: 3.14.3) from a C/C++ application developed under Visual Studio. Basically I want to have a 200 Hz sine wave trigger the acquisition on scope channels 1+2. I have made a workspace that does exactly what I want it to do using the WaveForms GUI but so far trying to accomplish the same using the SDK and C does not work correctly. Electrically I have connected W1 to 1+ and 2+. The following screen dump shows the WaveForms GUI:
Repeatedly hitting the Record button and then exporting the data to file works fine. All data files starts at the beginning of the sine wave and have a zero crossing at the mid-point trigger position (0 ms).
The enclosed source code started it's life as a C implementation of the AnalogIn_Record_Trigger.py sample file but has since grown in the effort trying to make it work. Looking at the captured data I get larger than expected variations in where scope signals start. As seen in the screen shot the first sample of C1 and C2 should be very close to zero voltage. However, for the SDK version I the first sample of C1 and C2 varies by more that 100 ms.
If someone could shed some light on what possibly could make my code work as intended I would be very happy.
Best regards
Eivind
AnalogIn_Record_trigger.cpp
Link to comment
Share on other sites
8 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now