LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plotting data from text file

Hello, I started using Labview from few days and my first need is to plot some data reading it from a text file.

Attached an example of data file I need to read and plot.

Thanks for helping me.

 

0 Kudos
Message 1 of 13
(4,412 Views)

Hi Cadilac..

 

You can read this into LabVIEW in a number of ways, I would personally used the read spreadsheet VI.

 

Read spreadsheet

 

You can skip the first few rows (i.e. the header) and then perform some string manipulation to separate the numeric values from the units.

 

Or you can save your data  (assuming you are the person generating it) in a way that is easier to import and parse.

 

Ingram

Ingram | CLA
0 Kudos
Message 2 of 13
(4,365 Views)

I'd break this problem into several parts.  I assume you know how to get the Help text for a function (if it's on your Block Diagram, right-click it and choose Help from the Drop Down menu).

  • Read the Text file into an Array of Strings (a single function will do this for you -- look up the "obvious" Text Read function, and read its Help text carefully).
  • Put down a Structure that will automatically process Array Elements one at a time (hint -- it's a kind of Loop).
  • Figure out how to parse a String.  I recommend looking at Scan from String, which can take in a String and spit out two numbers (if they are present).
  • Build an Array of numbers (or "cluster" the MHz and DBm values and output an Array of Clusters) for those lines that have valid data (i.e. automatically eliminate the first three lines without needed "identify-the-line" logic).

Things you need to know to come up with the "simple" solution I described include:

  • How Arrays interact with Loops, specifically how Indexed Tunnels work.
  • How to add a Conditional Terminal to an output Tunnel.
  • How Scan from String "reacts" for "unexpected" inputs.

Hint -- all three of those "things" are related to the output tunnel.

 

Bob Schor

0 Kudos
Message 3 of 13
(4,343 Views)

Thanks Bob,

I'm trying to follow your precious suggestions but for the moment I have still some issue.

Give me another few days and if I'll be not able to make it working I'll ask you again something.

Regards,

Edoardo

0 Kudos
Message 4 of 13
(4,314 Views)

Hello.

 

Please have a look on this VIs.

 

I've implemented for you.

I think, I've understood your problem.

Download All
0 Kudos
Message 5 of 13
(4,302 Views)

That's exactly what I had in my mind.

The project is really more complicated than what I was thinking but probably this was beacause of my inexperience in LabView.

I'll look deeper in your VIs to understand how it is working.

Many many thanks for the help Hayk.

Just a little question ... do you have some book to suggest me to learn LV ... or do you think is better to learn with LV help and examples ?

Thanks again for all.

Regards,

Edoardo

0 Kudos
Message 6 of 13
(4,283 Views)

The only physical LabVIEW book I've seen is called the LabVIEW Style Book by Peter Blume. It's about $50 used on Amazon. It's a little dated, and may not show the latest and greatest features, but it's a good read.

 

If your company recently purchased LabVIEW, you should have access to online classes through your SSP. The Core 1 and Core 2 classes would be great for a beginner to go through.

0 Kudos
Message 7 of 13
(4,276 Views)

When I started with LabVIEW (about 10 years ago), I read Jim Kring's "LabVIEW for Everyone", which explained many of the (older) LabVIEW functions (pretty encyclopedic), and Peter Blume's "The LabVIEW Style Book", which taught me to "think LabVIEW" and the importance of LabVIEW Style.  I actually read that cover-to-cover at least 4 times.

 

I've urged both authors to write a new Edition (and volunteered to "critically proof-read it" for them) -- maybe next year.

 

Bob Schor

0 Kudos
Message 8 of 13
(4,272 Views)

Hello.

 

My opinion is to learn with LabVIEW Core 1 and Core 2.

You need to read course manuals and do its examples.

 

After that you need to do a lot of programming exercises for your practice skills (for example implement Windows Standard Calculator).

0 Kudos
Message 9 of 13
(4,262 Views)

Thanks for the suggestion Gregory

Edoardo

0 Kudos
Message 10 of 13
(4,235 Views)