08-19-2015 12:44 PM
Hi
I am recieveing a number from a VI, and I want to count from the number recieved down to 1. The number is subject to change.
Solved! Go to Solution.
08-19-2015 12:49 PM
fghfghgfhfhg wrote:
I am recieveing a number from a VI, and I want to count from the number recieved down to 1. The number is subject to change.
Sounds like a shift register on a While loop and a decrement inside. What all are you trying to do with this? That will affect how I would tell you to do this.
08-19-2015 12:51 PM
I am getting a value that returns the last row with data in Excel. Using that number, I am reading each value from that column, until the last row from Excel and inputing the values into an array.
08-19-2015 01:04 PM
No need to count down. Assuming you are using ActiveX to read an actual xlsx file, you can set a range of cells to read. You can just use the number of rows value to generate your range.
If you are dealing with a text file, then you just use the Read From Spreadsheet File VI and then Index Array to get your desired column.
08-19-2015 01:04 PM - edited 08-19-2015 01:06 PM
Would this work for you? Wouldn't need a shift register if you're going to go in order.
The last iteration should be (123 - 122 = 1). Make sure to take in to account that this would be base 1, so if you're using the Excel VIs you'll probably have to decrement to be base zero index.
Edit: Do what crossrulz said if your end goal is the array output, just load it as an array from the start.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'