LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

cancel
Showing results for 
Search instead for 
Did you mean: 

Need assistance with State Machine

I am very new to Labview and would appreciate your assistance with a few questions. 

 

First how do you get the program to keep running after triggering my set point of 25?

 

I think it's ok that my coke or sprite selection stays on but could use help there too.

 

Then I am trying to keep count of these triggerings and display a sold out message (like after 3).

 

Thank you for your time.

0 Kudos
Message 1 of 3
(3,938 Views)

Execution highlighting (the lightbulb icon) will be a good tool to help understand what is going on.

Also, there are several tutorials online like this one to help better understand state machines

 

In this case, the reason your execution stops is because in your dispense state you have a true constant wired to the stop of the main loop. If you want to do this action multiple times, then in the dispense state you should:

1. reset the value of the 'money deposited'

2. not stop the main loop

3. decide what is the next state you want it to go to (as it is, you leave the state unchanged, so it will continue to run the dispense state indefinitely)

 

dispense state.png

 

Matthew C

AE | NI

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

If l didn't have the wire go straight through wouldn't l have to recreate each state to simulate the loop?

 

Also l don't know how to reset the money deposited beyond entering 0.

0 Kudos
Message 3 of 3
(3,901 Views)