08-15-2011 01:23 AM
Hello Forum,
Is it possible to get a 'specific' data that has been saved into a text file already, and put it into the front panel ?
Let's say, i want the maximum value of this part of the text file
23
21
94
56
78
Obviously, I want to get '94' out from the textfile, and into my VI's front panel.
Is LabVIEW able to do this ?
Solved! Go to Solution.
08-15-2011 01:52 AM
Yes.
Read the file.
Use format spreadsheet string to array.
Then use min/max on the array and wire the max to an indicator.
Felix
08-15-2011 01:58 AM
I'm sorry,
How do you 'Read the File' ?
08-15-2011 02:12 AM
File I/O:
Read from Text File
even simpler
Read from Spreadsheet File
Felix
08-15-2011 02:14 AM
Okay thanks!
Will try it when I'm on my main computer!
08-15-2011 08:14 AM
When you get to that computer, you might also want to consider opening up the LabVIEW Help and doing some tutorials, as your question is extremely basic. To learn more about LabVIEW it is recommended that you go through the introduction material, tutorial(s), and other material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. There are also several Technical Resources. You can also take the online courses for free.
08-16-2011 12:44 AM - edited 08-16-2011 12:45 AM
Hello, as you can see from the attachment,
I have 3 columns of numbers here.
First column, Angle of degree,
Second column, Average data,
Third column, statisical error
I would like to retrieve data from the MAXIMUM 'AVERAGE DATA' at which 'ANGLE OF DEGREE'
So, it would be best to retrieve the whole row, of the maximum average data.
How can I do so ?
I've tried the method you've suggested, but I can't seem to get it connected.
P.S: For this example(in attachment), the max degrees is at 20, and the average data at 4.16 ...
How do I get the whole row of data out and display it to the front panel ?
08-16-2011 01:43 AM
hello PotatoMan,
use this vi and see if your function works.......................
08-16-2011 08:43 AM
alok123, that VI simply will not work. The file contains a bunch of lines of headers, and your VI doesn't take this into account. The conversion will simply convert ALL lines, including the header. Thus, in this case it will pull out the line that says "Data per picture 800" because "Data per picture" will be converted to 0 and be in the first column, and 800 will appear in the second column. The third column will be zero. When you seach the second column for the largest value, you get 800. You need to chop off the header lines.
Besides, if you are going to read a file as a spreadsheet file, then simply use the Read From Spreadsheet File VI.
PotatoMan said:
I've tried the method you've suggested, but I can't seem to get it connected.
What do you mean you "can't seem to get it connected"? Show us what you did. A VERY simple solution is to use Read From Spreadsheet File, and chop off the lines which are the header. Then you can search the second column for the max value, and pick out the corresponding row. This is a corrected version of alok123's VI.
08-17-2011 12:40 AM
smercurio_fc,
Thanks for the correction.
I didn't seen the the whole file in hurry.
Hope you will continue with your suggestions in future.