Anthony Posted June 29, 2017 Share Posted June 29, 2017 I am writing a C# application and I want to communicate with the Analog Discovery 2 using the WaveForms SDK. Is there a way to use the SDK with C# and are there examples? Link to comment Share on other sites More sharing options...
jpeyron Posted June 29, 2017 Share Posted June 29, 2017 Hi @Anthony, The WaveForms SDK contains examples in Python and C. The examples are by default are is installed to: - Windows: C:\Program Files (x86)\Digilent\WaveFormsSDK or C:\Program Files\Digilent\WaveFormsSDK - Linux: /usr/share/digilent/waveforms/manual and samples - OS-X: /Applications/WaveForms.app/Contents/Resources/SDK As far as I can tell there is not any examples for C#. Here is a forum thread that talks about a forum member being able to use VB 6.0 with Waveforms 2015 and what they had to do to accomplish it. I believe you would need to something like this. ( @attila could you correct me if I am wrong). cheers, Jon Link to comment Share on other sites More sharing options...
attila Posted June 30, 2017 Share Posted June 30, 2017 Hi @Anthony I just created a C# wrapper for the DWF library. Add the following files to your project:dwf.csdwfPINVOKE.cs The custom applications use the WaveForms Runtime. This is by default installed with the WF installer: https://reference.digilentinc.com/waveforms3 You can find the manual in WaveForms SDK and examples in Python and C. C:\Program Files (x86)\Digilent\WaveFormsSDK\ The C# usage looks like this: int hdwf = 0; dwf.FDwfDeviceOpen(-1, ref hdwf); dwf.FDwfAnalogInConfigure(hdwf, 1, 1); while(true){ byte s = 0; dwf.FDwfAnalogInStatus(hdwf,1, ref s); if (s == dwf.DwfStateDone) break; } const int cData = 8192; double[] rgData = new double[cData]; dwf.FDwfAnalogInStatusData(hdwf, 0, rgData, cData); dwf.FDwfDeviceCloseAll(); Link to comment Share on other sites More sharing options...
Anthony Posted July 3, 2017 Author Share Posted July 3, 2017 Hi @attila Thank you for the wrapper. I'll give it a try this week. The SDK is a little confusing to me. Is the SDK able to measure frequency, rise time, and fall time using the oscilloscope? Thank you. Link to comment Share on other sites More sharing options...
attila Posted July 5, 2017 Share Posted July 5, 2017 Hi @Anthony The WaveForms SDK provide access to the low level device configuration and data acquisition. The high level data processing (measurements) are available in WaveForms application or it needs to be implemented in custom application. Link to comment Share on other sites More sharing options...
Andrei Errapart Posted October 3, 2018 Share Posted October 3, 2018 I am really sorry to interrupt you. In the process of cleaning up old hard drives I found my take on the C# interface to WaveForms SDK (from year 2014) and put it up on GitHub, https://github.com/Andrei-Errapart/WaveFormsSDK The difference is that I have taken the trouble to turn errors into exceptions, which some might dislike. Other than that it is also one-to-one mapping to the SDK. The license is MIT, which is quite permissive - many companies use libraries licensed under MIT. Link to comment Share on other sites More sharing options...
Question
Anthony
I am writing a C# application and I want to communicate with the Analog Discovery 2 using the WaveForms SDK. Is there a way to use the SDK with C# and are there examples?
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.