GrafcetMaker Open the editor

Writing receptivities

Receptivities, action conditions and events are logical expressions. You type them in plain ASCII; the diagram shows them in textbook notation (NOT as an overbar, AND as ·). Turn View › Textbook notation off to see exactly what you typed.

Operators

MeaningTypeAlso acceptedShown as
ANDa * ba AND b, a && b, a · ba · b
ORa + ba OR b, a || ba + b
NOT/aNOT a, !a, ¬aa with an overbar
Rising edge↑aRE a (typing ^a gives ↑a)↑a
Falling edge↓aFE a↓a
Always true / false1 / 0TRUE / FALSE1 / 0
Parentheses(a + b) * c(a + b) · c

NOT binds tightest, then AND, then OR: a + b * /c means a + (b * (/c)). Use parentheses when in doubt.

Rising and falling edges

An edge is true only at the instant its operand changes: ↑a (rising edge, P trigger) when a goes from false to true, ↓a (falling edge, N trigger) when it goes from true to false. Use it to react once to a button press, however long the button is held.

Lamp on from a press of the button to its release ↑button ↓button 0 1 Lamp
Lamp on from a press of the button to its release

Three ways to type an edge:

  • Type ^ before the name: ^start becomes ↑start as you type.
  • Put the text cursor on a name and press Alt+↑ for a rising edge or Alt+↓ for a falling edge. Press it again to remove the edge, or the other one to swap it.
  • Click ↑ or ↓ in the symbol bar that appears above the field while you edit a receptivity.

RE a and FE a are accepted too. Edges also work on step variables: ↑X3 is true when step 3 becomes active.

Step variables

X3 is true while step 3 is active. In a project with several grafcets, X3 refers to step 3 of the same grafcet, or to the only step 3 of the project. Use it to synchronise grafcets, e.g. wait for another grafcet to reach a step.

Timers

5s/X2 is true 5 seconds after X2 became true, and false again as soon as X2 is false: typically "5 s after step 2 was activated".

The heater runs for 5 s start 5s/X1 0 1 Heater
The heater runs for 5 s
  • Units: ms, s, min, h, e.g. 500ms/X4, 2min/start.
  • The operand can be any condition: 3s/(a * b).
  • 2s/a/5s is true 2 s after a became true and stays true until 5 s after a became false.

Comparisons

Numeric variables (INT, REAL, TIME) are compared with =, <>, <, <=, >, >=, and can use +, -, *, / and MOD inside the comparison: level >= 80, C = 3, T1 > 2s, (a + b) / 2 < limit. A comparison is a condition: when you combine it with others, put it in parentheses, as in start * (C < 10). Without them, start * C < 10 would compare start * C with 10.

Assignments in stored actions

Stored actions contain an assignment: C := C + 1, Motor := 1, Speed := 2.5, Done := FALSE. See Actions.

Help while you type

  • Suggestions: start typing a name and pick a variable or step (X…) with the arrow keys, then Enter or Tab. The rest of the highlighted name shows in grey after the cursor; Tab or → accepts it.
  • Empty field: the first variable of the table that nothing uses yet shows in grey (an input for a receptivity, an output for an action); Tab accepts it.
  • Problems: a box under the field explains what is wrong, underlines where, and offers fixes: Use Start for a misspelt name. A new name is announced (New variable start: BOOL input) and declared when you confirm.
  • Symbol bar: buttons for ↑ ↓ NOT AND OR, parentheses (they wrap the selected text) and a timer template.

You can always confirm an expression with a problem: it is shown underlined in red on the diagram and listed in Problems until you fix it.