06-14-2022 07:20 AM - edited 06-14-2022 07:22 AM
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
06-14-2022 07:45 AM - edited 06-14-2022 07:46 AM
You just need to add a FOR loop over most of your code.

06-14-2022 08:47 AM - edited 06-14-2022 08:48 AM
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?
06-14-2022 10:12 AM
Yes, Get File Extension will give you the stripped filename and with Property nodes you can index a plot and set its Legend.
06-16-2022 04:43 AM
you mean something like this?
Unfortunately, it is not working. Where is my mistake?
07-04-2022 05:12 AM
@patrick_1_baker wrote:
you mean something like this?
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.
07-04-2022 10:37 AM
property nodes are executed from top to bottom, the active plot (ActPlot) must be the first entry in the property node
07-05-2022 10:17 AM
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.