.


:




:

































 

 

 

 


IEC 61131-3

: .

:

IEC 61131-3 5 : LD, FBD, IL, SFC, ST.

 

. 1.1 IL -

 

. 1.2 ST -

 

. 1.3 FBD

 

. 1.4 SFC -

 

. 1.5 LD .

 

 

1.1 LD:

 

LD: . . . .

, ON, OFF.

, OFF, OFF.

 

.1.1.1 .

 

. . . FB, . , , .

. . OFF, OFF ON.

. ON, ON, . .

. OFF, ON, . .

LD FBD. LD , . .

. 1.1.2 LD

 

1.2 IL.

 

IL FBD. .

Ld I_xInput1 AndN I_xInput2 Or I_xInput3 St Q_xOutput1  
IL
:   LD ST /
:   ADD SUB - MUL - DIV
  AND OR XOR NOT
:   GT GE EQ - NE LE LT
:   S R
: JMP RET CAL )
     

 

IL:

IL FBD
ùE1 * ùE2 = ù (E1 + E2) LdN I_xInput1 AndN I_xInput2 And(I_xInput3 Not Or I_xInput4 ) St Q_xOutput1
Ld iMin Limit iQuantity, iMax St iCorrection
Ld wMin Word_To_Int Limit iQuantity, iMax St iCorrection
Ld I_xInput1 St TON_Signal.IN Ld tDelay St TON_Signal.PT Cal TON_Signal Ld TON_Signal.Q St Q_xOutput1 Ld TON_Signal.ET St tSequence
JUMP RETURN
  Ld iRawsize GT iMax JmpC TooGreat Ld iRawsize LT iMin JmpC TooSmall Ret Ld iMax St iRawsize Ret Ld iMin St iRawsize

 

 

1.3 ST.

 

ST 1.3.1

 

 

1.3.1 ST.

, , Q_xAccess1:= False; Q_xAccess2:= I_xInput2 & Not I_xInput4;
If I_xInput1 & I_xInput2 Then Q_xAccess1:= True; ElsIf I_xAccess2 & I_xAccess3 Then Q_xAccess2:= True; End_If;
iCorrected:= Limit(iMin, iBasis, iMax);
CTU_Access(CU:= xPulse, PV:= iMaxvalue, RESET:= xStop); iDisplay:= CTU_Access.QV; xFull:= CTU_Access.Q;
Repeat iLoop:= iLoop + 1; Until iLoop = 100 End_Repeat;

 

. ST FBD

ST FBD
Q_xOutput1:= I_xInput1 & Not I_xInput2 Or I_xInput3;

. : <>:= < ()>

 

: iCorrection:= Limit(iMin,iMeasuredvalue,iMax);

 

:

iCorrection:= Limit(iMin,Word_To_Int(wRawsize),iMax);

FBD :

. 1.3.1

 

. TON.

ST : : TON_Signal(IN:= I_xInput, PT:= tDelay); Q_xOutput:= TON_Signal.Q; tSequence:= TON_Signal.ET; : TON_Signal.IN:= I_xInput,; TON_Signal.PT:= tDelay; TON_Signal(); Q_xOutput:= TON_Signal.Q; tSequence:= TON_Signal.ET;

 

ST

1. IF

If I_xSensor1 & Not I_xSensor2 Then (* Instructions 1 *) ElsIf I_xSensor2 & Not I_xSensor1 Then (* Instructions 2 *) Else If iMeasuredvalue < 100 Then (* Instructions 3 *) ElsIf iMeasuredvalue > 100 Then (* Instructions 4 *) End_If; End_If; If (* Boolean condition *) Then (* Instructions *) End_If;

2. CASE

Case iProcesssize Of 7: (* Instructions 1 *) -2..1: (* Instructions 2 *) 2, 4: (* Instructions 3 *) 8..16, 20..30: (* Instructions 4 *) Else (* Instructions 5 *) End_Case; Case iProcessstep Of 0: (* Initialize *) If xInit_completed Then iProcessstep:= 10; End_If; 10: (* Execute Prozess 1 *) If xProcess1_completed Then iProcessstep:= 20; End_If; 20: (* Execute Prozess 2 *) If xProcess2_completed Then iProcessstep:= 30; End_If; (* etc. *) 500: (* Exceptionalhandling *) iProcessstep:= 0; End_Case;

3. FOR, REPEAT, WHILE

FOR:

For iIndex:= 1 To 20 By 1 Do

(* The following instructions are executed with *)

(* the values 1 to 20 for the variable iIndex *)

If arrMachine[iIndex].iTemp >= iLimitvalue Then

arrMachine[iIndex].iBroken:= True;

xAlarm:= True;

Exit;

End_If;

End_For;

 

REPEAT/ WHILE

REPEAT WHILE
Repeat iIndex:= iIndex + 10; Until iIndex >= iLimit End_Repeat; While iIndex >= iLimit Do iIndex:= iIndex + 10; End_While;

 

 

1.4 SFC:

 

.

. 1.4.1

 

SFC : Transitions , ; Actions , .

.

. 1.4.2

 

:

. . . . .

. .

 

. . , - .

. : . , .. . , .

 

.1.4.3

 

SFC. . N , .. . 1.1:

1.4.1

 
S Set This action is continued until it is explicitly reset (even if the corresponding step becomes inactive).
R reset Terminates the execution of action previously started with character S.
L time limited After activating the corresponding step, the action is executed for the set time or until step becomes inactive.
D time delayed Delay starts when step becomes active. After a set time has passed, the action is executed until step is deactivated. If the step becomes inactive, before the set time has passed, the action is not executed.
P pulse Starts when step becomes active/inactive and is executed once.
SD stored+ time delayed The action is executed until reset, but only starts after time delay has passed. Even if the step is active for less a time than the time delay.
DS time delayed+ stored The action is executed until reset, but only starts after time delay has passed. Unlike with the previous character, this does not happen if the step becomes inactive before time delay has passed.
SL stored+ time limited The action is executed for the set time, even if the step is active for a shorter time. The action can be reset with the character R.

. SFC : . . , .

 

:

 

. .

LD FBD IL ST SFC
Fu_XOR 3 +   + +  
Fu_Kod +   + +  
Fb_TTrigger + + + +  
Fb_TimeDelay     + +  
Fb_TrafficLight         +

 

:

1. Fu_XOR 3 .

2. Fu_Kod - .

3. Fb_TTrigger , .

4. Fb_TimeDelay - , 2 . LD+FBD.

5. Fb_TrafficLight .

 

:

1. 430 , . INTERBUS , .

2. Logic POUs FB_Group.

2.1 : Fb_TTrigger_XX, Fb_TimeDelay_XX, Fb_TrafficLight_XX. . : Fb_TTrigger_LD, Fb_TrafficLight_SFC, Fb_TimeDelay_LD_FBD.

3. Logic POUs FU_Group.

3.1 : Fu_XOR 3_, Fu_Kod_. . : Fu_XOR 3_LD, Fu_Kod_IL.

4. . .

4.1 . . , . .

 

.

 

4.2 , .

5. Main, CALL_FB_FU. .

6. . INTERBUS.

7. .

 

:

1. .

2. .

3. .

4. , .

5. .

6. .

 

 


.

 

 

 

1. 4 3 .

 

.

 

2. :

.

 

3. SFC .

. SFC

 

4. TON,

- ;

- ;

- .

 

.



<== | ==>
|
:


: 2016-09-03; !; : 850 |


:

:

, - , ; , - .
==> ...

1466 - | 1471 -


© 2015-2024 lektsii.org - -

: 0.061 .