01-12-2012 09:05 PM
Hi I just started using LabVIEW this week, and I am currently evaluating LabVIEW 2011. I am trying to come up with a SIMPLE program, where I can analyse a daily temperature reading on a waveform. But the raw data is in .txt format.
I tried exploring Read from Measurement File function but realized that I can only set the delimiter as either Comma or Tab. Thus the problem is that my raw .txt file delimiter is Semi-Colon!
Would really appreciate any help!
01-12-2012 09:48 PM
That's the limitation of using Express VI's. They can get you something working quickly, but if you need some variation that wasn't designed into it, you need to do your own programming. Look at the File I/O palette for lower level VI's for reading text files. Also the string palette for the Spreadsheet string to Array VI that will let you pick whatever delimiter you want.
But there is a way to get your Express VI to do what you want without a whole lot of programming. Right click on the express VI and pick, Open Front Panel. It will convert it to a regular subVI. If you open that, you will see a string constant there that will either be a comma or a tab character. Just change that to a semicolon. You'll need to save your new subVI, and I would recommend changing the name to something that won't ever get confused with files in the VI.lib library.
01-12-2012 10:18 PM
I tried what you said! (the express vi way) Its really impressive! I'm still trying to work out using the read text file and spreadsheet string to array VI. Is it possible if you can send me an example that I can refer to it at home? Cos I'm in school right now and i dont have any internet access at home!
Much appreciations from Singapore!
01-12-2012 11:11 PM
This should get you started.
Having the timestamp part at the front complicates things in doing a conversion to numeric data. Since I'm not sure how you want to handle the time component, I'm going to leave that alone for now.
Right now it imports the data and puts it into a string array. Depending on what data you want to work with (time vs. any of the numeric columns), I'll leave it up to you to figure out how you want to convert the string array elements to numeric values.
01-13-2012 12:42 AM
I had made a start before Ravens' post, so I'll post mine anyway.
Some bits of this code may be useful.
01-13-2012 02:38 AM
Thanks for the help Ace! I tried creating your block diagram but found out that it was too intensive!
And Raven, I tried working on your example for hours, but still cannot get anything out of it. But I kinda understand roughly what you have guided me with.
So basically, I have achieved trying to import my .txt file which was semi colon delimited. To move on, I need to disply the array on a waveform graph.
I tried dabbling with the get waveform and build waveform functions but to no avail.
And is it possible to call which columns of the array I wish to display on the waveform? Because I only want to plot the 1st on the y axis, 7th and 8th column on the x axis, but at the same time, still displaying the array.
Feel so stupid right now. Really hope you guys can help me! Ive attached the mod file, which I have included the graph that I wish to use.
01-13-2012 03:08 AM - edited 01-13-2012 03:10 AM
You can drag and drop that on to a block diagram. Basically just chose the waveforms you want to display and delete the rest. Resize the index array and the merge signals accordingly. I have attached the vi as well.
01-13-2012 03:13 AM
I tried dragging the image and drop it into a block diagram. But only a url appeared.
01-13-2012 03:14 AM
sorry didnt saw the vi you attached! thanksssssss i will try yours out while waiting for raven's.