View Single Post
  #13   Spotlight this post!  
Unread 13-10-2008, 13:25
BitTwiddler's Avatar
BitTwiddler BitTwiddler is offline
electronics/programming mentor
AKA: Mr Tanguay
FRC #1726 (N.E.R.D.S.)
Team Role: Mentor
 
Join Date: Oct 2008
Rookie Year: 2006
Location: Sierra Vista, AZ
Posts: 243
BitTwiddler is on a distinguished road
Re: Basic Labview Programming Questions

Quote:
Originally Posted by Joe Ross View Post
I've attached a version that does what I think you want. The main thing you needed was a shift register (or feedback node) to take your changed array and feed it back so it could be operated on. The way you had it, each loop it was always operating on the original array. I must admit that this has been the thing I've messed up the most in LabVIEW.

You'll need another loop of some type to finish sorting. You can also use the array size VI for the input to the count terminal input of the for loop.
Taking Mr. Ross' vi a bit further, I've modified it to swap array elements without overwriting the ith array element. Still needs another loop to control the number of passes through the array in order to propagate all of the changes each pass makes.
Attached Files
File Type: vi Sorting arrays.vi (13.2 KB, 93 views)
Reply With Quote