05-21-2012 09:10 AM
Hi GerdW,
Sorry I posted the empty one. I did test valid array from my program and the indicator is very wierd. Then I tried different inputs and then use control to test. It didnt turn out right for me. For example I put value "10" into array and the converted value isnt 10... Maybe I did something wrong though. Could you explain it to me?
Thanks
05-21-2012 09:16 AM - edited 05-21-2012 09:17 AM
Hi Tony,
just for curiosity: Did you input that "10" into the the element of the array or did you write that number into the index of the array? That's quite a difference...
Please attach a VI with real data and your (supposed) weird result...
05-21-2012 09:20 AM
tony353 wrote:I'm trying to extract data from excel file ( which is 1-D array of long) ,(one number at a time, not a row) to trigger a case structure. Even I use "to long integer" it says the format is 1-D array of long integer. So I need to convert that specific number in 1-D array form to integer.
Case structures don't accept arrays, just scalars. So if you have a long array of DBL, "converting" to a scalar I32 is NOT a conversion, but a very lossy data reduction. Taking the average as mentioned would be one possiblity, but would not make a lot of sense in general, because there are so many possible outcomes and you probably don't want to have thousands of cases in the case structure.
Since you say you want to do it "one number at a time", you are no longer having an array, and a simple "to I32" would suffice. Maybe all you need to do is wrap a FOR loop around it???
Can we reboot this discussion and start from scratch:
05-21-2012 09:41 AM
Ok.. Heres the code.. After clearing irrelvant stuff, I need to convert the output of the read excel file( that long orange line) from array format to integer...
Heres the probem: After using I32, it still says incompatiable as still in 1-D array format.
I need that line from 1-D array format to non array in order to control case structure and do comparison and so on.
and Thanks for really quick reply from you. Thank you.
05-21-2012 09:50 AM
I don't see any case structure (except the error one).
What should the cases be? You have not explained the need for a case structure and how it should depend on the data in the orange array. Should it depend on the first element? on the array size? something else?
There is still a lot of irrelevant stuff. What's up with that giant "index array"? If you want the elements in order, the indices don't need to be wired.
05-21-2012 09:52 AM
05-21-2012 09:56 AM
The value from excel file is ranged from 1-100. (integer)
The case structure(which the orange line is heading) going to be 4 ranges, 1-20, 21-50, 51-70 and 71-100.
the giant "index array" is extracting a lot of excel file values, I just showing one line for conversion into integer.
05-21-2012 09:58 AM
Hi GerdW
Can you please explain what is autoindexing and how it should be used?
Sorry I dont understand that.
Thanks and Best Regards.
05-21-2012 10:00 AM
Hi Tony,
when you don't know the term "autoindexing" you should definitely go through the LabVIEW Basics course offered by NI...
Did you notice the input tunnel of the FOR loop? It's colored different than other tunnels - and there's a reason for...
05-21-2012 10:06 AM
Ok I do notice..
I learn labview from school and none of the lecturer teach autotunneling...
Would you be kind enough to tell me how to make autotunnel? it will take really lot of time for me to find it in the courses.
Thanks