08-09-2006 11:02 AM
08-09-2006 11:19 AM - edited 08-09-2006 11:19 AM
There are many ways to do this and there are a lot of timing functions in LabVIEW that you could use. If you wanted to run the program for 24 hours after you start it and just log periodically, the Elapsed Time function is an easy way to go. It has a Time Has Elapsed output that you can wire to a case statement. Inside the true case, you would put your logging code. You could also set up a shift register and increment it by 1 every time in the true case. If the value of the shift register is equal to 24, then stop the loop. I've attached an image of this method. Using the Get Date/time in Seconds, you could also code up something that would start it at midnight, log on the hour, and stop it the following midnight.
Message Edited by Dennis Knutson on 08-09-2006 10:19 AM
08-09-2006 12:01 PM
08-24-2006 05:55 AM
Dear Dennis,
I am using the same method for periodic logging, in my case i want to log the data into the excel file at each and every 1 minute so i am using the elapsed time with the option "Time has elapsed (true)", but it delays the thing with heavy coding of my vi mean at one or two logging it adds one more second ( it should do it at every 60 seconds, instead it is doin at 61 second generally) so it adds the time error in my logging and it is not acceptable in my project, so is it any other way that i can do same thing as we are doing with Time has elapsed?
Thanks,
Nishant
08-25-2006 04:44 AM - edited 08-25-2006 04:44 AM
Nishant, see the comments I made on your post about alternative to elapsed time.
You can extend Dennis's example a bit, to solve your problem: (see JPG)
P.S. How do I embed the JPG into the message? Do I need to have an URL to a server of my own, even though I attach the image?
Message Edited by Anthony de Vries on 08-25-2006 11:49 AM
08-25-2006 08:31 AM
08-25-2006 09:24 AM
Neat little trick! Too late to edit my orignial post...
I'll put it in this post, just to make the thread easier to read:
NB: The reset is 'true' is necessary. It makes sure that elapsed time uses the start time from outside the while loop as its starting point!
08-25-2006 10:51 PM
Dear Day,
Thanks for the info about embedding the image, but by referring to Image location, what does it mean? which link should be copied? i mean after submitting it will show the link of the picture, should we copy that link and to copy itinside the post?
Thanks,
Nishant
08-25-2006 10:54 PM
You are righ Anthony,
To read the description with the figure make the things really, easy rather than first to see the image and to remember, when we read the description. Good one.
Thanks,
Nishant
02-15-2010 04:08 PM
Good Day,
I am new to labview, i need a program that is very close to this one... i guess. what i need is to run a PWM for 8 hours a day. i have the PWM done easy. but is to run it every day for 8 hours that i am having hard time with.
i am using labview 8.2 and cfp-2120, cfp-pwm-520.
i am going to attach the small vi.
waiting for your kind reply