11-06-2007 07:54 AM
11-06-2007 08:05 AM
Just wrap the code inside the loop in a case structure.
If the condition is true, execute the T case, otherwise execute the F case.
To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here, here, here, here, here and here are a few you can start with and here are some tutorial videos. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).
11-06-2007 08:05 AM
11-06-2007 08:15 AM
LabVIEW only directly supports the "Do...While" construct with its While loop. There are fairly simple workarounds though. One example is to put all your active code inside a boolean Case structure in your While loop. Let the Loop termination boolean wire drive the case structure so that when the boolean means "terminate", the code doesn't execute.
(There are 2 more possible gotchas associated with this workaround. If you care about the final value of the iteration terminal 'i', you may find that it's too large and needs to be decremented. If you have other calculated values to pass out of the loop, you'll need a good way to get them through your case structure. This will likely mean that you'll use shift registers so that on the final loop iteration, all the left-side-values pass straight through the Case structure to the right-side-values.)
-Kevin P.
11-07-2007 03:01 AM
Personaly i would like Labview to support the "break" command, that C has (in a while loop).
And why not a "return" command to terminate a sub-vi.
They are not necessary, but whould make wiring easier.
11-07-2007 04:20 AM
Pnt wrote:
Personaly i would like Labview to support the "break" command, that C has (in a while loop).
And why not a "return" command to terminate a sub-vi.
11-07-2007 08:43 AM