Designing automation scripts

By designing a new automation script in the dialogue box of a final state machine creation, firstly, a name and a description of the script are entered, and the model is specified created in advance in which all parameters characterizing the operation of the connected device are set.

The new script will be created with a minimal set of elements in the working area.

Any script consists such elements:

Name and description Icon
Initial state
Marking the start of script execution

State
Here specifies that actions must be performed on enter and exit from it
Transition
Here set an event and a condition that must be fulfilled by the transition from one state to another
Final state
Designation of the end of script execution
Minimap
A small auxiliary window displaying the entire machine as a whole. When building a script, it helps to navigate between its parts: states and transitions. In this case, the movement on the machine can be carried out both through this minimap, and directly through the workspace

In order to build the transition between the object states, the dotted arrow should be held from the boundary of the first state to the boundary of the following state.

Dimensions of each state and the transition can be regulated by dragging the bottom right corner. If the box of state or transition is increased in a certain way, not only the entry field for the name, but the description becomes available too. Any transition or state can be deleted.

The toolbar is located in the bottom part of the editor working area.

Editor – an interface for creating device scripts that define the logic of the object’s behavior.
Objects – a menu for assigning an automaton to specific objects, tracking the status of an automaton, and controlling their launch.
Save – saves changes to the machine. The machines running on objects before changes will continue to work in the previous version. The new version of the machine will start to work after restarting the machine.
State – adds a new state to the machine.

Not saved changes are not deleted during switching between the interface sections, but they may be lost if the page will be reloaded or closed.

In order to launch an action on a particular state, the position in the state itself should be selected, whether this action must be performed on entering in the state or on exit from it. By clicking on the chosen button, the full list of commands and action opens, in accordance with the specified model. This set includes both external software modules which are described in every model by default, and such commands which were added by the user. Precisely from this drop-down list box there are chosen such one or several commands that should be executed on entering of on exit from the state.

In preparing the transition between two states, firstly, it is necessary to add the event which must be occurred to build the transition and, following that, the condition under which the transition occurs. The events and conditions are added similarly to the action on entering and exit from the state. The full drop-down list box of the events is opened to the user. All events from the device model are available for selection: both the events existing in the model by default and the user-defined events.

By describing the transition between the states, only one event can be specified. The intermediate states should be used to create a transition with several events.

After selecting an event, a transition condition is written. In each condition, a model parameter is selected from the drop-down list, the value of which must be checked and fixed. Then, either the control value itself is set in the “Value” field, or another parameter is selected in the “Parameter” field, the value of which must be compared. In this case, you must specify the comparison operation itself. If several conditions have been specified, then using the “AND”, “OR” buttons you can specify the condition for the transition. In this case, no more than four conditions can be prescribed.

scheme

After the condition has been added, it is displayed in the transition description. It should be kept in mind that the condition can be configured not only in the UI, but also in the form of code.

scheme