10-05-2010 09:06 PM
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.
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?
10-05-2010 09:15 PM
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.
10-05-2010 09:25 PM
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.
hardly able to understand myself, need assistance with guidance...
10-05-2010 09:41 PM
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.
10-05-2010 09:55 PM
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?
10-05-2010 09:56 PM
the check_dateLV86.vi is the State 1 sequence
10-05-2010 09:59 PM
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.
10-05-2010 10:04 PM
how is it?
blur..
if you don't mind able to help me combine ?
through is not the final work will be, as its helps me alot as reference.
all thanks to you alot.
10-05-2010 10:20 PM
Like this.
10-05-2010 10:27 PM
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?