LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to plot data from text based on selected Date interval?

Solved!
Go to solution

Dear Friends;🌺

 

I am saving text data from 7 pressure sensors. 1st column is the Date and 2nd is Time and rest are variable data. The Date and Time which I am reading form text file will shows on X axis.

 

Now I want to plot these sensors data in graph with selected Date interval. but I didn't found a way. 

Please let me know if there any possibility to solve this problem.

 

My VI code and data file are attached here.

 

Thank you in advance for your help.

🙂🙏

If you see dark, think of light
Download All
0 Kudos
Message 1 of 12
(1,894 Views)

You have two entries for the time (date and time). You will have to concatenate those into a string from which you can convert to a timestamp with the scan from string function.

 

String-to-timestamp.png

 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YHbRCAW&l=en-US 

Message 2 of 12
(1,875 Views)

How about something like this?

WTF-XYCapture.PNG

 

Plot the graph once and use property nodes to change what you see on the graph.

 

Edit: I made it so you can chose the file and update the graph without restarting the program...

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 12
(1,855 Views)

I am thankful with your guidance.
I think if the amount of data is limited, it is a good solution.
Unfortunately, my software version is 2017 and I could not run your file with the software version 2021.
Please save and send your file with version 2017 or less.
Thank you RTSLVU

If you see dark, think of light
0 Kudos
Message 4 of 12
(1,841 Views)

Thank you StevenD 

But I could not implement your idea.
Maybe I need more time!

If you see dark, think of light
0 Kudos
Message 5 of 12
(1,832 Views)
Solution
Accepted by topic author H.goodarzi128

Here is is saved for LV 2017

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 6 of 12
(1,823 Views)

I used your idea and my problem was solved. Also, modifying and optimizing my code was a great help. Thank you so much for helping me.

🙂🙏🌹

If you see dark, think of light
0 Kudos
Message 7 of 12
(1,806 Views)

The problem that remains is what to do if the volume of data increases (for example several million data lines) and it is not possible to plot them all at once?

If you see dark, think of light
0 Kudos
Message 8 of 12
(1,786 Views)

@H.goodarzi128 wrote:

The problem that remains is what to do if the volume of data increases (for example several million data lines) and it is not possible to plot them all at once?


Hmm... What makes you think you can't plot them all?

 

Sure, you are ultimately limited by the 4GB physical RAM barrier for 32 bit applications, but that's a lot of data points. Not to mention monitor resolution would limit how many points you could actually differentiate on the screen anyway.

 

I would probably just limit the data file to a reasonable size when collecting the data.

 

 

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 9 of 12
(1,773 Views)

Yes that's right
Limiting the data file size would be best done.

Assuming that the written code stores the sensor data in a text file, how can it generate a new file every month (or every day) and store continued data in it to prevent the previous file from increasing in size?


Thanks again for your guidance and help

If you see dark, think of light
0 Kudos
Message 10 of 12
(1,721 Views)