LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to cycle a while loop on its own and only controlled by the number of cycles?

Hello everyone, 

 

Newcomer here, recenlty just took core 1 and 2 the past couple of months

 

is there a way to cycle my while loop so that the daq assist receives the same outputs from the list box table? So pretty much I need the VI to be able to read the voltages and time values from the list box and then execute them, I've manage to do this, but then I need it to stop for a given time and then execute again the same voltages. This would be controlled by a control for "number of cycles" input. 

 

Can someone tell me why my "Emergency Stop" button doesn't stop the VI?

Why is my data logging only outputing one result if I have it to read ever min?

My wave form graph isnt plotting the temperature results, does it have somthing to do with the while loop?

 

I know this is a lot of questions, I'm just trying to solve this and learn from it.

0 Kudos
Message 1 of 12
(3,429 Views)

You took core 1 and 2!!!  Please tell me NI didn't teach it.  I'm not trying to harp on you too bad because I think the instructor is more to blame.  You have many wires going the wrong direction, multple loops doing nothing, and one loop that will never stop so even if all the others did there would be no way to stop your program, a Stop button that is read only once at the start of the application and then is never read again (so stop will never work).  You have the inner loop running forever, but even if it did stop it would run the outer loop forever, your enums should be typedefed, uninitialized shift registers when not needed, dynamic data types, far too many express VIs...ouch.

 

To answer your question.  If you have a while loop that needs to run 5 times, why not use a for loop? Then wire a 5 to the N terminal.  If you do have to use a while loop for what ever reason, use the i terminal as a condition to stop.  It will start at 0 and count up so a value of 4 means it will be executing the 5 time.  If the value equals 5 then stop.  Get the Array size of the Listbox and set your for loop to run for each item.

0 Kudos
Message 2 of 12
(3,411 Views)

I made some minor changes just to clean things up without changing the structure of your VI then made some notes on the block diagram to explain some of your errors.  This should get you started on the road to successful LabVIEW programming.

 

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
0 Kudos
Message 3 of 12
(3,397 Views)

Apparently the OP only has LabVIEW 2009 (see here).  So here is this VI saved in 2009.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 12
(3,359 Views)

^^thanks

0 Kudos
Message 5 of 12
(3,347 Views)
Had i known 2009 was needed I would have saved it as 2009.
Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
0 Kudos
Message 6 of 12
(3,340 Views)

@kbbersch wrote:
Had i known 2009 was needed I would have saved it as 2009.

I learned that the first thing to do when looking a VI somebody posts is to open the VI Properties to see what version it is saved in.  The original VI was saved in 2009.  Just something to keep in mind until you get into the habit.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 7 of 12
(3,334 Views)

@crossrulz wrote:

@kbbersch wrote:
Had i known 2009 was needed I would have saved it as 2009.

I learned that the first thing to do when looking a VI somebody posts is to open the VI Properties to see what version it is saved in.  The original VI was saved in 2009.  Just something to keep in mind until you get into the habit.


A star on the title bar tells me to look at the version.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 12
(3,329 Views)

@crossrulz wrote:

I learned that the first thing to do when looking a VI somebody posts is to open the VI Properties to see what version it is saved in.  The original VI was saved in 2009.  Just something to keep in mind until you get into the habit.


I too look for the dirty dot then on close can look at the details to see the version it was last compiled in.  How can you get this information from the VI Properties?

 

I also have a VI that reads the "vers" Block Data from a VI on disk to read the version information without needing LabVIEW.

0 Kudos
Message 9 of 12
(3,316 Views)

When I am looking at VIs posted on the Forums, I check the version and then place a free label on the BD with the version number. After making any changes, I can tell at a glance what previous version to save.

 

Lynn

Message 10 of 12
(3,304 Views)