O'Reilly logo

LabVIEW Graphical Programming Cookbook by Yik Yang

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the state machine architecture

State machine can transform a piece of sequential code into states with flexible transition between states. In a state machine, the code is self-documented and easy to read. In this recipe, we will use the state machine to program a simple rock-paper-scissors game simulator.

How to do it...

To start a state machine, it is a good idea to draw a flowchart first. Start by executing the following steps:

  1. To start, create a flowchart of the example program. See the following screenshot for the flowchart:
    How to do it...
  2. Open a new VI and build a state machine, as shown in the following screenshot. Create an enum type-def with values such ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required