LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I compare folder content with time delay

Hi all, I'm new here, with no programming skills but with a lot of LV manuals read 🙂
So, there is a C-smth program  - no source. It writes .avi file in folder if event has occur, and it names that file with exact time (yyyy-mm-dd-hh-mm-ss) of that event. Using DAQ and program "written" in LV 7.1 I record voltage, but I don't need to store that if nothing new is written in that folder with .avi files. However if smt new is in it 4 minutes before and 4 minutes after event has to be recorded and stored  by LV.

I have no idea how to do this!

My major problem is comparing content of the folder with that folder but say 1 sec before.
Any suggestions?

Izidor
0 Kudos
Message 1 of 6
(2,991 Views)
Can't you just poll the directory's contents with list folder (under advanced file functions).
0 Kudos
Message 2 of 6
(2,989 Views)
Yes I can. Then  I need one more information about content 1 sec before and compare that two. But if I do simple while or for loop all i can see is present time folder content.
0 Kudos
Message 3 of 6
(2,982 Views)
Use a shift registry to keep track of the last time you polled and wait until they're different
Message 4 of 6
(2,979 Views)
Thanks, that helped!  🙂
But still I can't do it  all.
Is there any way to simultaneously record from DAQ and run this? I need to break this loop to carry boolean out of it and if it's true it initialize case structure that store data. But, the loop has to start over the moment boolean is out. Is that possible? I'm thinkng of migration to python for this...
0 Kudos
Message 5 of 6
(2,965 Views)

Izidor,

You could use two different loops and share the information between them using Queues or Notifiers.  One loop could be acquiring data and sending the datapoints to a consumer loop using the above mentioned methods.  The consumer loop would then check the folder for files with recent timestamps for names and save the data to a file.

There are examples in example finder (help>>find examples) for Queues and Notifiers.  Also press "new" at the LabVIEW Getting Started Window for looking at the producer/consumer architecture.

I hope this helps.

Steven T.

0 Kudos
Message 6 of 6
(2,950 Views)