Quantcast
Channel: All LabVIEW posts
Viewing all articles
Browse latest Browse all 203453

Re: Constructing an XY graph based on a pre-determined number of coordinates

$
0
0

Woody,

 

You do not need local variables or sequence structures and you should learn to program in LabVIEW without them. While there are places where they need to be used, those places are rare and very specific.

 

Next, indexing the points cluster with the last value of i is not what you want. Put an indicator on that wire and see how many iterations that loop has run while you are entering a few points! What you should do is to add another shift register with an integer (I32) datatype. Inside the True case (where new coordinate is appended to the array) you increment the integer value. When you exit the loop, the value will be one greater than the index of the last element in the array. Arrays in LabVIEW use zero based indexing. When you index an element that does not exist from an array you get the default value for the element datatype, (0,0) in this case.

 

You may also want to do the search for initial point inside the True case. If the user accidentally enters the initial value while the Final Coordiante? button is pressed, the loop will terminate. 

 

Initializing the shift registers may be a good idea as well unless you want the values saved from one call to the next.

 

Lynn


Viewing all articles
Browse latest Browse all 203453

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>