LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I create a 5 minute window?

Solved!
Go to solution

What I am trying to do is make a 5 minute window of events that happened last in my application. For some reason, I cannot get the "5 minutes"  to be just that. Here is what I want to do:

 

I want to have events from the event structure written to a file (easy - done). After a specified amount of time ( 5 minutes ), the writing that was happening into this file "fileA.txt" ends. After this ends, a new file is created and the process of writing data to that file continues into this file "fileB.txt". Here's the tricky part: Again now, after 5 minutes, I want to replace the entire contents of "fileA.txt" with new data in this new 5 minute window. This process continues until the VI stops arbitrarily.

 

The goal with this is after a certain base amount of time that the VI has run, I always have AT LEAST the last 5 minutes of data that occured in the application. Worst case scenario I have only "fileA.txt" in its entirity, best case scenario being I have "fileA.txt" and for example 3 minutes and 30 seconds of "fileB.txt".

 

I would greatly appreciate any insite into how to finish this. The reoccuring problem for me is that I am constantly getting the Error 1, GPI ....... when the VI tries to write to text file.

 

I need to do this so I can troubleshoot another VI that keeps shutting down for some reason. 

 

Here are my 2 tries at doing this:

Download All
0 Kudos
Message 1 of 3
(2,450 Views)
Solution
Accepted by topic author Hub25

The common way of disabling controls is to ... disable them.

You're mixing different attempts at solutions and throws code, use 1 event-structure.

 

I've attached a skeleton, there's no real error handling, but it should get you started.

 

You can easily add a Disable-event if time is more than 5 seconds.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 2 of 3
(2,425 Views)

Thank you, I very much appreciate your input and feedback on this. I did not think of this view point. Kudos to you!

 

-Hub25

0 Kudos
Message 3 of 3
(2,385 Views)