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: 

loop in subVI

I'm familiar with the link you mentioned.  One thing I don't like is stopping a loop with an error, like closing a queue after the producer loop, and having the consumer loop stop due to a queue error.  I don't think its wrong, I just don't like it.  Sending a command to stop is my favorite.  But what if you have multiple loops and no queues?  I've used local variables, but I've always had reservations about doing it this way.  Notifiers sound interesting for this function.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 11 of 15
(980 Views)

Thank you everybody for the interesting contributions.

 

I already wrote yesterday something that works with single-process shared variables. I was aware of the possible problem of race condition, but I think it will not affect me. Indeed, I write each variables from only one sub-VI. The order of reading is not critical neither as I measure slow variation data. By the end, the order of opening or closing each subVI is not important. Moreover, I can not link subVI for opening otherwise I will not start to measure the weight as the flowrate is not finished, hence I loos the interest of the test.

 

In the only training I had, LabView Core 1, we do not have seen the Queues and Notifiers, hence I do not have a clue how does it work, I will look it quickly.

 

Thank you all again for the ideas.

 

Regards

 

Renaud Isaac

0 Kudos
Message 12 of 15
(960 Views)

Look at the Labview Examples for queues and notifiers (Click on Help menu, then Find Examples - type Queues in search box).  You will learn something new that may be very beneficial in the future.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 13 of 15
(940 Views)

tbob wrote:

I'm familiar with the link you mentioned.  One thing I don't like is stopping a loop with an error, like closing a queue after the producer loop, and having the consumer loop stop due to a queue error.  I don't think its wrong, I just don't like it.  Sending a command to stop is my favorite.  But what if you have multiple loops and no queues?  I've used local variables, but I've always had reservations about doing it this way.  Notifiers sound interesting for this function.

 


I agree but I am leaning toward it being borderline wrong, if not wrong then[Flamesuit ON] lazy [flamesuit OFF]. I try hard to prevent all errors and trap on those I can't prevent. Yes just my own personal philosophy that only real error should ever occur.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 14 of 15
(938 Views)

Ben wrote:

 

I agree but I am leaning toward it being borderline wrong, if not wrong then[Flamesuit ON] lazy [flamesuit OFF]. I try hard to prevent all errors and trap on those I can't prevent. Yes just my own personal philosophy that only real error should ever occur.

 

Ben


Hmmm...  You may be right.  Stopping a loop on a forced error condition is just plain wrong, and lazy.  Good philosopy, only real errors should ever occur.  No more forced errors for me.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 15 of 15
(927 Views)