LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get the data which are actually displayed in a diagram?

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

0 Kudos
Message 1 of 6
(968 Views)

@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...

0 Kudos
Message 2 of 6
(960 Views)

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...

0 Kudos
Message 3 of 6
(954 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(951 Views)

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 

0 Kudos
Message 5 of 6
(925 Views)

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!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(921 Views)