Control
State Machine
Description

State Machine

A multipurpose programmer capable of interacting with all parameters in the function block engine.

Particular states may test and set parameters or a timer with various conditions at every execution of the function block engine or only once on entry into that state.

Programming is simple and intuitive, especially where parameters and function blocks have been especially named for their purpose. In the following screenshots taken from an example bag machine, most parameters and function blocks have been renamed for clarity. Click on the State Machine Program parameter to view or edit the program.

Begin by adding and naming states in the left hand column. States are identified by sequential numbers with state number 0, Disabled, implied. No state transitions or set commands are possible in the disabled state. The timer continues to indicate the time since the last state transition.

Click on any state and add program steps to test or set criteria. The steps are executed in sequence from top to bottom. Those steps under, 'On Entry', are only executed once on entry into that state.

Parameters may be tested and compared with the following conditions; '==' exactly equal to, '!=' not equal to, '>' greater than, '<' less than, '>=' greater or equal, and '<=' lesser or equal.

Click the Diagram button in the editor to view a state diagram with all the states and their possible transitions. The current state is highlighted in blue and a timestamped list of transitions is provided at right.

State machines promote streamlining of function block engines and signal flow diagrams for many essential Boolean machine controls. In this screenshot, SFD notes, '(State Machine)', have been placed next to parameters that have no visible connections and are tested or set by a state machine.

Parameters that are read-only or that have an incoming drive.web connection cannot be set by the state machine.

When a state machine includes a program step that sets a parameter, that parameter will display the letter S in the background in the function block view. Such parameters may be manually set via savvy or savvyPanel when not actively controlled by a program step. New drive.web connections into such parameters are not possible.

In the following screenshot, parameters 7925 and 7926 at bottom-left are controlled by at least one state machine step and indicate the letter 'S' in the background.

Availability
  • Available only in the dw2xx-v2 series products
  • Requires library: Process Control (option -05)
  • Firmware versions 0x210E and later
savvy-SFD Graphic generalProg
Graphic with Parameters generalProg

Parameters

Enable Input, Read-write, Boolean (signed 16-bit integer)

State Machine - Enable

A global control of all state machine action.

No state transitions or set commands are possible while the block is disabled. The timer continues to indicate the time since the last state transition.

The previous state is resumed upon enable.


0 = Disabled
1 = Enabled
New State Input, Read-write, Enumerated (signed 16-bit integer)

State Machine - New State

The desired new state to be entered upon the rising edge of the Load New State parameter.

The parameter is automatically, sequentially enumerated for each programmed state with state number 0, Disabled, implied. No state transitions or set commands are possible while the block is disabled. The timer continues to indicate the time since the last state transition.

Incoming connections are possible but care must be taken to ensure that only available state numbers are commanded. If a non-present state number is commanded, the Status parameter indicates, 'Missing State', and the timer is reset.


0 = Disabled
1 = 1
Load New State Input, Read-write, Boolean (signed 16-bit integer)

State Machine - Load New State

The commanded New State is entered upon assertion of this parameter.

0 = Low
1 = High
Status Output, Read-only, Enumerated (signed 16-bit integer)

State Machine - Status

Typically 0, 'Disabled, 1, 'Running', or 2, 'No Program', although there are a number of other enumerated status outputs to indicated program problems.

The state machine is only active when the output is 1, 'Running'.


0 = Disabled
1 = Running
2 = No Program
3 = Missing State
4 = Malformed Program
5 = Set Failed
6 = Set to Invalid Address
7 = Set to Inactive Parameter
8 = Set to Read-Only
9 = Set to Connected
10 = Get Failed
11 = Get to Invalid Address
12 = Get to Inactive Parameter
13 = Unknown Instruction
Current State Output, Read-only, Enumerated (signed 16-bit integer)

State Machine - State

The current state of the state machine.

The parameter is automatically, sequentially enumerated for each programmed state with state number 0, Disabled, implied. No state transitions or set commands are possible while the block is disabled. The timer continues to indicate the time since the last state transition.


0 = Disabled
Program Internal Parameter, Read-write, State Machine Program (Byte Array)

State Machine - Program

Click this parameter to enter the state machine program editor.

Programming is simple and intuitive, especially where parameters and function blocks have been especially named for their purpose. In the following screenshots taken from an example bag machine, most parameters and function blocks have been renamed for clarity. Click on the State Machine Program parameter to view or edit the program.

Begin by adding and naming states in the left hand column. States are identified by sequential numbers with state number 0, Disabled, implied. No state transitions or set commands are possible in the disabled state. The timer continues to indicate the time since the last state transition.

Click on any state and add program steps to test or set criteria. The steps are executed in sequence from top to bottom. Those steps under, 'On Entry', are only executed once on entry into that state.

Parameters may be tested and compared with the following conditions; '==' exactly equal to, '!=' not equal to, '>' greater than, '<' less than, '>=' greater or equal, and '<=' lesser or equal.

Click the Diagram button in the editor to view a state diagram with all the states and their possible transitions. The current state is highlighted in blue and a timestamped list of transitions is provided at right.

State machines promote streamlining of function block engines and signal flow diagrams for many essential Boolean machine controls. In this screenshot, SFD notes, '(State Machine)', have been placed next to parameters that have no visible connections and are tested or set by a state machine.

Parameters that are read-only or that have an incoming drive.web connection cannot be set by the state machine.

When a state machine includes a program step that sets a parameter, that parameter will display the letter S in the background in the function block view. Such parameters may be manually set via savvy or savvyPanel when not actively controlled by a program step. New drive.web connections into such parameters are not possible.

In the following screenshot, parameters 7925 and 7926 at bottom-left are controlled by at least one state machine step and indicate the letter 'S' in the background.


Persistence Internal Parameter, Read-write, Enumerated (signed 16-bit integer)

State Machine - Persistence

Provides three choices for power-up behavior of the state machine;

0, Disable on Power-Up. The state machine enters state zero, disabled upon power-up. The New State parameter will need to be asserted to exit this state.

1, Persistent. The state machine resumes the state that was active when the machine powered-down.

2, Load on Power-Up. The state commanded in the New State input parameter is entered on power-up.


0 = Disable on power-up
1 = Persistent
2 = Load on power-up