2/12/2014 7:24 AM | |
Joined: 1/28/2009 Last visit: 2/21/2023 Posts: 6794 Rating:
|
Hello, You need a change like this: IF (Trigger =1) AND (Trigger_OLD =0 ) Then Count := Count +1; End_IF; Trigger_OLD := Trigger; Also, check this sample coming from HERE [code] ORGANIZATION_BLOCK OB1 TITLE = 'HELP_ON_SCL' // // Block Comment... // VERSION: '1.0' AUTHOR: HD NAME: H_SCL FAMILY: FORUM_E VAR_TEMP // Reserved info : ARRAY[0..19] OF BYTE; // Temporary Variables END_VAR // Statement //FLANK1:=0; // OUT:=0; IF START =1 THEN IF TWO =1 AND FLANK1 =0 THEN ZAHL:=ZAHL+1; END_IF; FLANK1:=TWO; IF (ZAHL >= 0) AND (ZAHL <2) THEN OUT:=1; ELSE OUT:=0; ; END_IF; IF ZAHL>5 THEN ZAHL:=0; END_IF; ELSE zahl:=0; flank1:=0; OUT:=0; ; END_IF; ; END_ORGANIZATION_BLOCK[/code] I hope it helps Hamid Hosseini |
2/12/2014 10:56 AM | |
Joined: 8/27/2013 Last visit: 3/15/2023 Posts: 36 Rating:
|
@Aret: I've did that first, but changed it to be in STAT Var in my FB :) |
2/12/2014 11:02 AM | |
Posts: 2348 Rating:
|
Hmmm, can you upload whole project here? I usually work with edges in SCL without any problems. |
2/17/2014 7:40 AM | |
Joined: 8/27/2013 Last visit: 3/15/2023 Posts: 36 Rating:
|
Hello. Did you find anything in the project that caused the Rising Edge to fail? |
Follow us on