LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

When PC System timing hits 0000hrs Loops back to start and runs again using Loop function?

 


@Ravens Fan wrote:

@NIquist wrote:

In 12 hr time there are two 00:00 occurrences (midnight and noon).  Is this what you're asking for?:

 

 


I doubt that.  The way he wrote it, it sounds like he wants military time.  Midnight is 0000.  Noon is 1200 hours.

 

In normal time, there is no 00:00.  Midnight is 12:00am.  Noon is 12:00pm.


Yeah, I just looked at his other threads.  It's always tough to help the people who just keep asking the same question over and over without telling us what the motivation is.

 

Now I'm confused why your simple solution of comparing the dates isn't what he wants.  Can't say we didn't try to help.  Smiley Indifferent

 

--  I noticed my 12 hour error after I posted, hence the edit.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 21 of 57
(1,085 Views)

Ravens Fan, ur right.

basically the problem issue facing is to only focus on the "Midnight" (MM) 0000hrs "A new date change".

 

Once the "Midnight (MM) 0000hrs, a new date changes. the execution "pause" is current running VI and return to the 1st VI.

Smiley Indifferent

0 Kudos
Message 22 of 57
(1,074 Views)

thanks on the shown picture, will tk it as reference if can link up with the problem issue at the moment.

nice work Nlquist.

 

Smiley Happy

0 Kudos
Message 23 of 57
(1,073 Views)

after some thoughts,

i need help on a simple simple solution that somewhere link with the problem issue i posted...

 

basically, focus on 12:00 AM now.

 

Step 1: When a VI runs from 1st VI >>> then to 2nd VI >>>> finally 3rd VI, on a date, e.g. 100825 (25 August 2010)

 

Step 2: Time and date reaches, 100825, 11:59 PM... changes to... 100826, 12:00 AM

 

Step 3: As a new date and time hits 12:00AM, its should able to pause the current running 3rd VI. Return to the very 1st VI and runs...

 

Total there is 3 VIs running in sequence example.

 

1st VI >>> 2nd VI >>> 3rd VI

 

Smiley Indifferent

 

so sincerely sorry to you all guys for any misinterpretation caused.

as the task given me was in a mess quite...

 

stuck with this issue i facing for a week so far...

 

Many thanks guys...

0 Kudos
Message 24 of 57
(1,064 Views)

One question I asked and you haven't answered is what causes the 3rd VI to unpause?

 

I don't think you have any problem with figuring out how to do something at midnight, this thread is full of those ideas.  The problem you have is a very unclear architecture with how all these VI's interact with each other.  Are they subVI's in a larger VI?  Are they dynamically calling one one another?

 

Aren't you really dealing with a state machine architecture?

0 Kudos
Message 25 of 57
(1,063 Views)

basically...

 

Step 1: When a VI runs from 1st VI >>> then to 2nd VI >>>> finally 3rd VI, on a date, e.g. 100825 (25 August 2010) a folder is created "100825" done.

 

Step 2: Time and date reaches, 100825, 11:59 PM... changes to... 100826, 12:00 AM

 

Step 3: As a new date and time hits 12:00AM, its should able to pause the current running 3rd VI. Return to the very 1st VI, a folder is created "100826" and runs...

 

Total there is 3 VIs running in sequence example.

 

1st VI (folder created) >>> 2nd VI (data transmit into the created folder)  >>> 3rd VI (produce output of the data in the folder)

 

 

at the 3rd VI to unpause it, would it be able to unpause it only once the new date folder is created at 1st VI, follow by finished execute 2nd VI, unpause 3rd VI and runs to produce the output?

 

0 Kudos
Message 26 of 57
(1,060 Views)

so far the progress is done at 1st VI, 2nd VI...

only after the 3rd VI executed... the problem occur of returning to the 1st VI...

 

 

Smiley Sad

0 Kudos
Message 27 of 57
(1,057 Views)

You say "unpause the 3rd VI", but aren't you actually stopping the 3rd VI at that point and will start the 3rd VI again once the 1st and 2nd have run?

 

That all sounds like a normal state machine.  State 1 >> State 2 >> State 3 >>  State 1 >> State 2 >> State 3 >>  Repeat until you some other condition is met like a master stop button.

 

State 1 sounds like a simple action and move on.  But what determines when the 2nd VI (state 2) ends and the 3rd one begins?

0 Kudos
Message 28 of 57
(1,049 Views)

You say "unpause the 3rd VI", but aren't you actually stopping the 3rd VI at that point and will start the 3rd VI again once the 1st and 2nd have run?


ya, this the problem facing. you're right.Smiley Indifferent

 

when the new date changes, a error message would appear "continue"  & "stop"

eventually, only when click on "stop" and run again will run well the sequences

 

 State 1 >> State 2 >> State 3 >>  State 1 >> State 2 >> State 3 >> 

as you mentioned.

 

Repeat until you some other condition is met like a master stop button.


 a master stop button? how this button to apply onto it? Smiley Indifferent

 

any simple solution for reference ?

 

 

 

 

0 Kudos
Message 29 of 57
(1,043 Views)

Search the forums for "state machine".

 

Look at LV menu File >>  New ...  then the standard state machine template.

 

 

As for master stop button, I am asking you to think about what will cause your program to end and break out of its endless 1 .. 2.. 3 loop.  Is it the user hitting a button on the front panel?  If so, when is it read (state 1 , or state 2, or state 3).  Do you have to do any clean up code like close file references before the application's master while loop stops.  Now you have a state 4, a shutdown state. 

 

0 Kudos
Message 30 of 57
(1,039 Views)