View Single Post
  #12   Spotlight this post!  
Unread 12-10-2008, 15:21
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,563
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Basic Labview Programming Questions

Quote:
Originally Posted by tivomatic View Post
I am trying to write a Labview vi that takes a one dimensional numerical array, for example A= 5,4,3,2,1, and sorts the values in ascending order. We do not want to use the sort array operator since the whole purpose is to practice using labview. Although I can write this no problem using Basic, I am having trouble in Labview. . I have attached the vi.

Thanks.
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.
Attached Files
File Type: vi Sorting arrays.vi (11.2 KB, 108 views)

Last edited by Joe Ross : 12-10-2008 at 15:24.
Reply With Quote