LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

selecting different parameters for same plot

So I am currently working on a VI to integrate on a system. In this VI I would like to have a plot that will aloow me to select different parameters for both X and Y axes. I was thinking of having a drop down menu with the different parameters, ie Time vs Pressure, Pressure vs Temperature. How can I go about making this?

I would also like to have the choice of plotting multiple signals on the same graph, ie Temperature 1 & Temperature 2 vs Time.

Right now I am only able to graph one paramater vs time, I am graphing Pressure vs Time on this current VI.

 

Thanks for the help

 

 

 

0 Kudos
Message 1 of 11
(4,064 Views)

Create all the plots in clusters of X[],Y[] then simply build an array and wire it to an xy graph.  Use the plot visability check boxes to display the ones of interest and a property node to set the scale units (autosizing should handle the scaleing)

Example_VI.png


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 11
(4,052 Views)

You did not mention, whether you want an online plotting feature, or you have already all data, and you just want to plot them? The following regards to the online data collection case:

I would go with a XY-Graph. I would store the XY value pairs in arrays (or you can go with cluster and arrays inside), and building them incrementally. You can store them in shift register(s), but also think about how to avoid the memory leak (if your shift register(s) reaches a size limit, delete some data from the beginning).

The drop-down menu could be connected to an Event structure, where you can change the axis labels via property nodes, and also change the source of data for the Graph.

 

edit: you can also add multiple Y-axis to the Graph, if you find it useful

0 Kudos
Message 3 of 11
(4,047 Views)

Blokk,

I have all the data I am using to graph. I am reading this data from an instrument. And I am able to add multipe Y-axis data to my plots, but I would like to plot different parameters on both X and Y. I would like to have the ability in the front panel to choose what to graph.

 

Jeff,

What you showed in the picture could be a possible solution to what I am looking for. Only thing is I dont understand what you mean with clusters of X and Y. Is that just simply creating a cluster? I cant find any relevant operators in the cluster, class, & variant pallette, other than bundle or cluster to array.

 

Thanks for helping to both of you

0 Kudos
Message 4 of 11
(4,038 Views)

This is what I meant

Capture.PNG


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 11
(4,029 Views)

Julian,

If you already have the data, I would go with Jeff's solution as it is probably the best and simplest way to solve your problem.  As for changing the actual name of the scale you could use property nodes (X or Y scale label text) to facilitate that functionality.

Aaron L.
Applications Engineer
National Instruments
0 Kudos
Message 6 of 11
(3,997 Views)

I am trying to implement your solution, but when I run the VI i only plot for one instance and it doesnt seem to get the real time data I am reading. The graph sort of chokes up. The word doc below contains screen shots of what I am talking about and of my code.

 

 

0 Kudos
Message 7 of 11
(3,979 Views)

@julianv23 wrote:

The word doc below contains screen shots of what I am talking about and of my code.


There is no word doc anywhere. Please attach your actual VI instead of pictures or word documents.

0 Kudos
Message 8 of 11
(3,972 Views)

yeah sorry I just noitced that

0 Kudos
Message 9 of 11
(3,970 Views)

You should not be using a sequence structure within your while loop, because it looks like your data flow between subVI's should ensure that already and could be "choking it up" before it publishes to the graph. 

Aaron L.
Applications Engineer
National Instruments
0 Kudos
Message 10 of 11
(3,960 Views)