LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to I only run my vi once daily?

Hi,

I am running this vi to generate reports daily, currently I am running it all the time and using the wait function to only generate a report daily.  The problem is that my ftp client will not upload any htm files generated from this vi while it is still running as they are 'being used by another [labview] program'. 

What I wanted to do was only to run this vi once daily, I'm sure this is possible but I can't find a solution.  Does anyone have any hints?  Greatly appreciated, thank you.

I have attached my vi.

Laura
0 Kudos
Message 1 of 7
(3,715 Views)
  • Get rid of the loop.
  • Place the VI in a loop with a convenient wait of less than a minute (I use an event structure with a timeout so I can easily stop the loop).
  • Use any of the date\time VIs to check that the time for running your VI has come (use the Equal? node, for instance) and then use a shift register to remember that state - once the VI is run, it should not be run until the time for saving passes and then the SR should be reset. There are of course more elegant ways to do this (for instance, I use a change detector VI - you can find one at Openg), but that's the basic concept.

___________________
Try to take over the world!
0 Kudos
Message 2 of 7
(3,702 Views)
In Windows there is a start menu item called scheduled tasks. You use that to run programs based on the clock. This is how virus scanners do there periodic file system checks. In Linux it is called a cron job and you have to fill out an entry in the crontab file, which I think is located in /etc.
0 Kudos
Message 3 of 7
(3,699 Views)
Thank you both for your help, i have gone for the windows scheduler solution but I am just not sure how to make my vi run automatically on opening?  thanks, laura
0 Kudos
Message 4 of 7
(3,669 Views)
With the VI open go to File>>VI Properties. Then, in the "Execution" section select "Run when Opened". Save.

If you're going to run it from the Windows scheduler you may want to consider making it into an executable. Keeping it as a subVI means that LabVIEW will load and once the VI is finished it stays open in the development environment unless you add a bit of code to quit LabVIEW.

Message Edited by smercurio_fc on 03-10-2006 09:30 AM

0 Kudos
Message 5 of 7
(3,660 Views)
thank you.  yeah i tried that but i kept getting an error about one of my vi's which i was appending the front panel of to the report not being in memory, although i did have it open.. hmm.  anyway this is great as it is sufficient for the task in hand.  thanks. laura
0 Kudos
Message 6 of 7
(3,654 Views)
If I remember correctly, some of the report generation VIs are called dynamically and so you need to include them in your build as dynamic VIs for them to be included in the exe.

___________________
Try to take over the world!
0 Kudos
Message 7 of 7
(3,633 Views)