LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plotting Tab/Space Delimited Data on X & Y Graph

Solved!
Go to solution

Hello Labview experts!

I recently started programming using LabView and I will admit that I am a complete rookie. 

I have been given a task to plot already aquired tab/space delimited data in a X & Y Graph, to further display and be able to analyze data.

 

I have a document with data containing around 14000 "rows" and 16 "columns" and now I want to plot this seperately on a X & Y Graph. 

My actual time (X) is 1 ms per row, so 14 seconds worth of data. 

I would not mind having separate "pages" on the X & Y Graph, actually 16 pages, to display the different data on different Graphs, while still containing just 1 graph in the actual program. I think this would be the best solution, but I am up for suggestions. 

So, below I have attached my attempts, using Altenbachs VI for dirty spreadsheets, trying to sort my data into arrays, yet I am not there just yet.

 

I need it to be float. Also I do not know how to actually connect my data and the X & Y Graph to the actual VI that Altenbach created.

 

I have several other VIs of my attempts to solve this task. I just dont know where to go about it. I have solved it with code and I can display it using LINQPad 5, but I need to build an application for this. Any guidelines on what to do, is MUCH appreciated! 

Emil

 

Download All
0 Kudos
Message 1 of 21
(3,482 Views)

Note: I have been trying to sort my data using Index Arrays and much else, with no luck. Hence why I am now linking the Altenbach VI above.
I'll link a VI that resembles VERY much what I want to do, but my problem being that I cant seem to figure out how to handle the data with it. And also, every Y value needs to be plotted against the 14000 rows, since thats my time, X. 

If I could just mix and match, that would be so easy! 

 

Emil

0 Kudos
Message 2 of 21
(3,452 Views)

Hi Milleh,

 

your data file is SPACE limited data - but worse as it uses multplie spaces between data elements…

 

I could plot X vs Y like this:

check.png

Read the text file, convert all multiple spaces into single ones, convert to array data, get rid of the header and the first column (due to lines starting with SPACE chars), choose two columns to plot as XY plot…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 21
(3,427 Views)

Re-creating the VI in the picture right now. Looks good, will try it out! Taking me some time to re-do it, though! Hope it works, looks promising! I will keep you updated. Thanks!!

0 Kudos
Message 4 of 21
(3,413 Views)

Hi Milleh,

 

please note the display mode indicator of the string constants! The displaymode is important here.

Recommendation: always make the display mode indicator visible for string constants. (The same applies to the radix of integer constants.)

 

Btw. my image is a snippet, you can drag&drop it into LabVIEW to get the block diagram. (Atleast when you use LV2017 like I did.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 21
(3,410 Views)

Alright. I have now completed the VI of yours. Problem is that its only reading my data on 1 line. I wish to read ALL the rows in P1, ALL the rows in P2, separately. 

I am only seeing one line of data as of right now. And it is not displaying on my graph. 

 

Not sure what I am doing wrong, so I will link my VI again. 

 

Emil

0 Kudos
Message 6 of 21
(3,408 Views)

Hi Emil,

 

right now I'm stuck with LV2011, so could you save your VI for this version? (File -> save for previous…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 21
(3,398 Views)

Here you go! I recon... 

 

I just gotta add that I appreciate you helping me! Kudos away... \o/

 

Emil

0 Kudos
Message 8 of 21
(3,395 Views)

Hi Emil,

 

Problem is that its only reading my data on 1 line.

Well, you have programmed it this way.

At ArraySubset you have it wired to give you just one row. I didn't do it this way in my snippet above…

 

I wish to read ALL the rows in P1, ALL the rows in P2

There is no P1 or P2 in your VI, so what are you talking about?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 9 of 21
(3,389 Views)

Ah, yep, I see that now! I changed it and now it is working better, for sure! 

 

There is still some small changes that I would like to implement. 

The displayed data does not have decimals anymore.

It is also rounding my data. I would love for it to be precise with all the decimals.

 

In my data document that I attached, there is columns that say P1, P2, etc. 

So I would like to read all the 14000 rows thats in column P1, against time, which is also 14000 rows.

This will show the data for the P1 itself. If there is a way to add Pages on the X Y Graph, to separate all the 16 columns worth of data, into the graph, but yet keep just one graph, thats what I am going to try and achieve. 

 

Here is a showcase of me doing this in code. A little gif, showing the P1 data displayed by itself.

Regards, Emil

0 Kudos
Message 10 of 21
(3,384 Views)