From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
10-17-2006 02:54 PM
10-17-2006 03:06 PM
10-17-2006 03:09 PM
Duh...ok, how do I get Windows Scheduler to run a particlar LabVIEW vi? I'm sure I'm overlooking the obvious, but have pity on my poor tired brain.
10-17-2006 03:16 PM
10-17-2006 03:20 PM
10-17-2006 04:00 PM
OK, I have the vi running just the way I want. Not only do I want it to execute once a week, but I want it to constantly display how many hours remain until the next execution (so I want it to run 24/7). Part of the functionality requires that I have a target date/time, so that I know how much time is remaining until it executes. What I need to do is figure out how, after it executes this Sunday, to rest the target date/time, advancing it by 1 week (7 days or 168 hours or 1080 minutes or 604,800 seconds). I need to find out how to advance the Target Date/Time block.
10-19-2006 03:52 PM
You can place an elapse time express VI in the while loop and specify the duration (eg 604800 sec) and also set it to auto reset. Wire the "Time has Elasped" output of this express VI to a case stucture. Implement your code in the true case and calculate the remaining time in the false case.
Tunde.
10-15-2019 05:14 PM
You probably solved this issue already, but here is a solution for anyone interested. The VI runs once every day at the same time. You would need to modify it to increase a week instead of a day to the target time.
Cheers,
David
10-15-2019 05:45 PM - edited 10-15-2019 05:50 PM
Have you tried running your VI? I doubt it works very well.
First, you have no wait statement in there so that thing is going to burn up your CPU doing nothing but checking the time. A small wait in there would reduce your CPU % tremendously. Your VI doesn't run "every day at the same time". It runs every day all day long.
But the big problem is you are subtracting two floating point values (the timestamps) and comparing them to zero. Actually you are rounding to nearest, so you may get lucky, but in general comparing floating point numbers for equality may never match even though you think they do. Or if you do wind up with a small delay in your VI because Windows decided to get busy doing something else, you might accidentally skip over the point in time where the difference is zero.
Why not see if the time is greater than or equal to zero? (Or maybe less than equal to, depending on the signs of the logic.)
10-17-2019 11:33 AM
The VI it's been running for 5 days now with no problems. I agree, a small delay would reduce the CPU % and I should probably add it, but if you want to check the time using labview then there's no other way around it. The VI has to run continuously checking the current time so you can compare it. Only other way to do it is using the Task Scheduler but I want to only have labview running and not rely on another app.
At the moment, the VI has a window of 0.5secs to react to the triggering signal. If you increase this range too much and you only want to run your program once, it might run a few times within this window depending on how much you need to process. I am comparing a rounded decimal = integer to zero. No problems with that.