Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PROGRAM jezykST
- VAR_EXTERNAL
- START:BOOL;
- RES: BOOL;
- CS: BOOL;
- BS: BOOL;
- R_S3: BOOL;
- S_S3: BOOL;
- v_s4: BOOL;
- R_S4: BOOL;
- pom: BOOL;
- stan: INT;
- END_VAR
- VAR
- Impuls: R_TRIG;
- T0: TON;
- WAIT: MONO_F;
- T1: MONO_F;
- T2: TON;
- T0_OUT: BOOL;
- WAIT_OUT: BOOL;
- T1_OUT: BOOL;
- T2_OUT: BOOL
- ;
- END_VAR
- T0(IN:=(@stan=2),OUT=>T0_OUT);
- WAIT(IN:=(@stan=3),OUT=>WAIT_OUT);
- T1(IN:=(@stan=4),OUT=>T1_OUT);
- T2(IN:=(@stan=5),OUT=>T2_OUT);
- Impuls(CLK:=START, Q=>START);
- RES:= START OR pom;
- CASE @stan OF
- 1:R_S3:=FALSE;
- S_S3:=FALSE;
- v_s4:=FALSE;
- R_S4:=FALSE;
- pom:=FALSE;
- IF RES THEN @stan:=2;
- END_IF;
- 2:R_S3:=FALSE;
- S_S3:=FALSE;
- v_s4:=FALSE;
- R_S4:=FALSE;
- pom:=FALSE;
- IF T0_OUT THEN R_S3:=CS;
- S_S3:=NOT CS;
- @stan:=3;
- END_IF;
- 3:R_S3:=FALSE;
- S_S3:=FALSE;
- v_s4:=TRUE;
- R_S4:=FALSE;
- pom:=FALSE;
- IF NOT WAIT_OUT THEN @stan:=4;
- END_IF;
- 4:R_S3:=FALSE;
- S_S3:=FALSE;
- v_s4:=FALSE;
- R_S4:=TRUE;
- pom:=FALSE;
- IF NOT T1_OUT THEN @stan:=5;
- END_IF;
- 5:R_S3:=FALSE;
- S_S3:=FALSE;
- v_s4:=FALSE;
- R_S4:=FALSE;
- pom:=FALSE;
- IF T2_OUT THEN pom:=BS;
- @stan:=1;
- END_IF;
- END_CASE;
- END_PROGRAM
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement