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?

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. 

 


 

had search forums for "state machine"

I cant really understand what it means as no picture shown for a clearer understanding...

 

the program to end when a new date changes.

doesnt require the user hitting a button on the front panel.

the program State 3 will ends when the moment a new date falls.

 

shutdown state? i doubt i need that. Smiley Indifferent

 

the diagram under the attachment shown the working sequences.

 

after the State 3 VI executed finished, is the issue i facing... cracking brain on what require or missing to loop back to the State 1 VI?

 

 

0 Kudos
Message 31 of 57
(1,246 Views)

This picture shows you are dealing with 4 VI's rather than 3 VI's like you've been stating in this thread.  But your picture shows a state machine so I don't understand why you don't understand it.

 


@ADXING wrote:

 

doesnt require the user hitting a button on the front panel.

the program State 3 will ends when the moment a new date falls.

 

 

the diagram under the attachment shown the working sequences.

 

after the State 3 VI executed finished, is the issue i facing... cracking brain on what require or missing to loop back to the State 1 VI?

 

 


Well you said that when the new date falls you wanted to "pause state 3" and go back to 1.  Now you are saying you want your program to end.  Which is it?

 

Your picture (with 4 states) shows 1 to 2 to 3 to 4 then returning back to 1.  What causes you to end the cycle and not go back to 1?

 

Search State Machine again and again and read the threads until you understand it.  Look at the template I pointed you to from the File /  New ... menu.  It shows the basic structure for a state machine.  Right now it only shows 2 states, Initialize and Stop, but you add more states as needed by adding more items to the enum and adding the corresponding cases to the case structure.

 

0 Kudos
Message 32 of 57
(1,242 Views)

 

which method would be easier? pause or stop??

as long it is able to allow State 3 from running when the moment a new date falls but go back to State 1 instead.

then from State 1 runs per normal til State 3 again.

 

Right now it only shows 2 states, Initialize and Stop, but you add more states as needed by adding more items to the enum and adding the corresponding cases to the case structure.


yupx, ur right what you mentioned above.

Smiley Indifferent

 

hardly able to understand myself, need assistance with guidance...

0 Kudos
Message 33 of 57
(1,240 Views)

Here is the Standard State Machine Template fleshed out a little bit more to look like your code.  It is saved in LV 8.0.  It includes the typedef control where the states are defined.

Download All
0 Kudos
Message 34 of 57
(1,229 Views)

many thanks.

 

under the SMExample.vi.

with my the attachment provided, where shall i put my State 1 diagram into the State Machine ?

 

got picture provide with the combine of my attached file?

 

 

Smiley Indifferent

0 Kudos
Message 35 of 57
(1,224 Views)

the check_dateLV86.vi is the State 1 sequence

0 Kudos
Message 36 of 57
(1,221 Views)

Your checkdate VI is set up to be its own standalone program that is actually doing 2 things:  1.  checking the date which is what you said you want in state 3.  2.  creating the folder which is what you said you want in state 1.

 

Put the checkdate part in state 3 in place of my simulated boolean.

Put the folder creation part in state 1.

0 Kudos
Message 37 of 57
(1,220 Views)

how is it?

blur..

 

if you don't mind able to help me combine ?

Smiley Indifferent

 

through is not the final work will be, as its helps me alot as reference.

all thanks to you alot.

 

 

 

0 Kudos
Message 38 of 57
(1,218 Views)

many thanks.

 

on the STOP button at the Front Diagram, is there way that can be "STOP" automatic ?

 

with delay? or wait ms?

 

instead that require user to click on the stop than it stops itself after 10 secs example?

Smiley Surprised

0 Kudos
Message 40 of 57
(1,202 Views)