From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Don't wait for input before branching

The READ POTS.vi is in a loop and takes about 15 seconds to execute, so everything that follows has to wait for it to finish, including the boolean output. I would like to hardwire the boolean to FALSE so it's initially false, but then is TRUE if the READ POTS.vi results call for it to be true. In other words I don't want the boolean output to be indeterminate while waiting for READ POTS. Is this possible?

0 Kudos
Message 1 of 9
(3,010 Views)
The default of the Boolean is false and it is not indeterminate - it's not read at all until the subVI finishes and if you have it wired to something, you will have to wait for this subVI to finish. It's called dataflow and is the basis of LabVIEW.
0 Kudos
Message 2 of 9
(3,004 Views)

Hi wb2nvy,

 

well you haven't attached ReadPots.vi... And there is no loop in your example.

 

When the boolean output results from ReadPots, then everything else has to wait for it. It's called dataflow...

 

You may use other structures like (functional) globals in seperate loops to get your desired behaviour!

 

Edited: @Dennis How does it come we both say "It's called dataflow" Smiley Wink

Message Edited by GerdW on 04-27-2009 11:09 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 9
(3,001 Views)

GerdW wrote:

...

 

Edited: @Dennis How does it come we both say "It's called dataflow" Smiley Wink

Message Edited by GerdW on 04-27-2009 11:09 PM

Great minds think alike.

Message 4 of 9
(2,994 Views)

of course-

with 15 whole seconds you could calculate both results and select the desired path when you do have a deterministic value-  you've got time-  write code that makes CLADs shutter Smiley Wink 

0 Kudos
Message 5 of 9
(2,970 Views)

I didn't realize sarcasm was such an integral part of Labview forum responses from you "great minds". DENNIS and GERD: I'm very much aware of the concept of "data flow". I've been using it quite successfully for the past 3 years. If the boolean is not read, then it's INDETERMINATE until it IS read, and therefore a problem in my program, and this is what I want to avoid.

 

GERD: I didn't attach ReadPots.vi because you don't need to see it to answer my question. Suffice that it has to finish before it sends out numeric values to be compared with the EQUAL operators.. and trust me, there IS a loop in the larger part of the vi that I didn't show. You don't need to SEE it to understand what I'm trying to accomplish. There's no point in attaching the whole main VI to illustrate a problem in a smaller part of it. JEFF: your response doesn't make sense. I have inputs which I want to override the 15 second delayed input, so my program can proceed WITHOUT having to wait 15 seconds.

 

Apparently this isn't a friendly place to get Labview help.

0 Kudos
Message 6 of 9
(2,958 Views)

Hi wb2nvy,

 

don't be angry to ask here - we will always try to give (good) answers!

 

Well, you said: "The READ POTS.vi is in a loop" and then you show an example without ReadPots and without a loop - so I had to ask for...

This is a "friendly place" for LabView help, but questions should be on the point too!

 

What is wrong with my answer? Didn't I give a suggestion? (Remember: "You may use other structures like (functional) globals in seperate loops to get your desired behaviour!")

 

You have to use seperate structures (loops or other) to achieve the desired behaviour. Functional globals serve nice here, too.

Best regards,
GerdW


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

RESET!*

 

There is one excetion to the "Dataflow paradigm".

 

If a sub-VI is set as "sub-Routine" you pick-up an option to "Skip Subroutine Call If Busy".

 

What this means is if the sub-VI in question is actually being executed in another thread, rather than waiting for the other thread to complete and stalling the current thread, the call is skipped! THe data that is returned from the skipped call is the default of the data type (defaul-default). I have used this option many times and it works great (except in onve version of LV 7 where its was hosed). I use a boolean retuned by the sub-routine that is set true when the sub-routine returns. THe caller can check if the boolean is true to determine if the sub-routine was executed.

 

 

 

 

Another method would be use a single element queue. If the queue is empty the boolean is not there yet. If the queue has something in it, it reads the  boolean state.

 

Is any of that helpful?

 

Ben

 

 

* Is should that read "Over charged"?

Message Edited by Ben on 04-28-2009 08:13 AM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 9
(2,944 Views)

Thanks Ben. You understand my question and gave me some good ideas. And without sarcasm. I'll try them.

0 Kudos
Message 9 of 9
(2,934 Views)