LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hi need explanation of this question

Solved!
Go to solution

Hi thanks for the suggestion! so does that mean need to use the state machines?

0 Kudos
Message 11 of 15
(590 Views)

Yes, you have several states. The state machine can be very simple.

0 Kudos
Message 12 of 15
(584 Views)

@gavinng wrote:

Hi thanks for the suggestion! so does that mean need to use the state machines?


You never need a state machine.

 

You could use a state machine to get the behavior you want.

 

There are (many, many) alternatives. I prefer a state pattern, but that's OO (and therefor very difficult 😉). For a small thing like this, I probably put everything in a class that keeps it's own state...

0 Kudos
Message 13 of 15
(561 Views)

wiebe@CARYA wrote:

@gavinng wrote:

Hi thanks for the suggestion! so does that mean need to use the state machines?


You never need a state machine.

 


I agree, but it depends a little bit how broad the term is defined. (Something that retains a start tick across iterations and can be in several states (LED Skipped? Button pressed? 200ms elapsed? 1000ms elapsed? ) could already be called a (very primitive) state machine. 😉

0 Kudos
Message 14 of 15
(543 Views)
Solution
Accepted by topic author gavinng

@altenbach wrote:

wiebe@CARYA wrote:

@gavinng wrote:

Hi thanks for the suggestion! so does that mean need to use the state machines?


You never need a state machine.

 


I agree, but it depends a little bit how broad the term is defined. (Something that retains a start tick across iterations and can be in several states (LED Skipped? Button pressed? 200ms elapsed? 1000ms elapsed? ) could already be called a (very primitive) state machine. 😉


Agreed.

 

Just trying to convey that a state machine is an option. Any solution should be a means to an end. Not something you feel like you need to (or, worse, are told to) use.

Message 15 of 15
(536 Views)