04-24-2017 01:02 PM - edited 04-24-2017 01:16 PM
Hello, I'm using a NI USB 6259 with LabVIEW 16.
I'm trying to create PWM at a fixed frequency, let's say 100 kHz. To implement this functionality, my idea is to use a timed sequence. With a timed sequence I think I will have a proper stability and reliable functionality. I'm able to perform the task I'm willing to do with NI MAX, the problem appears when I try to perform this on the .vi. This simple solution returns the error 200303 which apparently requests a clock source. The thing is I don't know where and how should I introduce this external clock. Simple scehmatic attached.
EDIT: if I add a "create timing source" I receive a 200452 error which google says is related to a buffer size problem, is that the proper way to add the required timer?
Thank you very much, any help will be appreciated.
Murgui.
Solved! Go to Solution.
04-24-2017 01:32 PM - edited 04-24-2017 01:34 PM
I will speculate that you can not do it the way you think and will have to keep the output buffer filled unless you can regenerate the signal.
Now you wrote;
@Murgui wrote:
Hello, I'm using a NI USB 6259 with LabVIEW 16.
.... I'm able to perform the task I'm willing to do with NI MAX, ...
Thank you very much, any help will be appreciated.
Murgui.
If you can make it work in MAX then save the task as a name you can recall.
Then go to a block diagram and drop a DAQmx task constant...
Select the task you saved...
Right-click and choose "Generate Configuration and Example".
LV will put together the code require to do what the DAQmx task does.
Ben
04-25-2017 04:39 AM
@Murgui wrote:
..I'm using a NI USB 6259 with LabVIEW 16.
I'm trying to create PWM at a fixed frequency, let's say 100 kHz.
Hi,
You can take the task created in MAX and generate it in LabVIEW, as previously noted.
However, here is another way to do it directly with raw code. Find below the VI.
04-25-2017 05:10 AM - edited 04-25-2017 05:11 AM
Ben,
That was an extremely helpful post, I didn't know that powerful trick.
CataM,
Your .vi is really ncie, it worked like a charm.
Thank you very much,
Nicolás.