LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Non-Blocking Counter PWM Output?

Hi all,

 

I am using two PXI-6602 cards to generate 16 PWM signals. I can sucessfully generate the signals individually via the code here: http://www.ni.com/tutorial/2991/en/

 

That particular code shows a while loop, which blocks the function. Is it possible to generate a PWM output that would be non-blocking? Ideally this would work like a digital output, open the task, set the PWM parameters and then close out of the task, all while the PWM output remains on.

 

I'm going to be using this within TestStand, using the parallel process model. Each test socket may possibly have a different PWM value. Ideally I would like to do this with each thread calling the same non-reentrant function, which gets passed the Socket Index and sets the appropriate CTR output accordingly.

 

Is this possible?

 

Thanks!

 

 

0 Kudos
Message 1 of 4
(2,832 Views)

Could you open the task in your setup, call the write function in your sequence as needed, and run the task clear in your clean up? I don't really see any inherent blocking.

0 Kudos
Message 2 of 4
(2,808 Views)

I'll give this a try in the morning when I am in the office with the hardware. I suspect this might not work due to my prior experiments.

 

I have made a single VI which only starts the task and writes freq and PWM values. This gives me a single pulse output, nothing more. It's almost as if the task starts and clears, but I have no clear function... If I add the while loop, even without the "Is task Done" VI, the output is continuous.

0 Kudos
Message 3 of 4
(2,800 Views)

Actually, that did end up working.

 

Keeping the task open within the TS context keeps the output on consistently.

 

Is there a particular reason why this doesnt work if I call the first VI by itself with no other functions? It seems as if the task gets destroyed if I run a single VI which contains a "Create Channel" and "Timing" VI. I was under the assumption that the task would exist until the "Clear Task" VI was called.

 

Thanks!

 

Andrew

0 Kudos
Message 4 of 4
(2,770 Views)