LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Show text-file

Hello,

i'm a beginner with LabVIEW.
I have a text-file with temperatures look this:

29.03.2005 10:00:00 21,4
29.03.2005 10:01:00 21,6
.
.

The intervall to refresh the text-file can i choose on my device.

So, now i like to have a graph in LabVIEW how show me the temperature. How can i design a VI where the data comes from a text-file?

Thank you for all tips!

Sascha
0 Kudos
Message 1 of 18
(3,921 Views)
Hello Sascha,

I think it's better for you if I give you the advive on what to use and that you tray to do it instead of giving you the result already done, this way you will learn how to do it. Meanwhile, if you have doubts, ask them, for sure someone in this forum will help you.
First of all you have to read data from your text file.
Use the functions on the FileIo - For instance Read characters from file or read from spreadsheet file (this one has the disadvantega of only returning numbers in it's default version, you can open it and change it accordingly to the instructions you can find in the documentation of the vi - don't forget to save it with another name (like read from spreadsheet file string.vi) otherwise it will then return strings forever...).
Assuming now that you have already your data in an array of strings, pass it through a for loop (the array will then be indexed - in each iteration of the loop you will have one element of the array).
The next step, inside the for loop is converting the date info in a LabVIEW timestamp, you can do this with strings operations - llok a the scan from string function and the build a cluseter that can be wired to hte Data/Time to seconds function.
You have also to convert the value itself to a number - look at the string to number conversion group inside the string group.
You have to build a cluster with the timestamp value and the temperature value and then wire this cluster to the output of the for look.
Connect this output to a XY graph.

Enjoy,
Paulo
0 Kudos
Message 2 of 18
(3,912 Views)
Hi Sascha,

Herewith I send you two emaple VI version 7.1 and 6.You can choose your txt file and read data. I hope it helps.
Regards
TN
0 Kudos
Message 3 of 18
(3,827 Views)
Hi,

sorry, but i don't can open both samples with my Version 7.0 because the samples in Version 7.1

Sascha
0 Kudos
Message 4 of 18
(3,800 Views)
Hi,

I converted the VIs to 7.0. You can open the VI now.
TN
0 Kudos
Message 5 of 18
(3,789 Views)
Hello,

first: Thank you for the good answer.
Now i have test it, but i labview don't make it good 😞

1. The convert from the Time-String to Timestamp (and use this timestamps as x-Graph) don't function.
2. i have an error on my array. i like to show on graph1 the index 1(and index2 on graph2) of all 10 mess-points, but he show me on graph1 index1 and 2 of mess-point1 an on graph2 index1 and 2 of mess-point2.

I have my test as zip-file attached. I hope you can help me!

THANKS

Sascha
0 Kudos
Message 6 of 18
(3,872 Views)
Hello Sascha,

You almost did it!
I changed it and comment it so you can better understand my changes.

Hope you can learn a bit more with it...

Regards,
Paulo
0 Kudos
Message 7 of 18
(3,857 Views)
Sorry forgot to attach... it's a little bit late you know...
0 Kudos
Message 8 of 18
(3,854 Views)
Hello,

THANK YOU ! Your programm is wonderful! After 1 or 2 hour learning i have understand (i hope so...) what you do! I have learn much about LabVIEW!

Now i have a new Problem with the program. The Input-File looks now like this:
Header:
"ID";"Name";"Zeit";"Status";"CH1-S";"CH1-Data";"CH1-Einh";"CH1-Alarm";"CH2-S";"CH2-Data";"CH2-Einh";"CH2-Alarm"
Data:
"7230";"Logger1";"28.03.2005 08:53:00";"0";"S1";"22,3";"°C";"0";"S2";"51,8";"%";"0"

The Date/Time-Strings was now complete! But i don't can load it with the read-file funktion! I have no tabs (data splitt by semikolon and "").

HOW CAN I READ THIS FILE CORRECTLY???

THANK YOU FOR ALL TIPS!

Bye, Sascha
0 Kudos
Message 9 of 18
(3,822 Views)
Hello,

You have to make some different text file readings and some string manipulations.
Look at annex vi.

Hope this helps,
Paulo
0 Kudos
Message 10 of 18
(3,818 Views)