10-27-2020 07:11 AM
Hi,
I have a project where I get data via a network stream. I display these data in a diagram. Now, I want to select a time range in that diagram and make a FFT of the displayed data. How can I get just the displayed data of a that diagram? Has anyone an idea?
Thanks
10-27-2020 07:20 AM - edited 10-27-2020 07:20 AM
@volleymar wrote:I have a project where I get data via a network stream. I display these data in a diagram. Now, I want to select a time range in that diagram and make a FFT of the displayed data. How can I get just the displayed data of a that diagram? Has anyone an idea?
Selecting a time range can be done with two graph cursors.
Getting a time range can be done with an array subset.
An FFT is a function.
Display it in an indicator...
10-27-2020 07:24 AM
I'd also recommend you change your user name so it isn't your email address. You can expect tons of spam coming your way, as every robot on the web can and will read it...
10-27-2020 07:28 AM - edited 10-27-2020 07:30 AM
Hi m.,
@volleymar wrote:
I have a project where I get data via a network stream. I display these data in a diagram. … How can I get just the displayed data of a that diagram? Has anyone an idea?
A "diagram" (aka "chart") is something different than a "graph". Which of these two do you use?
A chart/graph is just an indicator: you should not read data from an indicator. Instead you should keep an history of the data on your own to be able to process the data!
It really would help when you would provide your VI for such questions…
10-27-2020 08:33 AM
Thanks for the quick reply.
I use a chart.
At the moment I read the data with a resolution of 1ms from the network stream. I save the last 5000 values in a shift register and do a FFT of these values. But now I just want to analyse a selectable time range. And I try to find a good way to select the range and to get the data of this range.
I attached a screenshot. But that code works. For the realization of the new problem I have no VI at the moment, because I don't have a solution how I can solve the problem. My first idea was to select the time range in the graph, to get the data from the graph and finally to do the FFT with these data.
Best regards
10-27-2020 08:54 AM - edited 10-27-2020 08:55 AM
Hi volleymar,
@volleymar wrote:
Thanks for the quick reply.
I use a chart.
…
My first idea was to select the time range in the graph, to get the data from the graph and finally to do the FFT with these data.
Do you use a chart or a graph?
Again you failed to attach your VI…
@volleymar wrote:I save the last 5000 values in a shift register and do a FFT of these values. But now I just want to analyse a selectable time range. And I try to find a good way to select the range and to get the data of this range.
So you have a buffer holding data for 5s (5000 samples for dt=0.001s). To select a "time range" you just need to multiply the time value (in seconds) with 1000 (your sample rate) to get the amount of data to be processed by FFT…
In the end it's just an ArraySubset function you need to apply on your collected data array!
Code improvement:
Instead of "<0" followed by that Select node you could use the MinMax function…
You can easily determine the number of rows and columns of a 2D-array using the MatrixSize function: this also accepts all 2D-arrays!