LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

does 'wait' in subvi affect calling vi

 
0 Kudos
Message 1 of 7
(3,273 Views)

Do you mean "Wait (ms)"?

 

Well, it might, but usually not adversely.

 

When the calling VI (main) executes a sub-vi that has a Wait(ms), it may wait until the sub-vi completes its execution before continuing.  I wrote may because that is probably what you are seeing.  

 

Can you describe your problem?

0 Kudos
Message 2 of 7
(3,268 Views)

Hi okarthiko,

 

don't you think the message body is useful to give more information? Or to form a more precise question?

And wth: you can even attach VIs or include pictures in the message Smiley Wink

 

Well, the mainVI has to wait until the subVI is finished - that's the dataflow principle of LabVIEW.

So I would say "Yes, wait in subVI affects mainVI"...

Message Edited by GerdW on 05-05-2010 09:40 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 7
(3,265 Views)

You've seemed to have hit the Post button before you had a chance to type any kind of message.

 

What do you think the answer is?  Without seeing some example code, we have no way of knowing.  Is the subVI running in parallel with other code, or is it putting out any output data that part of your main VI is waiting on?

0 Kudos
Message 4 of 7
(3,264 Views)

Hi okarthiko,

it denpends on how you call it. If it blocks the data flow, then yes, if not then maybe in some cases.

 

Mike

0 Kudos
Message 5 of 7
(3,263 Views)

I apologise, I did hit the 'post' button prematurelyt. I was planning to test it myself before asking the question. 

I did mean wait (ms). I wanted to delay the subvi from operating for 't' seconds but want the calling vi to continue with all dataflows parallel to that subvi. In other words I am looking for the equivalent of a delay unit. I think what I need is the 'time delay' vi. I dont want all the flows in the calling vi to wait as well when the delay is activated. 

 

Also if i had two wires carrying data (say to an 'add' operator) how do I delay one of the wire values by a specified amount of time?

 

Thanks everyone

ps: am a labview noob 

0 Kudos
Message 6 of 7
(3,240 Views)

Any wait statement for Time Delay VI will only affect the parts of the code that are in the path of the dataflow.  So the subVI will wait, along with any part of your main VI that is waiting for the subVI to finish.  Any wires or functions that are in parallel to that subVI won't be affected.

 

If you want to force some part of the code to wait for whatever reason, such as one of the two wires to the add function, use a flat sequence structure and put the wait statement inside of that.  Any part of your code that you want to put a wait on, wire those wires through the flat sequence structure as well.  The flat sequence structure won't/can't return any data until all the code inside of it is complete, which means the wait statement has completed.

0 Kudos
Message 7 of 7
(3,233 Views)