LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reversing the order of data written to variable

Hi,

i am making a small test vi to test the way to write data to a buffer. I am writing a string in a while loop with the time and send the data saved from loop to a local variable. But i found the data is saved in reverse order than how I want it to be. I have attached the image and the vi i made. As seen in the image, the time 11:00:34 should be at the end of the data but not at the top. Is there anyway this can be reversed. 

 

Thanks

Download All
0 Kudos
Message 1 of 5
(2,410 Views)

I don't have LabVIEW with me but you can change the order by changing your concatenation order. The output of your shift register should go to the top of the concatenation. Also you should initialize your shift register with an empty string to avoid unexpected results.

 

mcduff

0 Kudos
Message 2 of 5
(2,407 Views)

McDuff is correct (I peeked at your code) -- in your Build Array, you put the new data first, the old data second, which means "The Last Shall be First".  There may well be a good reason that you'd want to do this (for example, you are making a "stack" instead of a "queue").  One way to "fix" this, of course, is by putting the old data, then the new data, into Build Array.  But if you want to leave it and fix it "after the fact", simply run your array through the Reverse 1D Array function.

 

Bob Schor

0 Kudos
Message 3 of 5
(2,398 Views)

Thanks McDuff. I tried it and it works perfectly. 

0 Kudos
Message 4 of 5
(2,380 Views)

Thanks Bob.

 

I will give it a shot. 

0 Kudos
Message 5 of 5
(2,379 Views)