Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Overview

A state machine enables the user to specify a set of modes, that each can take different mode values. For example we could have a "day" mode that can take the values "weekday" and "weekend", and a "time" mode that could take the "daytime" and "nighttime" values.

...

As the modes and states are represented by blocks, they can be linked. This way the user will specify, that when the "day" is "weekend" the "heating" to be "economical". 

Steps to create a state machine

Create a new program (temporary way)

First we create a new bLine program.

To do this we navigate to where we want our program to reside, 1. Navigate to the correct context that you'd like the program to reside on and click "new program" in the bLine menu.

At this stage we can add any points we thing that might be useful to our program.

Then we 2. Once the form appears you can select the points that you'd like to use in the program.

3. To trigger the program to act as a "state machine" you will need to add the isStateMachine following marker to our program:tag to your program isStateMachine(see steps below)

  • In folio run a query for all of your existing programs by typing in 'program'


  • add the isStateMachine markeradd isStateMachine as a marker tag

Add the mode and state blocks

The state machine can have one or multiple modes and one or multiple states.

...

In this example we have one state named "heating" with two values "normal" and "economical"

Link the mode and state blocks

In this example we link the daytime and weekend values to economical, and the daytime to normal. We want to have "normal" heating in the weekdays and daytime, and "economical" heating in weekends or nighttime, as it's an office building.

Because the "day" mode block is linked closer to the "start" block than the "time" block, the "day" block will have greater priority. So the value "weekend" will override any value set by the "time" block.


Edit the mode block(s)

Click on the pencil on top of the mode block.

...