LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Two while loops share same stop flag

1. I have attached a VI in which two while loops are attached. Both use same stop flag.
2. When I made stop button as "latch when released", it gives error as in attached VI.

3. When I change it to "switch when released", stop button does not comes out to default valueswhen once it is pressed, likw in latch when released.

4. How to make sure when stop is pressed, both while loop exits & stop button also gets to its default value.

 

Additional ques:
1. I have made a subvi, in which two controls are there. Add is used & a indicator is the used to display result.
How can I add default values to one control, in case user don't wire it?

2. How to add default values to any control?Like whenever VI starts it always gets that value

3. Can we use labview for developing android apps also.

 

 

0 Kudos
Message 1 of 2
(2,787 Views)

FYI, you can set default control values using the right-click menu.

 

This is a classic case of values not being reset. You can't do Latch action because you're using a local variable and reading in multiple places. Latch only works if you're only reading in one place. So you need to use switching. Now, if you run the VI twice, the previous run will have set the value to True, so the next run will read True right away and stop both loops. You need to initialize your Stop button before the loops read from it:

Race to Stop.png

 

You should learn from some tutorials before you continue with LabVIEW. You'll waste a ton of time trying to figure stuff out when you don't even know what LabVIEW is capable of or how it works.

 

"Give me six hours to chop down a tree and I will spend the first four sharpening the axe."  - Abraham Lincoln

 

Here are some free training tools primarily focused on LabVIEW and NI hardware to help get started.

NI Learning Center

NI Getting Started

-Hardware Basics

-MyRIO Project Essentials Guide (lots of good simple circuits with links to youtube demonstrations)

-LabVEW Basics

-DAQ Application Tutorials

-cRIO Developer's Guide

Learn NI Training Resource Videos

3 Hour LabVIEW Introduction

6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 2
(2,771 Views)