 
 
(* @PATH := '' *)
(* @SYMFILEFLAGS := '0' *)
PROGRAM CoDeSys_ST_src 
(*program: CoDeSys_ST_src
  for ST demonstration
  version: 1.0.0, 18.03.2004, 3S Software*)

VAR
	xVal:INT:= 0;
	yVal:INT:= -250;
	bottom: INT:= -250;
	stripes: ARRAY[0..5] OF INT := 0, 90, 180, 270, 360, 450;
	stelle: INT;
	i: INT;
	rot: INT;
	y: BOOL;
	wait: INT:= 0;
	inv: BOOL := TRUE;
	inv2: BOOL := FALSE;
	scale: INT := 1000;
	run:BOOL:=FALSE;
	run_string:STRING(20):='Start';
	offset: INT := 2;
END_VAR
(* @END_DECLARATION := '0' *)
(*program: CoDeSys_ST_src
  for ST demonstration
  version: 1.0.0, 18.03.2004, 3S Software*)

run_string:='Start';
IF NOT run THEN
	RETURN;
END_IF;
run_string:='Stop';

rot := rot + offset;

IF (yVal < 0) THEN
	yVal := yVal + offset;
	bottom := yVal + offset;
ELSE
	IF(xVal < 470) THEN
		xVal := xVal+offset;
	END_IF
	IF (bottom > -250) THEN
		bottom := bottom -offset;
	END_IF
END_IF

i  := 0;

IF xVal >= 470 THEN
	wait := wait +1;
	IF (wait >= 10 AND wait <= 20) THEN
		inv := FALSE;
		inv2 := TRUE;
	ELSE 
		inv := TRUE;
		inv2 := FALSE;
	END_IF
	IF (wait > 20) THEN
		scale := scale - 50;
	END_IF
	IF (wait > 41) THEN
		wait := 0;
		xVal := 0;
		yVal := -250;
		scale := 1000;
	END_IF
END_IF

WHILE i < 6 DO
	stripes[i] := stripes[i]+offset;
	IF(stripes[i] >= 540) THEN
		stripes[i] := 0;
	END_IF
	i := i + 1;
END_WHILE

END_PROGRAM
