View Single Post
  #5   Spotlight this post!  
Unread 18-07-2013, 07:04
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Writing a 2D array to a .csv file inaccuracy

If you turn on execution highlighting and run the VI I think you'll find that you have race conditions caused by using too many local variables and too much parallelism that isn't specific enough.

When your while loop begins, you have three parallel pieces.
1. Read the stop button and determine if the loop will run another iteration.
2. Take whatever value is in Iteration # and put it in the file.
3. Run the loop to completion

There are three locations where I think you have used a local variable but should instead use a wire. Local variables are useful for UI programming and as a simplistic communication between parallel loops, but if you use them instead of a wire, just to make it look pretty, you need to be very aware of race conditions. You just told the compiler that you don't care about sequencing the operations with this data.

Greg McKaskle
Reply With Quote