mario@109: PROGRAM MAIN_TEST
mario@109:   VAR
mario@109:     QX1 AT %QX1 : BOOL := 1;
mario@109:     QX2 AT %QX2 : BOOL := 0;
mario@109:     QX3 AT %QX3 : BOOL;
mario@109:     IX1 AT %IX1 : BOOL;
mario@109:     IX2 AT %IX2 : BOOL;
mario@109:     IX3 AT %IX3 : BOOL;
mario@109:   END_VAR
mario@109: 
mario@109:   INITIAL_STEP GO:
mario@109:   END_STEP
mario@109: 
mario@109:   TRANSITION FROM GO TO STEP1
mario@109:     := IX1 = FALSE;
mario@109:   END_TRANSITION
mario@109: 
mario@109:   STEP STEP1:
mario@109:     ONSTEP1(N);
mario@109:   END_STEP
mario@109: 
mario@109:   ACTION ONSTEP1:
mario@109:     QX1 := TRUE;
mario@109:     QX2 := TRUE;
mario@109:   END_ACTION
mario@109: 
mario@109:   TRANSITION FROM STEP1 TO STEP2
mario@109:     := IX2 = TRUE;
mario@109:   END_TRANSITION
mario@109: 
mario@109:   STEP STEP2:
mario@109:     INLINE1(P);
mario@109:   END_STEP
mario@109: 
mario@109:   ACTION INLINE1:
mario@109:     QX1 := QX2 XOR QX1; QX2 := NOT QX2;
mario@109:   END_ACTION
mario@109: 
mario@109:   TRANSITION FROM STEP2 TO A1
mario@109:     := QX1 = FALSE AND QX2 = FALSE;
mario@109:   END_TRANSITION
mario@109: 
mario@109:   STEP A1:
mario@109:     INLINE2(N);
mario@109:   END_STEP
mario@109: 
mario@109:   ACTION INLINE2:
mario@109:     IX1 := TRUE;
mario@109:   END_ACTION
mario@109: 
mario@109:   TRANSITION FROM A1 TO STEP2
mario@109:     := IX1 = TRUE;
mario@109:   END_TRANSITION
mario@109: 
mario@109:   TRANSITION FROM STEP2 TO (D1, D2, D3)
mario@109:     := QX1 = TRUE AND QX2 = TRUE;
mario@109:   END_TRANSITION
mario@109: 
mario@109:   STEP D1:
mario@109:     INLINE5(N);
mario@109:   END_STEP
mario@109: 
mario@109:   ACTION INLINE5:
mario@109:     QX1 := FALSE;
mario@109:   END_ACTION
mario@109: 
mario@109:   TRANSITION FROM D1 TO E1
mario@109:     := NOT ( QX1 OR QX2 OR QX3 );
mario@109:   END_TRANSITION
mario@109: 
mario@109:   STEP E1:
mario@109:     INLINE8(N);
mario@109:   END_STEP
mario@109: 
mario@109:   ACTION INLINE8:
mario@109:     QX1 := TRUE;
mario@109:   END_ACTION
mario@109: 
mario@109:   TRANSITION FROM (E1, E2, E3) TO GO
mario@109:     := QX1 AND QX2 AND QX3;
mario@109:   END_TRANSITION
mario@109: 
mario@109:   STEP D2:
mario@109:     INLINE6(N);
mario@109:   END_STEP
mario@109: 
mario@109:   ACTION INLINE6:
mario@109:     QX2 := FALSE;
mario@109:   END_ACTION
mario@109: 
mario@109:   TRANSITION FROM D2 TO E2
mario@109:     := NOT ( QX1 OR QX2 OR QX3 );
mario@109:   END_TRANSITION
mario@109: 
mario@109:   STEP E2:
mario@109:     INLINE9(N);
mario@109:   END_STEP
mario@109: 
mario@109:   ACTION INLINE9:
mario@109:     QX2 := TRUE;
mario@109:   END_ACTION
mario@109: 
mario@109:   STEP D3:
mario@109:     INLINE7(N);
mario@109:   END_STEP
mario@109: 
mario@109:   ACTION INLINE7:
mario@109:     QX2 := FALSE;
mario@109:   END_ACTION
mario@109: 
mario@109:   TRANSITION FROM D3 TO E3
mario@109:     := NOT ( QX1 OR QX2 OR QX3 );
mario@109:   END_TRANSITION
mario@109: 
mario@109:   STEP E3:
mario@109:     INLINE10(N);
mario@109:   END_STEP
mario@109: 
mario@109:   ACTION INLINE10:
mario@109:     QX3 := TRUE;
mario@109:   END_ACTION
mario@109: 
mario@109:   TRANSITION FROM STEP2 TO A3
mario@109:     := QX1 = TRUE AND QX2 = FALSE;
mario@109:   END_TRANSITION
mario@109: 
mario@109:   STEP A3:
mario@109:     INLINE4(N);
mario@109:   END_STEP
mario@109: 
mario@109:   ACTION INLINE4:
mario@109:     IX1 := TRUE;
mario@109:   END_ACTION
mario@109: 
mario@109:   TRANSITION FROM A3 TO STEP2
mario@109:     := IX1 = TRUE;
mario@109:   END_TRANSITION
mario@109: 
mario@109:   TRANSITION FROM STEP2 TO A2
mario@109:     := QX1 = FALSE AND QX2 = TRUE;
mario@109:   END_TRANSITION
mario@109: 
mario@109:   STEP A2:
mario@109:     INLINE3(N);
mario@109:   END_STEP
mario@109: 
mario@109:   ACTION INLINE3:
mario@109:     IX1 := FALSE;
mario@109:   END_ACTION
mario@109: 
mario@109:   TRANSITION FROM A2 TO STEP2
mario@109:     := IX1 = FALSE;
mario@109:   END_TRANSITION
mario@109: 
mario@109: END_PROGRAM
mario@109: 
mario@109: 
mario@109: CONFIGURATION STD_CONF
mario@109: 
mario@109:   RESOURCE STD_RESSOURCE ON BEREMIZ
mario@109:     TASK STD_TASK(INTERVAL := t#100ms,PRIORITY := 0);
mario@109:     PROGRAM MAIN_INSTANCE : MAIN_TEST;
mario@109:   END_RESOURCE
mario@109: END_CONFIGURATION