lesson 8 bme 405 fall 2010 state machines no activities

lesson 8 bme 405 fall 2010 state machines no activities -...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
  1 State Machines
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Outline Program architecture and state machine  principles LabVIEW state machines Sequence state machines Type definition General state machines Extended example: beverage dispenser
Background image of page 2
3 Architecture? Program architecture = programming strategy, how we  want the application to work in the broadest sense Simple architectures Sequence style: initialize, repeat (analyze, display, store),  close. Sequencing obtained with sequence structure.  Sequence locals complicate flow of data Data flow style: initialize, repeat (analyze, display, store),  close. Sequencing controlled by flow of error cluster and task  id Program flow is predefined in these simple architectures State machines are used to program more complex  applications in which the program flow changes based  on user input or calculations
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 State machine: definition State machine: a type of architecture for a software  application A conceptual machine with a number of different states.  The machine is in one of the states at any given time.  In response to an input event, the machine may  transition to the same state or a different state  Traditional example: washing machine State: filling with water Event: message from “fill” sensor (machine is full, machine is  not full) Next state: adding soap (next state after machine is full) or  filling with water (next state after machine is not full) State machine allows the program to change the way it  executes based on external inputs or the results of its  execution
Background image of page 4
5 State machine principles State machines are used when distinguishable  states exist (fill – wash – spin)  Each state can lead to one or multiple states or  end the application The state machine relies on user input or in- state calculation to determine which state to go  next State machines are commonly used when  programming user interfaces, and for process  testing when the result of a test in a given state  determines which test runs next (test executive  state machine)
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 Elements of a state machine State: status of a piece of code; what the 
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/26/2010 for the course BME 405L at USC.

Page1 / 24

lesson 8 bme 405 fall 2010 state machines no activities -...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online