LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Do I need to use a state machine?

Hi all,

 

I want to write a code that reads two numbers from two different text files (via a file open dialogue box), and perform addition on these two numbers - this operation should happen.

 

Then after that, I want a dialogue box to pop up and ask whether to perform another operation (say subtraction). If the answer is NO, the code should stop and write the result from the addition into a file.

 

If the answer is yes, then the code should subtract the two numbers, and write both the sum and the difference of the two numbers into a file.

 

Question: is this an example where a state machine is used? What would a simple prototype code look like? If I can get this, then I can apply the example to my much more complicated (not fundamentally more difficult) problem at hand. 

0 Kudos
Message 1 of 3
(2,244 Views)

This seems more than reasonable to use a state machine.

 

I recommend looking through the project examples.  There should be a basic state machine in there.  You should also give this paper a good read: Application Design Patterns: State Machines


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 3
(2,223 Views)

Thanks. I'll give that paper a try, and if I can't figure it out, I'll post.

0 Kudos
Message 3 of 3
(2,205 Views)