LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Filtering the graph value using the time

Hi,
I am writing a program that retrieves data from the Microsoft Access and plots it on the XY graph.
Plotting datas on the graph can be done but i have to add some filter so that the graph only shows the plot from certain time to a certain time period.

I really appreciate your help and thanks in advance!
Best Wishes,
KP

0 Kudos
Message 1 of 12
(3,550 Views)

What is the structure of your data ?

 

If you have just pure x + y struct and the time is determined by the index of the element, you can use array functions.

 

snip.png

 

If your data has bundled time info, all you need is to search the array for start index and an end

 

snip.png

 

0 Kudos
Message 2 of 12
(3,532 Views)

It's a string data created using Get/Time function and insert it into the Data Base.
Now i want the user to select from which time period to which period and only this filtered part will be shown on the graph.
thanks Bublina! 😄

0 Kudos
Message 3 of 12
(3,523 Views)

@KaungPyae wrote:

It's a string data created using Get/Time function and insert it into the Data Base.
Now i want the user to select from which time period to which period and only this filtered part will be shown on the graph.
thanks Bublina! 😄


This is basically what the 2nd code I posted does.

Message 4 of 12
(3,516 Views)

Why don't you apply the start/stop time filter to your database query?

Message 5 of 12
(3,514 Views)

@Dennis_Knutson wrote:

Why don't you apply the start/stop time filter to your database query?


If the user can control the filter parameters, I believe it is more suitable to execute one query and fetch all the data.

 

I would fetch all data, put these into XY Graph object, and only control the scale properities of the object.

Message 6 of 12
(3,506 Views)
Just keep in mind that returning ALL data can be more time consuming than a small subset. Its pretty simple to time your query to see which is the most efficient. Also, keep in mind that your database might be pretty small right now but will be much larger in a few months or years.
Message 7 of 12
(3,502 Views)

hi bublina,
my data bundle is in such form. and i'm having trouble putting into the graph the way you show me.
Please help me.
Thanks,
Kaung Pyae

0 Kudos
Message 8 of 12
(3,453 Views)

Hi, could you provide labels to your data struct ?

 

I am a bit confused what do those elements mean.

 

 

If you need to post pictures use :

 

Mark the block diagram you want to show to other users,

 

Go Edit in the menu bar and Create Vi snippet from selection

 

It will save a PNG you can paste to discussion board and it has also block diagram code in it so we can all run it.

 

 

0 Kudos
Message 9 of 12
(3,439 Views)

This is part of the Sub Vi. Thanks for fast reply.

Here is the attached file.

0 Kudos
Message 10 of 12
(3,433 Views)