LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Loading varied amount of plots on xy graph

Solved!
Go to solution
Hello I have a program which measures amperage for set voltage and then saves this data as text file with 2 columns, where one is the measured amps and second is the set voltage for which the measurement was made. I want to be able to then load one or multiple (i dont know beforehand how many) files and display their contents as separate plots on one xy graph. Below i attached a sample program which can read text files, but the plots are getting connected together.
0 Kudos
Message 1 of 4
(1,133 Views)
Solution
Accepted by topic author Drago1598

The only missing implementation is that you need to keep on building an array of XY waveforms for each file you load, store in a shift register and display it on the graph.

santo_13_1-1661433677260.png

 

Note - I don't recommend using the Dynamic data type, for the sake of keeping the changes minimal, I decide to leave the dynamic data type as such.

Edit - I didn't test it but if your implementation was working earlier it should continue to work for multiple files.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 2 of 4
(1,119 Views)
Thank you very much. I changed the build xy plot express vi to simple bundle, and stopped changing to dynamic data type and it still works fine.
0 Kudos
Message 3 of 4
(1,096 Views)

A few more comments:

 

  • Place the plot terminal before the event structure so it properly clears, even before new plots are added. Otherwise it will display stale data from the previous run.
  • Index array is resizable. Only one instance needed to get as many columns or rows you want.
  • If you set the file reading to transpose=true, you don't even need to wire indices.
  • You need some error handling if the file IO fails.
  • etc.

Here's how it could look like (simplified).

 

altenbach_0-1661465194429.png

 

 

Personally, I would use a complex 1D array for each plot. Here's how that would look like.

 

altenbach_1-1661465378803.png

 

 

Message 4 of 4
(1,042 Views)