Logic
State Machine 8-8
Description

State Machine

A Moore finite state machine. The function block outputs are defined only by the current state, and not the inputs. State transitions are controlled only by particular inputs for any given state.

The State parameter shows the current, active state.

It is helpful to name the function block input and output parameters prior to programming.

Click the Program parameter to program the function block.

Create and name all the required states in the left hand box.

State number zero is a special state because it can always be immediately reached by activating the function block's Reset parameter. It is also the first state after power-up if the State Persistence parameter is default, Zero on Power-Up.

For each state, check the boxes next to the outputs for that state.

For each state, set up the transitions out of that state.

Transitions may be caused by an input being high or low, or only by the rising or falling edge of an input.

Application Example - Basic Ramp Control

State Machine handles stop, start, fast-stop, jog, and their ramp times in a Linear Ramp function block.

Program Design Technique

It is helpful to draw a state diagram of the program design. Circles represent discrete states and list the output(s) for that state. Arrows connect states and are represented with arrows along with the discrete input(s) that cause the transition.

Here is the state diagram for this ramp control example -

The control is implemented when State Machine function block is connected into the signal flow diagram -

This example is published online with the drive.web configuration file - Basic Ramp Example Page

Application Example - Vertical Lathe

In this more complex example, State Machine function block manages the machine sequencing:
Ensure that correct tool travel paths are followed to avoid interference with the work.

Handle tool changes.

Provide pause, hold, power-up, and alarm routines.

Sequence repeated cuts automatically.

This diagram shows machine details for the example, and the particular case of an inside cut -

The same state machine program can handle all cuts; top, bottom, inside, outside, and sloped cuts.

Here is the complete state diagram for this example -

With more complex systems, it is helpful to list the inputs, outputs, and states along with their descriptions.

Availability
  • Available only in the dw2xx & dw2xx-v2 series products
  • Requires library: Process Control (option -05)
  • Firmware versions 0x2016 through 0x210D
savvy-SFD Graphic mooreMachine8
Graphic with Parameters mooreMachine8

Parameters

Input 0 Input, Read-write, Boolean (signed 16-bit integer)
0 = Low
1 = High
Input 1 Input, Read-write, Boolean (signed 16-bit integer)
0 = Low
1 = High
Input 2 Input, Read-write, Boolean (signed 16-bit integer)
0 = Low
1 = High
Input 3 Input, Read-write, Boolean (signed 16-bit integer)
0 = Low
1 = High
Input 4 Input, Read-write, Boolean (signed 16-bit integer)
0 = Low
1 = High
Input 5 Input, Read-write, Boolean (signed 16-bit integer)
0 = Low
1 = High
Input 6 Input, Read-write, Boolean (signed 16-bit integer)
0 = Low
1 = High
Input 7 Input, Read-write, Boolean (signed 16-bit integer)
0 = Low
1 = High
Reset Input, Read-write, Boolean (signed 16-bit integer)
0 = Inactive
1 = Reset
Output 0 Output, Read-only, Boolean (signed 16-bit integer)
0 = Low
1 = High
Output 1 Output, Read-only, Boolean (signed 16-bit integer)
0 = Low
1 = High
Output 2 Output, Read-only, Boolean (signed 16-bit integer)
0 = Low
1 = High
Output 3 Output, Read-only, Boolean (signed 16-bit integer)
0 = Low
1 = High
Output 4 Output, Read-only, Boolean (signed 16-bit integer)
0 = Low
1 = High
Output 5 Output, Read-only, Boolean (signed 16-bit integer)
0 = Low
1 = High
Output 6 Output, Read-only, Boolean (signed 16-bit integer)
0 = Low
1 = High
Output 7 Output, Read-only, Boolean (signed 16-bit integer)
0 = Low
1 = High
State Persistence Internal Parameter, Read-write, Boolean (signed 16-bit integer)
0 = Zero on power-up
1 = Persistent
State Internal Parameter, Read-only, Enumerated (signed 16-bit integer)
0 = Initial
Program Internal Parameter, Read-write, State Machine Program (Byte Array)