ATMT – Finite-state automaton

Block SymbolLicensing group: STANDARD
Qt SVG Document Exported by REXYGEN Studio R1 ns0 SET HLD C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 C10 C11 C12 C13 C14 C15 Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 Q14 Q15 ksa tstep TOUT ATMT

Function Description
The ATMT block implements a finite state machine with at most 16 states and 16 transition rules.

The current state of the machine i, i = 0,1,,15 is indicated by the binary outputs Q0, Q1, …, Q15. If the state i is active, the corresponding output is set to Qi=on. The current state is also indicated by the ksa output (ksa {0,1,,15}).

The transition conditions Ck, k = 0,1,,15 are activated by the binary inputs C0, C1, …, C15. If Ck = on the k-th transition condition is fulfilled. The transition cannot happen when Ck = off.

The automat function is defined by the following table of transitions:

S1 C1 FS1
S2 C2 FS2
Sn Cn FSn

Each row of this table represents one transition rule. For example the first row

S1 C1 FS1

has the meaning

If (S1 is the current state AND transition condition C1 is fulfilled),
then proceed to the following state FS1.

The above mentioned table can be easily constructed from the automat state diagram or SFC description (Sequential Function Charts, formerly Grafcet).

The R1 = on input resets the automat to the initial state S0. The SET input allows manual transition from the current state to the ns0 state when rising edge occurs. The R1 input overpowers the SET input. The HLD = on input freezes the automat activity, the automat stays in the current state regardless of the Ci input signals and the tstep timer is not incremented. The TOUT output indicates that the machine remains in the given state longer than expected. The time limits TOi for individual states are defined by the touts array. There is no time limit for the given state when TOi is set to zero. The TOUT output is set to off whenever the automat changes its state.

It is possible to allow more state transitions in one cycle by the morestps parameter. However, this option must be thoroughly considered and tested, namely when the TOUT output is used in transition conditions. In such a case it is strongly recommended to incorporate the ksa output in the transition conditions as well.

The development tools of the REXYGEN system include also the SFCEditor program. You can create SFC schemes graphically using this tool. Run this editor from REXYGEN Studio by clicking the Configure button in the parameter dialog of the ATMT block.

This block propagates the signal quality. More information can be found in the 1.4 section.

Input

R1

Block reset

Bool

ns0

Target state forced by the SET input

Long (I32)

SET

Forced transition to state ns0

Bool

HLD

Hold

Bool

C0..C15

Transition condition

Bool

Parameter

morestps

Allow multiple transitions in one cycle

Bool

off ..

Disabled

on ...

Enabled

sfcname

Name of special editor data file

String

STT

State transition table  [0 0 1; 1 1 2; 2 2 3; 3 3 0]

Byte (U8)

touts

Vector of timeouts  [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16]

Double (F64)

Output

Q0..Q15

Active state indicator

Bool

ksa

Integer code of the active state

Long (I32)

tstep

Time elapsed since the last state transition

Double (F64)

TOUT

Timeout flag

Bool

2024 © REX Controls s.r.o., www.rexygen.com