• 0
Barroth

Custom designed Signal with Analog Discovery

Question

Hello guys,

 

I have a problem to configure the digital output of my Analog Discovery with a custom designed/programmed signal. 

I can handle the fundtions given in Waveforms and watched the tutorials.

The plan is to generate a PWM with the device in C++. As compiler I am using CodeBlocks.

I tried to generate a sine, which is given in the samples of waveforms, but right there I am stuck. 

I included the samples.h and managed, that the dwf.h is included. 

 

In Waveforms itself I only can import .txt files. Because of that I think I have to connect with the Analog Discovery with the commands out of the "WaveForms SDK Reference Manual". 

 

After building the sample sine signal, my compiler gives me the error, that something in the dwf.h is noch correct.

 

The compiler is confused by the expression "DWFAPI" in every line in dwf.h. The error message is: "expected identifier or '(' before string constant".

 

I could not find a tutorial fiiting my problem, so I hope to find some answers or solutions right here :)

 

Thanks for help!

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Make sure to link your application with DWF library:

- Windows: C:Program Files (x86)DigilentWaveFormsSDKlibx86|x64dwf.lib C:WindowsSystem32dwf.dll

- Linux: /usr/lib/libdwf.so

 

http://stackoverflow.com/questions/5862757/how-do-i-link-to-a-library-with-codeblocks

 

PS:

The SDK contains many features/function, I recommend starting with the provided simple Python and C examples.

Share this post


Link to post
Share on other sites
  • 0

PS:

The SDK contains many features/function, I recommend starting with the provided simple Python and C examples.

 

I am trying to generate a sine as output, as it is written in the sample "analogout_sine.c"

 

It still is not working when I link the project to the dwf.lib. 

 

Do I have to use an other compiler in Codeblocks? Now it is "GNU GCC Compiler". I chose "Console application" when I opened the new project. 

 

I added the folder where the headers and libraries are located to "Search Directories" and added the dwf.lib in the "Linker Settings" in the build options.  But the compiler is saying: "cannot find -ldwf.lib"...

Share this post


Link to post
Share on other sites
  • 0

I'm not familiar with Codeblocks, but make sure to add only the library name "dwf", without .lib

For search directory use the corresponding path for your application compile architecture:

 - 32bit C:Program Files (x86)DigilentWaveFormsSDKlibx86

 - 64bit C:Program Files (x86)DigilentWaveFormsSDKlibx64

Share this post


Link to post
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