Jump to content
  • 0

Custom designed Signal with Analog Discovery


Barroth

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!

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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"...

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...