In: Electrical Engineering
What two structures are used in a state machine implementation in LabVIEW? How are they configured?
We need a while loop, a case structure, shift register and a transiion coad.
HOW TO CONFIGER:
1. Create a new blank VI.
2. On the front panel place:
• Two text buttons named “Nickel” and “Dime”
• Text indicator named “Money Deposited”
• Boolean indicator named “Dispense coke”
3. Place a while loop on the block diagram.
4. Place a case structure in the while loop.
5. Create a shift register on the while loop.
6. Create an Enum and wire it to the shift register to initialize it.
7. Right-click the Enum, select Edit Items, and add the following “states”:
• Start
• 5 cents
• 10 cents
• Dispense
8. Wire the shift register to the conditional input of the case structure.
9. Right-click the case box at the top of the case structure and select Add Case for Every Value.
10. Wire the different cases as depicted in the following figures.
11. Wire Dispense coke to the Boolean output of the case structure.
12. Inside the while loop, place a wait function with a constant.
13. Outside of the while loop, wire a constant of 0 to the Money Deposited string indicator.
The finished VI should look like this: