LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reading textfiles

Hi, 

 

I'm using a data logger to get some data and a software package that write the data continiously in a textfile.

 

Now I want to read the real time data from the continiously changing textfile, with labview.

 

So I want to display the real time data continiously while the data logger is getting the data...

 

How is this possible?

 

 

Thanks

0 Kudos
Message 1 of 7
(3,292 Views)

I don't know, is it possible? Have you tried it? Can you open the text file for read in LabVIEW while the datalogger is still writing to it? Does the text file include timestamps so that you know where you have read up to?

 

Some files get locked when other apps write to them, some don't.

 

I think you are just going to have to do a bit of experimenting.

0 Kudos
Message 2 of 7
(3,277 Views)

Once I had to create a LabVIEW data monitoring and analyser app for an external application, where there was no way to interface. So what I did, I monitored a folder, like checking once every sec or so if there is a new file appears or not. In that case the external application created the files at once, so there was no issue with file access permissions. You should try it, when the text file is under write by your external app, can you read its content with LabVIEW? If so, it should be easy enough. If you do not have access, you might have still the option to copy the file to another location, and read it there...

 

You might find useful this Event based trick too for your development:

https://decibel.ni.com/content/docs/DOC-41654

The benefit in this method is that, you do not have to poll and check the file size continuously, but an Event will be triggered automatically.

 

 

0 Kudos
Message 3 of 7
(3,267 Views)
It would be simpler if you could read the logger directly. What is the make and model?
0 Kudos
Message 4 of 7
(3,244 Views)

Whoever creates the file (your datalogger software) has the option to set permissions on that file.

They could set it to WRITE ONLY, so that no other process can open the file for reading.

They could set it to READ ONLY, so that another process can read it, but not write to it.

They could set it to NO ACCESS, so that another process can't open it at all.

 

That's totally under the control of the other software. 

Unless you have some configuration option to adjust how it writes files (unlikely), then you have to live with however it works.

 

And that's the first question you have to answer.

 

You can tell by looking at a file's status while it's being written.  The Finder, or Windows Explorer, or whatever, will tell you the permissions.

 

I would look for some other option - a decent datalogger should have a way of connecting via TCP, UDP, or something.

 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 5 of 7
(3,233 Views)

It's a K8047 Velleman 4 channel signal recorder. And the software is PClab2000SE...

0 Kudos
Message 6 of 7
(3,215 Views)

"DLL included for own development"

 

http://www.designnotes.com/Merchant2/merchant.mvc?Screen=PROD&Product_Code=K8047&Category_Code=

 

So in principle, you could interface from LabVIEW...

 

dll:

http://www.velleman.eu/support/downloads/?code=K8047

This zip: "K8047/PCS10 DLL and example to write your own software" includes examples for VisualBasic and Delphi how to use the dll.

 

By the way, just google for "K8047 LabVIEW", and you will see there were several posts in this forum already about how to use the dll...

 

0 Kudos
Message 7 of 7
(3,213 Views)