03-05-2019 11:53 AM
Hola,
Necesito hacer un programa en LABVIEW, que genere un tren de pulsos, en el que sea yo, el que establece la frecuencia, para sacarla por la tarjeta USB 6008.
He encontrado varios ejemplos de señales PWM, en los que se controla el tiempo a nivel alto (th) y el tiempo a nivel bajo (tl), pero insisto en que necesito controlar al frecuencia en hz. El duty cycle puede ser de 0.5 constantemente.
Me pregunto si podrían orientarme para realizar este programa, o si tendría algún programa similar al que indico.
Adjunto un VI, del programa que controla el periodo (th y tl), a ver si encontrara una forma de controlar directamente la frecuencia en hz.
Muchas gracias de antemano!!
Alonso Aguado Guerrero
03-06-2019 09:23 AM
1. The USB-6008 really isn't the right device for generating digital PWM.
2. I'm on LV 2016 and can't open your code. I assume it uses software timing and digital outputs. That won't give you consistent and reliable timing on *any* device, and running over USB only makes it worse.
3. It's very easy to generate PWM based on frequency when you use a device that has "normal" full-featured counters, even if it's a USB device.
4. Maybe you should consider using some other external device like a voltage-to-frequency converter?
-Kevin P
03-11-2019 03:44 PM
Hello Kevin and thank you for the answer,
1. I know that the USB-6008 isn´t the best device to do the applicattion, but my teacher want to do with this DAQ.
2. Yes, I use software timing and digital outputs, and it seems to work correctly. I attached two images, so you can see the block diagram.
Alonso Aguado.
03-12-2019 12:37 PM
Well, as long as you have a system (and a teacher!) that isn't too demanding, the software-timed approach you showed is a good start. It's probably about as good as you can hope to do with your USB-6008. You'll have limitations on update speed, duty cycle resolution, and timing regularity, but it seems that your teacher is prepared to accept those limitations.
All you'd need to do to base your output on frequency and duty cycle is to do the following simple calculations (where duty_cycle ranges between 0.0 to 1.0):
high_time = duty_cycle / freq
low_time = (1 - duty_cycle) / freq
-Kevin P