LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

program runs once correctly, then fails

Solved!
Go to solution
Solution
Accepted by topic author markfranklin

Following Ben's guess, what do you have wired to the stop terminal of your while loop and is it possible that the stop boolean is not getting reset?

Message 11 of 26
(1,759 Views)

Everyone can spend all day throwing out guesses as to why your code doesn't work.  But it will all be a waste of time unless you post your actual VI so we can see what you are doing.

Message 12 of 26
(1,757 Views)

@markfranklin wrote:

I am using the iteration terminal of a WHILE loop to count samples.


Posting an image of your code will help us help you. Lacking an image or the code itself, I suspected the number of wild guesses will start dropping off soon.

 

So keep us entertained and post some images.

 

Just trying to help,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 13 of 26
(1,756 Views)

I have no problem posting code.  It is a state machine, so there are many vi's.

Frankly, I do not know where the problem is occurring.

So I will post the main state machine and the main vi for now.

0 Kudos
Message 14 of 26
(1,750 Views)

@Taki1999 wrote:

Following Ben's guess, what do you have wired to the stop terminal of your while loop and is it possible that the stop boolean is not getting reset?


I suspect Taki1999 wins the game for today.

 

The gloabl boolean "Display Stop Button" is prbably latchine the stop from the first run preventing the second.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 15 of 26
(1,741 Views)

Perhaps.

 

But the button is "set current value to default", so wouldn't the button always start with a FALSE value when vi opens??

0 Kudos
Message 16 of 26
(1,734 Views)

No.

 

You are focusing on the button and the issue is the global.

 

Inside you large loop, put an indicator on the wire coming from the global and feeding the gate to stop the big loop. When you run the app the second time, the global still as the "true" that was written when the app first ran

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 17 of 26
(1,728 Views)

Watch out for the tunnels for you enums for the state machine.  You have them set for Use Default if Unwired, and you have them unwired in one or more cases, for example, the Thermocouple Selection Case.  If that case runs, the next state for your state machine will be the default value of your enum, which is probably startup, and also probably not the case you'd want to run next.

 

Also, look at what is happening in the Welcome.vi (not attached) since that is the only place where something is written into the tunnel that goes to stop the VI.

Message 18 of 26
(1,722 Views)

How do I delete my VIs from this post, now that the problem is solved?

0 Kudos
Message 19 of 26
(1,675 Views)

Use the "options" drop down on the upper right of that post to send a message to the web-team. They should be able to pull it down.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 20 of 26
(1,668 Views)