LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically starting and stopping my vi at set times

I have a vi that runs during every production shift, however the running and stopping of this vi is currently manual, requiring a user to start and stop the vi at the appropriate times. I would like a way of programming the vi so that it starts every weekday at 6:55am and stops every weekday at 15:05pm. All my while loops run if engine status is TRUE, so I wondered if starting/stopping the engine appropriately would be sufficient. I will need to reinitialise all my values from the previous day – does this happen automatically by stopping/restarting the engine? I would also like to ignore weekends if possible.

I have attached the vi that I would like to automatically start and stop. If anyone knows the best way to program this (slightly messy) vi, then I would greatly appreciate the help.

Thanks to all,

Stuart

0 Kudos
Message 1 of 8
(4,936 Views)
I added yet another while loop to your program that will start and stop at the correct times that you specify.  I included comments in the program to try to make it easier to implement.

I would really recommend that you use subvis in order to clean up your program a little.  I couldn't really follow much of it with all the while loops to actually implement the start/stop funtion.

Kenny
Kenny

0 Kudos
Message 2 of 8
(4,914 Views)
0 Kudos
Message 3 of 8
(4,889 Views)
Kenny, sorry for the delayed thanks -i've been awaiting my upgrade for LV 8 which has been delayed due to some incompatability with the new DSC module. I'm afraid i can't view your code cause of this. Is there any chance you could resend in 7.1 format? Many thanks for taking the time to look at this.. initially i used sub vi's to repeat the code, but i ran in to some problems. And, when i wired the code in its 'raw' form it started to work. I'm working on tidying this up a little though. Appreciate the help, Stuart
0 Kudos
Message 4 of 8
(4,856 Views)

My LV8 is having issues this morning and does not want to open the VI I sent you, so I jsut created the loop that I had added.  It is very simple, but should get you started.  It does not ignore weekends I have not had time to work on that.  You could do something like every time the start time is triggered, increment a counter and when the counter hits 6 (saturday if you start counting on monday), do not start the engine and then when it hits 7 reset the counter.

Good luck and post back if you have more issues.

 

Kenny

Kenny

0 Kudos
Message 5 of 8
(4,843 Views)
Kenny, Thanks for the swift reply. I had a look at your simplified vi and it gave me an idea for another method. If you get a chance to revisit this, I would greatly appreciate your feedback on my attached vi. As you know, i have several while loops within my main vi. I would like to know if these need to be wrapped in a loop/case structure or if they can be controlled by launching/shutting down the tag engine. If you've had any experience with DSC control, I would be interested to find out what method is best in my situation. Many thanks for the continuing support, Stuart
0 Kudos
Message 6 of 8
(4,834 Views)

Could I have you send all the VI's (including subVI's) in a zip file?  In both VI's that you have sent, I am missing a number of VI's and it would just make it easier if I could see the subVI's also.

 

Thanks,

 

Kenny

Kenny

0 Kudos
Message 7 of 8
(4,827 Views)

I looked at your VI some more, and it apears that you can use it as you have it, if you create a reference to a control in the case structure, so they know when to start and stop.  Otherwise, you may just want to put them all in the case structure to not have to worry about the references.  I do like you start stop mechanism better than the one that I created, I had not thought of the limits VI.

This is my best answer from not knowing what is in the subvis (all the subvis are a box with a ? in it on my computer because I dont have them).

Kenny

Kenny

0 Kudos
Message 8 of 8
(4,822 Views)