12-10-2014 09:28 AM
Hey all
Want some help with my labview.I m using excel spreadsheet reader to get some numbers from excel sheet to array.I figure out how it works but only problem is it cuttoff deciaml numbers when it comes to array.Anyone know how to figure it out ?
Second problem is i m trying to get rid of first zeros in my array to get it todraw XY graph .I wrote a subvi for that purpose but it works only the first time then it keep cutting off the rest of the number.If you can help me with this it would be great.
Thank you
MNSU
12-10-2014 09:35 AM
You have your data type set to an I32 (integer), so that probably explains why it's cutting off your decimals. As for your second question about why running it only works the first time, it's because you have an uninitialized shift register. Wire a 0 to the shift register on the left side of your For loop and it should fix your issue.
12-10-2014 09:38 AM
The reason you are not getting decimal is becasue you are using the integer read spreadsheet. So as soon as it reads the file it converts to integer.
I've put a simpler way to remove all elements that equal zero by using for loop and conditional indexing terminal.
See snippet for answers to both.
12-10-2014 10:01 AM - edited 12-10-2014 10:07 AM
MNSU wrote:Want some help with my labview.I m using excel spreadsheet reader to get some numbers from excel sheet to array.I figure out how it works but only problem is it cuttoff deciaml numbers when it comes to array.Anyone know how to figure it out ?
Your VI has nothing to do with excel and cannot read excel files. All you are doing is reading from a comma delimited text file.
Your polymorphic selector is set to "interger", giving you I64. Set the polymorphic selector to "Double".
It typically helps to keep the code neat. Why did you move the polymorphic selector so far away from the function?
@MNSU wrote:
Second problem is i m trying to get rid of first zeros in my array to get it todraw XY graph .I wrote a subvi for that purpose but it works only the first time then it keep cutting off the rest of the number.If you can help me with this it would be great.
Your code is extremely dangerous, because if the input array is all zero or empty, the VI will run forever and needs to be aborted. Why is the panel maximised to the screen?? Very annoying.
In any case, your loop code is extremely convoluted. None of this is necessary. Here are two alternative solutions (there are many more):
(For unusual inputs (empty array, all zero, etc), you might need to tweak for the desired outcome)
I still don't understand your point with the XY graph. XY graphs have no problem plotting zeroes. None of the current data structures are even suitable for an xy graph. Please explain.
12-10-2014 10:09 AM
rthomas101 wrote:I've put a simpler way to remove all elements that equal zero by using for loop and conditional indexing terminal.
He does not want to remove all zeroes, just the zeroes up to the first nonzero element.
12-10-2014 10:16 AM - edited 12-10-2014 10:18 AM
Oh the leading zeros! Right, with you now.
12-10-2014 11:23 AM
Thank you guys.I figure it out. you guys are the best .