09-11-2017 05:50 AM
Hello everyone,
I have to plot a graph by retrieving data from running file.Then,selected portion of the graph is to be displayed by giving X and Y values range.Which type of graph suits this requirement?Waveform graph,chart or XY graph?
I'm new to Labview. Advice is much appreciated.Thanks in advance.
09-11-2017 06:08 AM - edited 09-11-2017 06:08 AM
If you have data for 2 axis use an XY-graph.
Jens
09-11-2017 06:20 AM
Time stamp is in X-axis,data is in Y-axis.
09-11-2017 06:26 AM
@hmshwe wrote:
Time stamp is in X-axis,data is in Y-axis.
If the sample rate is constant (ie the time between samples is always the same), then build a waveform (you will need the time of the first sample and the sample rate) and use a Waveform Graph. Otherwise use the XY Graph.
09-11-2017 06:34 AM
If I use XY graph,static data can be plotted,but dynamic data is not getting displayed.
09-11-2017 06:38 AM
@hmshwe wrote:
If I use XY graph,static data can be plotted,but dynamic data is not getting displayed.
Then you are doing it wrong. Maybe you can share your code?
09-11-2017 06:49 AM
this is my code.
09-11-2017 06:54 AM - edited 09-11-2017 06:55 AM
In that case try to use a Waveform graph, not a chart. And forget about the For-Loop.
Jens
09-11-2017 07:00 AM - edited 09-11-2017 07:01 AM
Use an XY Graph
09-11-2017 08:34 AM
What do you really want to do? What format is your data? What do you mean by "plot dynamic data"?
I'm going to "make up" answers to these three questions (which may be entirely wrong for your situation) and then give a completely different answer to the suggestions that have been made here. I assume:
If this is the case, namely you want to see the signal evolving in time (as opposed to examining the entire signal "all at once in a single image", you would use a Chart to display the results (as this gives you the evolving image). When reading the data, you would mainly read the "data channel", using the "time channel" just to get the "dt" (time between samples) to set the X axis properties so it showed elapsed time (in milliseconds, seconds, minutes, hours, whatever is appropriate for your data). You'd present the Y data points one-at-a-time to the Chart (using For or While loops) with a Wait (ms) inside the loop to "clock" the display update as appropriate.
So that's another option if this is what you really intend. However, I agree with my colleagues that a Graph is more appropriate if you want "all-at-once" displays. However, if the actual time that the data was acquired (e.g. 11:45 am, 6-Jul-2016) isn't important, you can simply create a single Y array of data and not present X, but let it be "implicit" (scale it by setting the X Axis Properties appropriately).
Bob Schor