LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Importing txt-files in Labview

Hello,
 
I am a beginner in programming labview applications so its possible my next question is very easy to program but i dont know how Smiley Happy
 
My question is about importing a txt-file (csv-format) in labview. This txt-file is updated every 10 minutes and I want to visualise the last values every 10 minutes. These values must be written in several indicators (example: 10 coloms -> 10 indicators) 
 
Next is a copy of the txt-file (this one is updated every second).
 
17/05/2005 0:00:03,-0.2015457,13.99473,88.62115,-108.5054,25.05078,25.98672,26.86344,-8.207347E-03,-0.9357101,-0.9123873,-0.9192927,
17/05/2005 0:00:04,-0.2015457,13.99473,88.62115,-108.5062,25.04688,25.98672,26.86344,-8.207347E-03,-0.9357101,-0.9123873,-0.9192927,
17/05/2005 0:00:05,-0.2015457,13.99473,88.62115,-108.507,25.04297,25.98281,26.86344,-8.207347E-03,-0.9357101,-0.9123873,-0.9192927,
17/05/2005 0:00:06,-0.2015457,13.99473,88.62115,-108.5085,25.04297,25.98281,26.86344,-8.207347E-03,-0.9357101,-0.9123873,-0.9192927,
17/05/2005 0:00:07,-0.1940842,13.99473,88.62115,-108.5085,25.04297,25.97891,26.86344,-8.207347E-03,-0.9357101,-0.9123873,-0.9192927,
 
 
I found a template (Load file from and display) thats displays a value from a txt-file.
In the block: "Read LabView Measurement File" its possible to select an option to read from a generic text file, with the right delimiter and decimal point sign (, and .) and when i press the button read file now i see the values in the txt-file. But when I run the program i get a error with possible reason "End of file encountered".
Next I put in the block "Wait until next ms Multiple" put still the same error appears.
So this doesnt work!
 
How can I solve my problem? Can somebody give me some usefull tips? Has someone else encountered this problem yet? ....
 
Thank you.
 
 
Regards,
Kevin Duerloo
 
 
 
 
 

Message Edited by Kevin Duerloo on 09-23-2005 04:49 AM

0 Kudos
Message 1 of 6
(4,109 Views)
Hi Kevin
 
Do you mind posting your VI ? Or are u only using the supplied example and nothing else ?
 
Could it be your programm (which creates the file) doesn't close it when it's done creating?
 
Try rebooting the system and immediately after that try the labview thing. Does the error still occur ?
 
0 Kudos
Message 2 of 6
(4,092 Views)
Hi, This EOF error is not a fatal error. It simply informs the user that the End of the File has been reached. You will get this error when you put the Read from LVM.vi in a loop. You can use the Enable input from the Read LVM.vi to read the textfile once, than disable it, until you need to read the File again. You could also attach a General Error Handler to the Error out of the Read LVM.vi and set an Exception for error code 4. This way the error dialog box will no longer pop-up. Regards. JorisV
0 Kudos
Message 3 of 6
(4,069 Views)


@Somnatic wrote:
Hi Kevin
 
Do you mind posting your VI ? Or are u only using the supplied example and nothing else ?
 
Could it be your programm (which creates the file) doesn't close it when it's done creating?
 
Try rebooting the system and immediately after that try the labview thing. Does the error still occur ?
 


Hello,

I'm only using the supplied example, the programm closes when it's done creating and rebooting doenst help.

The error means end of file encountered so i think the file isnt updated quick enough for labview. I'm going to try error handling like JorisV said. I will keep you informed if this works or doesnt (I have a lot work so this will not be earlier than tomorrow)

Thank you for the replies.

 

Kevin

0 Kudos
Message 4 of 6
(4,057 Views)

Hi,

The Belgium NI Support has sent me an example to solve the problem and i worked.

People who are interested can contact me, then i will post the vi here.

 

Greetings,

Kevin Duerloo

0 Kudos
Message 5 of 6
(4,022 Views)
Hi Kevin
 
I've got the same problem with importing txt-files in Labview.
Is it possible to send me the vi-solution from NIBelgium.
 
Regards
 
Pierre Schaeffer
 
 
0 Kudos
Message 6 of 6
(3,916 Views)