02-09-2012 11:11 AM
The logic is slightly more complicated but you can do it with a timed loop. Instead of a wait, you count down loop cycles. Whenever the counter hits 0, you invert the output and reload the counter with the other timer value, alternating between the "on" time and the "off" time.
02-09-2012 11:21 AM
and what about the wire error and the counter inside de flat sequence?
02-09-2012 11:23 AM
The logic is completely different. There is no need for a sequence structure, error wire, or wait.
02-09-2012 11:24 AM
then,could i increase with it the frequency work?
02-09-2012 11:34 AM
I don't know, but it wouldn't hurt to try. I also still think you should time your current loop to see how fast it runs, as I suggested before. If you don't understand how to use a shift register, and the subtract function, then you should work through more of the LabVIEW basics first.
I do not think you will be able to generate a reliable PWM signal at 500hz in software. I don't know about 100hz, depends on the resolution of the cRIO clock. To generate a PWM at 100hz, if you want to vary the duty cycle in 1% increments, you will need a loop running at 10kHz (100hz divided by 100 clock ticks per period). You may not be able to get 100usec resolution on the cRIO.
02-09-2012 11:42 AM
ok, i will try to do it, i will ask to my teacher if i will need higher frequency work,or maybe with 50 Hz is enough.
thanks for your time