LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with Elapsed timing

7FF71B5C-903F-4B14-B791-35CD97CADE94.jpeg

I’m a newbie at LV, so bare with me. I’m trying to setup a vi to grab data for 10-20 seconds every 24 hours. I’ve been trying to use an elapsed timer that triggers every 24 hrs, which will then trigger another elapsed timer that will run a while loop to grab data. Any help is much appreciated. Attached is an image of what I have. 

0 Kudos
Message 1 of 5
(1,168 Views)

First of all whenever you need to help regarding your code in discussion forum you need to upload your code to help your properly.

 

You really need modifications in your code.

 

The second while loop should be inside an additional case structure and its case elector should be wired to timer elapsed of first timer.

 

Why are you connecting elapsed time of first timer to set start time of second timer?

You also need to set the target time for the second timer.

You need a shift register in your first loop which should be connected to reset and timer elasped output to the shift register.

In the same way you need to add another shift register for reset in you second loop.

 

 

 

 


CLD Using LabVIEW since 2013
0 Kudos
Message 2 of 5
(1,145 Views)

Please attach your actual VI (one or more files with the extension ".vi").  If you send a few minutes just browsing the LabVIEW Forums, you will find almost every New Message that includes a picture of LabVIEW code is followed by a request to post your code.  We cannot closely examine a picture, and certainly can "click" and make it run to see what happens.  [There actually is a way to submit a picture that can be run, but you are not ready to learn about it ...].

 

Bob Schor

0 Kudos
Message 3 of 5
(1,114 Views)

@loc713 wrote:

I’m a newbie at LV, so bare with me.


Sorry, I think I'll keep my pants on for this 😄

 

As others have said, please attach your VI. We cannot run or debug photographs of your monitor.

 


@loc713 wrote:

I’m trying to setup a vi to grab data for 10-20 seconds every 24 hours. I’ve been trying to use an elapsed timer that triggers every 24 hrs, which will then trigger another elapsed timer that will run a while loop to grab data. Any help is much appreciated. Attached is an image of what I have. 


No, this is way to complicated and convoluted. All you need is one loop and once case structure (hint: simple state machine") that does different things depending on the current state (idle, grab data) and some simple timing on how much time has elapsed in each to decide when to go to the other state (simple template). It should also monitor user interactions at all times, e.g. to stop the program..

Do you want to grab data at a certain time of day (noon? midnight? etc.) or 24 hours after the program has been started, no matter what time that is? A duration of "10-20 seconds" can differ by a factor of two but computers tend to like exact numbers better. Is this a user setting? Should the process repeat every 24 hours or every "24hours+10-20seconds")

 

Please clarify!

Message 4 of 5
(1,111 Views)

Ok, so it seems like the state machine is the way to go? Attached is the code that I started with, I didn't think it was necessary to attach it since I knew this wouldn't be the right direction to go in. For the program, I would like it to grab data around midnight if that makes it easier though if it's possible to make it variable that would be helpful. Also, for the time, I would like the main loop to iterate every 24 hours, every day, but I want to start grabbing data at midnight for a set time of 20 seconds, but if this can be varied that would be helpful too.

0 Kudos
Message 5 of 5
(1,092 Views)