LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Number will not leave "For loop"

On the right side of my block diagram, the "0" or "1" that I am trying to get to leave the for loop to go to the case structure below it will not leave when I use the highlight exicution function I see the data stop at the border of the loop.  I need the loop for timing.

0 Kudos
Message 1 of 3
(3,141 Views)

The data can't be seen by anything "after" the For loop until the loop ends. You have to think about it like a flow chart.

 

LabVIEW programming is based entirely on dataflow and parallelism. This is incredibly powerful and has lead to its success over the years (coupled with the graphical programming), but is usually one of the first things that new developers stumble over. Here's a simple resource to become more familiar with how it works. The Highlight Execution feature is a great way to watch how your application utilizes dataflow and you're seeing correctly how it won't leave the loop.

 

To show the current value within the loop, you have to move the indicator inside. If you want an array of all values that are being passed out of the For loop, right-click the tunnel on the edge of loop and select "auto-indexing". This will give you an array of all the values that you can display using an array of integers indicator.

 

For Loop.PNG

 

"Give me six hours to chop down a tree and I will spend the first four sharpening the axe."  - Abraham Lincoln

 

Here are some free training tools primarily focused on LabVIEW and NI hardware to help get started.

NI Learning Center

NI Getting Started

-Hardware Basics

-MyRIO Project Essentials Guide (lots of good simple circuits with links to youtube demonstrations)

-LabVEW Basics

-DAQ Application Tutorials

-cRIO Developer's Guide

Learn NI Training Resource Videos

3 Hour LabVIEW Introduction

6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 2 of 3
(3,129 Views)

James hit everything very well. I'd also add that the dynamic data hides (or confuses) what you are actually looking at. I'd rather see a green wire for boolean, than some mystery blue wire. You can try the "In Range and Coerce" function instead of that express VI.

0 Kudos
Message 3 of 3
(3,057 Views)