LabVIEWForum.de - generqte a PWM signal with LabVIEW using digitals outputs

LabVIEWForum.de

Normale Version: generqte a PWM signal with LabVIEW using digitals outputs
Du siehst gerade eine vereinfachte Darstellung unserer Inhalte. Normale Ansicht mit richtiger Formatierung.
Seiten: 1 2 3
I would like to generate a PWM signal (freq 50 hz Duty Cycle 10%) thanks to LabVIEW and NI-DAQ, on 5 digitals outputs in order to control 5 servomotors. Is it possible with LabVIEW, and how?
Thanks
please take yoursef the time and take a look at the examples, which are shipped with LabVIEW:

help --> find examples --> the example finder opens

click on "index" in the left tab,

type "PWM" and
open The example
"PWM-Counter Output.vi"
Thanks i2dx, but I have ever seen the examples, and they use Analog or Counter output. I have to use Digital Output, because I need to control 6 servomotors, and there are 8 Digital output, therefore it matchs. But, there is only 2 Counter et 2 Analog output, so I con't use them, unless you could give me a solution. That's the reason why, I really want to knom if it's possible to create PWM with Digital output.
thanks
yes, it is possible with digital output, too, but you have to do a lot of work "by hand" ...

take a look at my example. i hope, this will help you. be aware that the "calculate dutycycle algorithm" is a QUICK and DIRTY DRAFT. You will have to improve it, but i hope it gives you a hint, how it can work.

in my draft there are only 10 steps 0%, 10% .... 90%, 100%
you have to increase the number of steps, and the sample rate, etc ...
Thanks a lot, i2dx.
I'll try with your example, your are helpfull.
I just wonder how to change the frequence ?
frequency depends on the sample rate.

the basic calculation in my example is:

i put 100 samples in the output buffer on each loop iteration. the output sample rate is 1000 Hz. i divide the 100 samples into 10 blocks of 10 samples ==> the frequency of one block is 100 Hz or one block lasts 10ms. and the output of one loop iteration are 10 pwm-signals ...

helpfull?
yes, it is really helpful for me, but I have still some troubles, because I confess, I am not very confident with LabVIEW, and I think I am bad too.
So, I need a frequence of 50 Hz, I have changed values and it work, but I need a much better accuracy concerning the duty cycle, it means, a step of 0.1%, but I can't chose the correct values :evil: Could you help me again, pls ?
For the moment, nothing works because "Device identifier is invalid" as it's written. But my device is number 1 too. I don't know why it doesn't work but I'll continu to look for solutions.
ok, here it is.

it's up to you to understand, what's happening in there, maybe someone other will help (sorry, but i still have work to do ...)
hi i2dx, sorry to disturb you again.
Thank you again for your 50 Hz program, it's precisely what I need. But unfortunatly, it doesn't work yet. The problem comes from the link between NI-DAQmx and the PXI 6070E device. In fact, it works with the test panel, but I can't configure the VI "DAQ configuration" with LabVIEW, and when I lunch your program (or any other programs containing DAQmx VIs), the error 200220 occures. Have you ever had this kind of problem ? Isn't that a problem with software's versions ? (NI-DAQmx 3.1)
Otherwise, is it possible to create the same progam you have ever done (50Hz) but without using DAQmx VIs, just tradionnal DAQ VIs ? (I don't want you to create it, I just want to know if it's feasible in theory).
Thanks
Have a nice weekend end.
please take a look at this:

Common NI-DAQmx Error Codes and Solutions: Codes -200000 to -200299 and -50103

DAQmx 3.1 sound very old. Can you upgrade to the current version?

Download NI-DAQmx 8.0.1

please look in the Measurement and Automation Exploer, which Device# your 6070E has, i guess you have to change the device#s here:
Seiten: 1 2 3
Referenz-URLs