LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to send voltage to a device for a few seconds (1-5 s) while the main program keep running?

Hi All,

 

My VI looks something like the one I am attaching. I am acquiring pressure data using a while loop.

 

During data acquisition, I want to run a motorized pressure release valve for a few seconds (1-5 s) and then stop. But I don't want my main program (data acquisition) to stop just yet. That I will stop later through different control/logic.

 

Is this easy to do? I had found a few programs online that stopped the whole system. But I want an independent loop to run within my main loop for a few seconds.

 

Cheers,


Saif

 

 

 

 

0 Kudos
Message 1 of 25
(2,707 Views)

Can you upload the program in an older version? 2010 or older?

 

You can also use a flat sequence structure with a wait timer to send a '1' to the valve to run it for a few seconds then stop. Just a guess.

0 Kudos
Message 2 of 25
(2,700 Views)

Thanks Soham,

 

The program is attached in 2009 now.

 

Could you please explain a bit how to do this?

 

Cheers,

 

Saif

0 Kudos
Message 3 of 25
(2,693 Views)

I didn't look your vi .

 

Have another Parallel loop that has the logic to drive the valve .This parallel loop can have two states. Idle state and Active state.

 

Idle state will wait for trigger from the main loop.(using notifier)

 

Once it recieves command, from the main loop , goto the active state execute the required logic(send voltage for predefined time and resets the voltage)  and then returns to idle state again.

 

Additionally this parallel loop has to be stopped when the main program is stopped.

0 Kudos
Message 4 of 25
(2,689 Views)

Hi

 

The attached picture shows a logic that might work for you.

 

try that and let us know.

 

at this point, i am unable to think of a better logic. there are better ways to do it.

Regards
Freelance_LV
TestAutomation Consultant
0 Kudos
Message 5 of 25
(2,688 Views)

Hi Frabto & Freelance,

 

Thanks so much for your responses!

 

I tried a bit with the diagram Freelance sent. Please see attachment. I want the 0-5 s command to come from the MAIN loop. In such a case this does not seem to work. Also, I want the bottom loop to stop execution after the FIRST FIVE seconds. 

 

Frabto, as I am new to Labview, if you could please elaborate a bit on your ideas, I would be grateful.

 

Cheers,

 

Saif

0 Kudos
Message 6 of 25
(2,677 Views)

I added a flat sequence structure with a while loop inside it.  Now it should run parallel to the main program.

 

In case you want the 0-5 second signal to come from the main loop, any data in the loop will only come out of the loop once the loop has stopped executing, as far as I know.

 

Why does it have to be sent from the main loop?

0 Kudos
Message 7 of 25
(2,666 Views)

Thank you so much Soham!

 

The data has to come from the main loop because I am monitoring the system pressure in the main loop. Based on the system pressure, I want to adjust the leakage in the system through the motorized valve by operating it for a few seconds (lower loop).

 

Cheers,

 

Saif

 

 

0 Kudos
Message 8 of 25
(2,663 Views)

Okay, how about this?

A comparator compares the pressure reading with the threshold. If it is higher, the pressure release loop runs.

See attached.

0 Kudos
Message 9 of 25
(2,617 Views)

Hi

 

attached is a crude method. using queues to pass commands and data is a better approach. use two separate loops, one which reads data and decides. the other which writes data as per the command.

 

these two loops are connected using queues. you said you wanted to send the data for 1 to 5 seconds. so, change the timing inside the for loop and the loop count as per the time you want.

 

you can make a program for it too.. post back your code in lv2009 or 2010

Regards
Freelance_LV
TestAutomation Consultant
0 Kudos
Message 10 of 25
(2,611 Views)