Structure your automated machines using the GEMMA (Guide d'Étude des Modes de Marches et d'Arrêts) standard.
The GEMMA standard classifies automated machine behavior into three main families:
In AutomationView, the standard architecture uses a Master Supervisory Sequence that controls and encloses station-level production sequences.
+---------------------------------------------------------------+
| MASTER GEMMA SEQUENCE |
| |
| [Step A1: Init] <======== [Step A6: Homing / Reference] |
| | ^ |
| (bStart_Auto) | (bReset_Cmd) |
| v | |
| [Step F1: Auto Production] ====> [Step D1: Emergency Stop] |
| | ^ |
| (bCycle_Stop) | (bE_Stop_Active) |
| v | |
| [Step A2: Stop at End of Cycle] --------+ |
+---------------------------------------------------------------+
These variables will be generated automatically as you build your sequence. You can also optionally prepare and document them upfront in the Variables sidebar:
| Variable Name | Type | Direction | Description |
|---|---|---|---|
bMode_Auto |
BOOL |
Input | Mode selector in Automatic position |
bMode_Manual |
BOOL |
Input | Mode selector in Manual / Jog position |
bBtn_Start |
BOOL |
Input | Green cycle start pushbutton |
bBtn_Stop |
BOOL |
Input | Normal cycle stop pushbutton |
bBtn_Reset |
BOOL |
Input | Alarm reset / homing pushbutton |
bE_Stop_OK |
BOOL |
Input | Emergency stop loop healthy (NC) |
bStation_At_Home |
BOOL |
Input | All actuators confirmed in home position |
bProduction_Active |
BOOL |
Output | Master enable signal for station sequences |
bHoming_Active |
BOOL |
Output | Master command to execute homing cycle |
bEmergency_State |
BOOL |
Output | Safety relay tripped / fault indicator |
A1_REST_STATE. Action: bProduction_Active = FALSE.bMode_Auto AND bBtn_Start AND bE_Stop_OK AND bStation_At_Home.F1_AUTO_PRODUCTION. Action: bProduction_Active = TRUE.bBtn_Stop OR NOT bMode_Auto.A2_CYCLE_END_STOP. Action: bProduction_Active = FALSE.bStation_At_Home.NOT bE_Stop_OK.D1_EMERGENCY_STOP. Action: bEmergency_State = TRUE.bE_Stop_OK AND bBtn_Reset.A6_HOMING_CYCLE. Action: bHoming_Active = TRUE.bStation_At_Home.from automation_machine import Sequence, StepType
class GemmaMaster(Sequence):
def setup(self):
s_a1 = self.add_step(StepType.INITIAL, name="A1_REST_STATE")
s_f1 = self.add_step(name="F1_AUTO_PRODUCTION")
s_a2 = self.add_step(name="A2_CYCLE_END_STOP")
s_d1 = self.add_step(name="D1_EMERGENCY_STOP")
s_a6 = self.add_step(name="A6_HOMING_CYCLE")
self.add_transition(s_a1, s_f1, condition="bMode_Auto AND bBtn_Start AND bE_Stop_OK AND bStation_At_Home")
self.add_transition(s_f1, s_a2, condition="bBtn_Stop OR NOT bMode_Auto")
self.add_transition(s_a2, s_a1, condition="bStation_At_Home")
self.add_transition(s_f1, s_d1, condition="NOT bE_Stop_OK")
self.add_transition(s_a1, s_d1, condition="NOT bE_Stop_OK")
self.add_transition(s_d1, s_a6, condition="bE_Stop_OK AND bBtn_Reset")
self.add_transition(s_a6, s_a1, condition="bStation_At_Home")
s_f1.add_action("bProduction_Active", "Enable automated cycle")
s_d1.add_action("bEmergency_State", "Emergency fault indicator")
s_a6.add_action("bHoming_Active", "Trigger homing sequence")
Open gemma_master.seq to define the top-level supervisor.
Station sequences must check bProduction_Active in their initial transition condition. If bProduction_Active turns FALSE during an emergency stop, the station sequence immediately pauses or aborts according to the safety strategy.
bE_Stop_OK = TRUE and bStation_At_Home = TRUE.bMode_Auto = TRUE and toggle bBtn_Start = TRUE.F1_AUTO_PRODUCTION.bE_Stop_OK = FALSE. The supervisor jumps directly to D1_EMERGENCY_STOP.bE_Stop_OK = TRUE and click bBtn_Reset = TRUE to initiate A6_HOMING_CYCLE.