取消
顯示結果 
搜尋替代 
您的意思是: 

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 積分
1 條訊息(共 25 條)
3,800 檢視

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 積分
2 條訊息(共 25 條)
3,793 檢視

Thanks Soham,

 

The program is attached in 2009 now.

 

Could you please explain a bit how to do this?

 

Cheers,

 

Saif

0 積分
3 條訊息(共 25 條)
3,786 檢視

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 積分
4 條訊息(共 25 條)
3,782 檢視

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 積分
5 條訊息(共 25 條)
3,781 檢視

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 積分
6 條訊息(共 25 條)
3,770 檢視

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 積分
7 條訊息(共 25 條)
3,759 檢視

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 積分
8 條訊息(共 25 條)
3,756 檢視

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 積分
9 條訊息(共 25 條)
3,710 檢視

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 積分
10 條訊息(共 25 條)
3,704 檢視