02-21-2018 09:58 AM
Hi,
1. I am trying to plot graph produced from already existing file. While running the code I want a dot to read the values in already existing plot like comet in MATLAB.
2. I am trying to plot an already existing plot from right side while another plot is coming from left side. The plot from right side is from already existing file and the plot from left side would be the identical points but in real time.
I am new to labVIEW and mainly when it comes to plotting two different graphs. I am able to plot two different graphs. But not in the fashion I have written above.
Thank you in advance.
02-21-2018 10:43 AM
@dib1205 wrote:
Hi,
1. I am trying to plot graph produced from already existing file. While running the code I want a dot to read the values in already existing plot like comet in MATLAB.
I didn't know what a "plot like comet in Matlab" meant, but this sounds like a Chart. Do you know the difference between a Chart and a Graph? Basically, a Graph is where you put all the points down "at once", while a Chart is you add points "one at a time" and they either "scroll" (like a Strip Chart Recorder) or "Sweep" (like an oscilloscope) (there's a third mode, as well).
2. I am trying to plot an already existing plot from right side while another plot is coming from left side. The plot from right side is from already existing file and the plot from left side would be the identical points but in real time.
Not sure what you want to do here. However, the "plot from the left side" sounds rather like a Chart. Do you want a "static plot" ("right side") + a "dynamic plot" ("left side")? And if so, why? Might be easiest to have a Graph (existing plot) and below that a Chart (real time, new points) ... Alternatively, you could make a Chart with two plots, Channel 1 the "existing plot" (plotted one point at a time) and Channel 2 the "incoming data" ...
Bob Schor
02-21-2018 11:35 AM
Thank you Bob for replying.
1. The question you have asked is exactly my problem. I want to plot a graph before taking the data in real-time and overlay on the existing plot point by point like a chart.
2. The options you have told me in 2nd question, I have tried that. But to match the amplitude and frequency of both (static and dynamic) plots, the way I have suggested is more helpful.
02-21-2018 12:15 PM
Are the x-values spaced equally?
Do the x-values match up between the plots?
To incrementally overlay new data to an existing plot, you would start the second plot with a matching array of NaNs, keep it in a shift register, and incrementally replace elements with the new data while graphing both with each update.
02-21-2018 12:59 PM
Take your "Static" waveform. Plot it on a graph
Export it as a simplified image (There is a Method for that! so just use an invoke node) Choose your options wisely. (trial and error works well)
Then, if you are really good.....
02-21-2018 01:35 PM
02-21-2018 02:10 PM
Thank you so much for replying. Your code is not compatible to mine and mine is lower version i.e., 2011. That's why I couldn't download. But I looked at the picture of the diagram and I made mine. The problem is when I am passing the value after x^2 it is not going as an array but n element. That's why I am not able to plot. Using Build array is also not helping me. But I think this is a nice solution if it works in my version.
02-21-2018 02:24 PM - edited 02-21-2018 02:27 PM
Right-click the tunnel and disable indexing so it looks like in the picture (solid orange)..
Here's a 2011 version.
02-22-2018 11:17 AM
Hi,
Thank you for your reply. Your program works fine. But when I am substituting the sine wave with the data from the already existing file it is plotting the data from at 30000 to 60000 point (data length is 30000) and it starts reading real time signal from 0 to 30000. But I want my program to work the way your code is working. Is there any problem with version? Because when I tried running your code after changing the node indexing it was happening with your code also.
Thank you.
Dibyajyoti
02-23-2018 10:50 AM
Maybe your "built array" is set to "concatenate". Make sure it outputs a 2D array and not a 1D array.
If this does not solve the problem, please attach your code.