LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

plot multiple.txt files

Hi guys,

 

I have quite easy question, however, due to my low experience, I am not able to solve it.

I have multiple .txt files which are consisting two columns each (temperature and intensity).

I would like to compare visually these files ( temperature vs intensity), means e.g. choose a number files (let say 7) and plot them.

 

I manage to do it for one single file (see below). How can I do this for multiple files?

 

All the graphs should be then in the same plot.

 

Thanks a lot,

Patrick

 

1Michal0_0-1655209190557.png

 

0 Kudos
Message 1 of 8
(1,994 Views)

You just need to add a FOR loop over most of your code.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 8
(1,976 Views)

thanks a lot.

 

is it possible to assign parts of the path as a legend to the plot?

means e.g. C:/.../20200101.txt to have it as 2020101 in the legend of the plot?

 

 

0 Kudos
Message 3 of 8
(1,953 Views)

Yes, Get File Extension will give you the stripped filename and with Property nodes you can index a plot and set its Legend.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 4 of 8
(1,942 Views)

you mean something like this?

 

patrick_1_baker_0-1655372541698.png

Unfortunately, it is not working. Where is my mistake?

0 Kudos
Message 5 of 8
(1,899 Views)

@patrick_1_baker wrote:

you mean something like this?

 

patrick_1_baker_0-1655372541698.png

Unfortunately, it is not working. Where is my mistake?


Sorry, i missed there were updates in this thread.

You need to use Active Plot-property first, then you can set that ones Plot.Name. Repeat for every plot as needed. Thus it works better to do within the loop.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 8
(1,847 Views)

property nodes are executed from top to bottom, the active plot (ActPlot) must be the first entry in the property node

 

Spoiler
plot-id.png
Message 7 of 8
(1,825 Views)

The code above in https://forums.ni.com/t5/LabVIEW/plot-multiple-txt-files/m-p/4241064#M1232806

works best for a freshly spawned XY Graph with out any data, and any plots.

 

Tinkering with the XY Graph can creat new plot id, especially increasing the "Plot Legend" via mouse drag.

 

when an implicit property is linked to an xy graph, both the xy graph and the property node will be deleted, if the xy graph is deleted.

therefore it can save sometime to use an explicit property node togeteher with a static reference.

 

A freshly spawned XY Graph appears to have no plot IDs, indexing a non-existing plot ID can throw a Warning (Error 1077 invalid property), but  can be ignored safely, as far as I have tested.

 

Spoiler
plotid_rev2.png
0 Kudos
Message 8 of 8
(1,810 Views)