Execution Structures in LabVIEW

Recommended by 0 users


Data can be passed out of or into a loop through a tunnel. Tunnels feed data into and out of structures. The tunnel appears as a solid block on the border of the loop. The block is the color of the data type wired to the tunnel. Data passes out of a loop after the loop terminates. When a tunnel passes data into a loop, the loop executes only after data arrives at the tunnel. In Figure 4.9, the iteration terminal is connected to a tunnel. The value in the tunnel does not pass to the Iteration Number indicator until the While Loop has finished execution. Only the last value of the iteration terminal displays in the Iteration Number indicator.

Passing data outside the loop through a tunnel


Inputs pass data into a loop at the start of loop execution. Outputs pass data out of a loop only after the loop completes all iterations. If you want the loop to check the value of a terminal for each iteration, place the terminal inside the loop. When you place the terminal of a front panel Boolean control inside a While Loop and wire the terminal to the conditional terminal of the loop, the loop checks the value of the terminal for every iteration to determine if it must iterate. You can stop the While Loop as shown in Figure 4.10(a) by changing the value of the front panel control to FALSE.

(a) While Loop with Boolean control placed inside the loop and (b) While Loop with Boolean control placed outside the loop.

If you place the terminal of the Boolean control outside the While Loop as shown in Figure 4.8(b), and the control is set to FALSE if the conditional terminal is Stop if True when the loop starts, you cause an infinite loop. You also cause an infinite loop if the control outside the loop is set to TRUE and the conditional terminal is Continue if True. Changing the value of the control does not stop the infinite loop because the value is only read once, before the loop starts. To stop an infinite loop, you must abort the VI by clicking the Abort Execution button on the toolbar.

0 Responses on Execution Structures in LabVIEW"

Leave a Message

Your email address will not be published. Required fields are marked *

Copy Rights Reserved © Mindmajix.com All rights reserved. Disclaimer.
Course Adviser

Fill your details, course adviser will reach you.