i'd like to generate a pwm signal (frequency=50khz) with digilent discovery interfaced with labview. I uploaded the code.
I started from the example found online (getting started with digilent discovery:Mso and function generator). The program should do something like this: read a file (txt) which consists in a single columm of numbers that describe the duty cycle (0 is 0%, 3645 in 100%). This operation is perfomed by using the "Read delimited spreasheet". SIngle numbers are extracted with a for loop and converted in a percentual value. The result is send to the "Basic Waveform block".
The problem is this: the program does not work fine because I obtain a waveform with a fixed low duty cycle (it should increase, reach a max value and then decrease). Moreover i need to click "run Continuosly" which is not the way it should work.
how can i solve this problem? i was thinking about a while loop but i have no idea where i have to put it.
Thanks in advance.
I added some files (code and txt document with the value of the duty cycle).
(the output waveform is readed with an external oscilloscope).dutycycle.txt
Question
LLuca93
Hi,
i'd like to generate a pwm signal (frequency=50khz) with digilent discovery interfaced with labview. I uploaded the code.
I started from the example found online (getting started with digilent discovery:Mso and function generator). The program should do something like this: read a file (txt) which consists in a single columm of numbers that describe the duty cycle (0 is 0%, 3645 in 100%). This operation is perfomed by using the "Read delimited spreasheet". SIngle numbers are extracted with a for loop and converted in a percentual value. The result is send to the "Basic Waveform block".
The problem is this: the program does not work fine because I obtain a waveform with a fixed low duty cycle (it should increase, reach a max value and then decrease). Moreover i need to click "run Continuosly" which is not the way it should work.
how can i solve this problem? i was thinking about a while loop but i have no idea where i have to put it.
Thanks in advance.
I added some files (code and txt document with the value of the duty cycle).
(the output waveform is readed with an external oscilloscope).dutycycle.txt
creodutyvar.vi
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.