LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB 6259 100 kHz digital output

Solved!
Go to solution

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.

Download All
0 Kudos
Message 1 of 4
(1,577 Views)

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
 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 4
(1,550 Views)
Solution
Accepted by topic author Murgui

 


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

 


0 Kudos
Message 3 of 4
(1,499 Views)

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.

0 Kudos
Message 4 of 4
(1,492 Views)