LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate PWM using 6008 without causing Delay

 
The PWM signal is created by sending HIGH and LOW values by using for loop. By doing this, it caused delay(if i am not mistaken) to generate the high and low values when i wish to get an input signal from analog.(Before i add in the PWM code, there is no delay in getting input value).
 
Is it possible to eliminate this delay or is there any other way to create PWM signal using 6008.
 
I do appreciate ur time for reading and helps. Thanks a lot. 
 
 
0 Kudos
Message 1 of 3
(2,874 Views)
LabVIEW uses dataflow to determine which part of the diagram executes next. The outer while loop will execute the Cont sample VI once and then start the inner while loop. The for loop will run until all the data has been written to the digital line. The Trigger and Gate2 VI will execute (maybe before the for loop). If a data point was available, the inner loop will continue by executing the for loop again with the same data. The time for the execution of the inner while loop depends largely on the size of the data arrays. If the boolean data to the for loop has 100 points, each iteration will take a tenth of a second. If there are 20 valid triggers in the waveform data, it will be more than 2 seconds before the next iteration of the outer loop.

The 6008 is a rather slow device and is generally not suitable for PWM work. If your requirements are tolerant enough of the slow speeds, then you will want to modify your program for parallel operation of the analog input and the digital outputs. This means that each part will be in a loop of its own without data dependency between the loops.

Lynn
0 Kudos
Message 2 of 3
(2,854 Views)
Thanks for your infrmation and i did some correction to the VI, but i was able to find a better way, which did not cause much delay but able to perform PWM function using analog output.
 
Thanks alot for ur time and help.
0 Kudos
Message 3 of 3
(2,816 Views)