LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

restart while loop

how can i do that when the comprasion is true then restart the whole code?

Download All
0 Kudos
Message 1 of 8
(3,232 Views)
So what I think you are saying is that you have a vi that does something you want and you now need to be able to do it over an over again. Is that correct?

Is this the same code on which you have several other ongoing discussions? If you are in the middle of working out a problem, you don't have to start a new thread every time you have a new question. It is very common for discussion threads to sort of wander off from the original question, and IMHO that is perfectly fine because it means 2 or more people are in a conversation. And where there is conversation there is learning. And where there is learning... All manner of good stuff happens.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 8
(3,210 Views)

I'm not sure what is wrong, but I could not get either of your two VIs to open (using LabVIEW 2014) -- it was as if they were not LabVIEW code (basically nothing happened, no error, no message).

 

I just figured it out.  Both programs have a name that ends with the letter "o" with a tilde on top -- in my Windows 7 machine, the file shows up on my disk with a normal size, but if I try to open it with, say, a "read anything Text editor", no bytes appear.  Deleting the final "o" fixes things.  I'll be right back ...

 

Bob Schor

0 Kudos
Message 3 of 8
(3,200 Views)

OK.  Your main routine is Matek esõ, which calls your sub-VI to do some stuff.  Your main routine has a Stop button, which stops it.

 

What do you want to have happen?  Do you want two buttons, one that says "Restart", and one that says "Quit"?

 

The question of restarting your routine seems fairly simple.  You need to think about how to (re-) initialize things, as you use uninitialized Shift registers and some outputs that might need initialization.  You'd put the initialization code outside of Matek's While loop, and wrap all of that in a second While loop that handles whether or not you Quit or Restart.  [I'm sure you have figured out that you leave the current Matek loop if the user pushes either Quit or Restart, if you are using the two-button idea, and exit the outer While only if Quit is pushed.  Think what doing this means for the Mechanical Action of Quit.]

 

Bob Schor

0 Kudos
Message 4 of 8
(3,194 Views)

Tanácsos elkerülni magyar karakterek használatát file nevekben, ahogy a példa is mutatja, problémákat okozhat.

Erősen ajánlom neked az online hozzáférhető oktató anyagok tanulmányozását, meglátod sokat fog segíteni:

https://decibel.ni.com/content/docs/DOC-40451

A "Looking for free training" résznél találod!

Üdvözlettel,

Message 5 of 8
(3,189 Views)

Jó reggelt.  For those whose Hungarian is even more limited than mine (I just exhausted half of my vocabulary), I think Blokk was suggesting using the on-line Tutorials for LabVIEW.  A very good idea, worthy of a kudo.

 

Bob Schor

0 Kudos
Message 6 of 8
(3,179 Views)

sorry about that 🙂 I love to use my language, whenever I have a chance 🙂

0 Kudos
Message 7 of 8
(3,172 Views)

No problem -- now, if the Original Poster has a very detailed question and isn't sure how to express it in English, he (or she) knows there is a fellow Magyar out there listening ...

 

BS

0 Kudos
Message 8 of 8
(3,160 Views)