Вы находитесь на странице: 1из 62

Http://plcforall.

com

LGPLC

http://plcforall.com
by:pyman rasehk

Http://plcforall.com

6 6 ' %:
BC #$ 7 - #$%

)*

( " #$%%& ' %&

+%, ' %&


(--

/- '

#$9 ( 7 #8 $
5@ A ?

6 2 5( 4 3& $ 01-2
? ><
/' = ;
B<
/ /( 7 #8 $ ;D
B< )* 6 0 H &
5G @ A /E F ;
B< )* 6 7
(J : ( 4 5 / $ 0;I
6 6 ( 4 %:

K (" $
4 %: L

I;DMmA
;!mA
NO P
M;DMmA
M;!mA
; MmA
; M; MmA
B$%%6 ($% ? U=0 I;DM mA

:R S % K T P ( ' Q

B? %& ( 7 #8 $ mA DM 0I ? " P
MM 0 MM ( VW
MM; MM L O, 5- B ? :
H / O DM MM - ? :
I MM
B? :
I;DM L O, 5

mA

mA

B )H @ , <5 7 1

B $

[mA

- $ -/

& 0,

3" $9

6 0 %*' %:

Y<U R ImA 8 X- 9
7$9 ]^[- ?3 % L ? 9 Z[\ 5 & < L

$= L 8 % *( " H /- A (
L * <[ - $
]3 2
B

_ @ O0-

mA T P
% *( " H /
B<
%5 ,
8 O
= A

3U 0

B$"

$=

3" < - = & <


)`0] % G

":

Multiturn
3U 0$%R ' A 0

Http://plcforall.com

International protection

+%, ( 43 U

<a Q

IP .1. .2. .3.


b9
T /c
(" F

<a Q 2
<a Q 2
<a Q 2
?%

IP000
.
.
.
IP686

B
BD
B

IP @

`0

eDe - *- IEC529 d
6 2 5f 30 -$ ( " U% ( 2
6 6 (- ' 3g 8 1$gB
_ IP <P ( & E 9 #
BD
L h- - T /c 1$g- 6 6 <& %& L 9 $
B
<& %& ,- - ]^[1 :%" / [
1$gBI
C( U 2 0>$% U" Contact less _ 3+ B!
_ j % i Z <g Be
# l P 0 9 G 6 _ U <[ Bk

6 6 m 6^, 1$gB
2
1$gBn
PLC U

(Ladder Diagram) LD 8
IEC61131-3 $
d^
(2

[( "

- PLC L \ 5

Simens Logo (2
Omron Zen (2
B$

&
-$ &

[( "
[( "

( " & ( - $% U" 8 - G - GR & (2


[( "
- GR & Display G (2
[( "
* o , _ 3+
B <9 /
0 PC 8 #
(2
("
BC $g e
_ 3+ > < -$o " 3 0 $+0B
B Ce
_ 3+ >< -$o " p 39 $+0BD
B< -$o
^ $+0B
B$
3& _ 3+
5Q BI
-$o ? P 5
0
& ( , %g $+0B!

B<

Programmable Logic Controller PLC


Simens
Omron
LG

CIMATIC
SYSMAC
GLOFA

-$ - ?6o >B <


+%, 0 H & G U PLC
< / g? U PLC : \ 5
<+%, 8 & < #$9 9 ( PLC g? U

C2
B $%&

# -/

Dr Udo String
IEC 61131-3
5

PLC (8
$
PLC U

): %
(4 8

Http://plcforall.com

1- LD ( Ladder Diagram )
2- FBD ( Function Block Diagram )
3- SFC ( Sequential Function Chart )
4- IL ( Instruction List )
5- ST ( Structured Text )

O& # : G
'

" PLC

6O3g

PLC ( " ( - - X
( "( - . /( " ( - -

PLC

& 6% ( $%%&

L 2:

-< # / &

-m ("

q"

3+0(
B$ P

IEC61131-3

PS

"$ 9

CPU

0...15
I

d ^ PLC
015
O

"

0.....7
O

- "( - - " f

0 @ ,

/# o

063
I

Profi pus (DP) ( " 6 9 8 $ 9


8 "
B$ 9
A 6 9 ?" ? - E 0$%&

&

- # &< <

- "( - - R
$ PLC G ^=
" ( - - r%3 8

Http://plcforall.com

$%%&
B< j %

,- /$"
1
" & 6% (
PLC
3" & HMI (Human Machine Interface)
<+%,

j%

1. WINCC
2. PMU MASTER
3. CITEK
"( - - (

<

%IB <
Bayt
%IW < e Word
` X %IX
`
"

<

%QB <
Bayt
%QW < e Word
` X %QX
`

% I X 0.0.0 %IX 0. 3 . 2
% Q X 0.0.0 % I X 0 . 3 .2
B$"
B $"
B$"

r # 39 s R <3 8 '@V # 39 s R <3 8 1( - - # 39 s R <3 8 1

Memory Map:
%I0.0.0
<[
5Q

%I0.0.1
<[
5Q

<[

%MW
e (HMI)
----------%Q0.0.0

%Q0.0.1

-----------

5Q

,
,
,

-----------

----------B$

----------t A

"( - -

5Q 8
U

4 /u 9 - $

L & NOT

5Q 8

/
R "- P
L & # c A2 1

& 3ZVg
A

5Q ( o

%IX0.02
5Q ( o
s R <3 =^% 3g

rH - (Result of Logic) RLO 1

R " = - 9 L 9- v H _

X- 9

& U

` G 3QA

<

s R <3 3g
BL & # c %QX0.0.0

5 p $ O& 3" 8 0 -8 r& " q = U 2


B$9 w0 4 /(

3U[

'W
8 $ O&

Http://plcforall.com

I1=%IX0.0.0
I2=%IX0.0.1
I3=%IX0.0.2
I4=%IX0.0.3

Q1=%QX0.0.0
Q2=%QX0.0.1
Q3=%QX0.0.2
Q3=%QX0.0.3
( 7( 2

ABC
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1

D'W

F
0
0
0
1
0
1
1
1

F=AB+BC+AC

IEC61131-3

d^

PLC

"#

(SINT) Short integer X 8 " # ;

10

- < W $g $ 0

- $%6 ' `9

5Q ( 58 < G Short integer X 8 " #


B$%& E F
%

< D ?3 @ A ( 0 H & ( 43 U
30
< 8 u 9 D ?3
;!
o 'W (
00000101
11111010 +
1+
-----------------11111011
-5
B? %&
00000001
11111110 +
1 +
--------------------11111011
Over

3g [' W W ; <

( L %i3" -

-1

5 Dy!x Dk W

$g- - ? %& T P (SINT) 8

7
B$"

/
flout

(USTNT) Unsigned short integer X 8 # ;D


6 < W $g E F ( E =5- $%& ' `9
5Q ( 58 < G E =5# X L
B $
-# X L
Sign < < Vg< ) -

11

Http://plcforall.com

- < W $g E F ( - $"

Integer X 8 # ;
5Q ( 58 < - # X L
B6 %

t A

Int=> -32768

< W $g E =5E F ( - $"

< W $g E F ( - $"

t A
B

t A

< W E =5 $g E F ( - $"

+32768

Un signed int X 8 " # ;I


5Q ( 58 < - # X L
- Sign < " # L
&

(DINT) Double integer X 8 # ;!


5Q ( 58 < 4R # X L
B< < Vg< D < B 6 % -

Unsigned Double integer X 8 # # ;e


t A
5Q 8 < 4R # X L
B $
-# X L
< Vg< B 6

12

=4,294,967,295
DINT -2,147,483,648 +2,147,483,647
$"
<
8 CIDnInekDn!> $gL
B

- < W $g E F ( - $"
B

< W E =5 $g E F ( - $"

<

4R LG $%
t A
B<

w O Dn! -

wIk - = [ D - <g

$0 k- 8- In

(LINT) Long Integer X 8 # ;k


t A
5Q 8 < < " # X L
-# X L
< Vg< B 6 %

Unsigned Long Integer X 8 # ;


t A
5Q 8 < < " # X L
B $
-# X L
< Vg< 6

Time X 8 # ;n
" PLC 8
+
%+ $%& \ 5< L 63 N O P ( " PLC
< - r%3 8 $% :
+ - $"
t A
B$"
8 @ A /< 5- $%%& #
8E F( # X L 8

T#3D2H4M36S541ms
$"$

13

%+ L -

Http://plcforall.com

(Timer) 3 0 %+ < #$ 39

% T
% D
=[ M
wS
w O ms

8 3"
< 8-

'W ( T#10S

#$9 ( H

B$ -

8
B$"
t A
6
+F- - ? U

Bool X 8 # ; M
5Q ( 58 < G E =5# X L
G ( 4 +F- ( & $% U" 3 $g- CM- >

Byte X 8 # ;
@ gV < E F ( - $"
t A
5Q 8 < G E =5# X L
B&
B$% U
6 p8 ( <
( 4 q< X 8 #
6
word X 8 # ; D
B $"$ t A
5Q 8 < - # X L
B$% U
6 p 8 ( < - L O ( "< -

B $"$ t A

14

Dword X 8 # ;
5Q 8 < 4R # X L

B$% U

6 p8 (

/ O

( "< -

Dword X 8 # ; I z
p8 ( <
L O ( 4 - $"$ t A
5Q 8 <
# X L
B$%%6 3 @ * L " PLC 3" >B$% U
6
Date,of Day,time,Date and time,String,Real,long X # $% " #
z
Real,
B$9 $" # { F 0 $+
CIEC>
CPulse timer>
COn Delay Timer> ,COff Delay Timer>]^[

" 3 0X
F 3 0;
0 3 0;D
0 3 0;

Cpulser timer> F 3 0;
- 8 ? %0 Pt
#$9 ( H
8 ET
5Q 8
"
5Q
$%6 ( ):

,- ?

7 q$%} } 0$%

| - ,

/? U

`0$
3" CIN> 3 0( - -
$%~ 3 } # 7 " 3 0? %}
B$ %} Q

15

?U %

2~3 R $ |

'W

Http://plcforall.com

BC#

16

> % [# R

3%" R Q

'W

c ET

#$9 ( H

B? " < U 4 -

COn Delay Timer> ,# cQ `


30

8-B

8 1$} "

( ` ?

?"

COff Delay Timer> ]^[


17

0 3 0;
< +FB :

~% L 3F
0 3 0;

c ET

#$9 ( H

8-B

cQ

30

< +FB :

B ? %} (8 $ #
8u 9 ?" P
M2- M1 0 - ' W
B 9p
60s8 $+ - # } } X- 9 M1 0 @
$ O} 8 N
B 9p
M1 0 # 3"- 9 L 9- M2 0 M1 $9 L 9- 8 r*15s T

B $9

18

8@ ,

/ $ -

Http://plcforall.com

B? %} p
- L 9- 8 p M3- M2- M1 0
?" P 'W
B$ 3 L 9O+ @$ - 9 L 9wM
0 M1 0 S1 $ O} 8 ;
B$ 3 L 9O+ @$ - 9 L 9- M1 $9 L 9- 8 r* w M M2 0 ;D
B$ 3 L 9O+ @$ - 9 L 9- M2 $9 L 9- 8 r* w ! qM3 ;
]^[ 8 r* M3 - 9 ]^[ w DM 8 $+ M2 0 C\ ]^[> M1 ]^[ 8 r* ;I
B 9 ]^[M2 0

?
cd 9
/ 5L 3F
D:\GMWIN 4\Source\m1m2m3
B
[
19

p
S 0 0 # - - $ 9 L 9- 6 6 S 0 0 s _ ! & $ U %
'W
L - $% 2 G3 R ?" :3" w$%R <9)7 $+ - $% 3 p
w$%R / - q$ 9
B$9
&

20

Http://plcforall.com

21

4& O L 6 5- 4% 6 5
4% 6 5 7 B $% U" 5Q $[5 ;
B$9 6
- - ( - - ( " # X $ L 6 5G ;D
B
- G # 3" - ( - - ( $+0L 6 5 " ;
ENO=1 qEN=1 # 7 " q< ENO *G - EN *G 24 L 6 5 " ;I
EN=1 & L ?h Og @ , L
# L 65
^ G 6% :
B
ENO=0 q<
CFB> 4& O L 6 5( 4 7 B? " < U ` G
4 / - <U (8
%+ $% U" 5Q ( ;
9 @: G
/ - - ( - - ("# $
m O L 6 5 G ;D
B$%9
B$9 9
- ( $+0- ( - - ( $+0$
FB G ;
& 9
0 :%" FB - < #$%%& ' +5 ( - - * G 24 FB " ;I
B 9 f UQ G
, `0G /#$%%& ' +5( - B $% U" FB 8

22

3 " #$ 39 - " 3 0

BC$%9 X G 8 $

3 Q "#

#$%%& U = ( " :O3g


B$% U" F X 8 U
6 > 8 ( " # 1 30 ( - -

B $%6

O [ 3" W GE
( - - - E =5 NE

U = ?"

4% 6 5- 4& O L 6 5<
B< #$9 # { F 0cd 4 /<

#o
#o

#$%%& U = ( " :O3g


B$% U" F X 8 U

IN1>IN2>IN3>IN4>IN5>IN6>IN7>IN88

7 2 CGreat than> GT

(- U
7 2 CGreat Equal> GL
IN1>=IN2>=IN3>=IN4>=IN5>=IN6>=IN7>=IN8
8 6R & CLess than> LT
IN1<IN2<IN3<IN4<IN5<IN6<IN7<IN8
(- U

23

6R & CLess Equal> LE

Http://plcforall.com

IN1<=IN2<=IN3<=IN4<=IN5<=IN6<=IN7<=IN8
IN1=IN2=IN3=IN4=IN5=IN6=IN7=IN8 (- U CEqual> EQ
B$%6

U =

( - - - E =5IN1 # IN2 (- U

B<
B<
3" - - ( - - ( " # - $9
2 4 -- =$
INT X 8

CNot Equal> NE
_ ?ZVg
6
[ OUT=1 $9 #$9 < g S 0 0# 7 " ;
[ OUT=0 $9 #$ < g S 0 0# 7 " ;D
8 ( " # X 8 _ ( " # 1 30( - - ;
( - - G 7 ' W ( > $%9 X G 8 $
CB$9 X G 8
4& O L 6 5- L 6 5<
B? - < $
F ] 0L ? " P

#o
'W

Out= (IN1+IN2)*(IN3+IN4)
B? %

TP

8 69

L 6 5@ A

] 0L

? %6 3g 8 @ , ? 9 9 m O L 6 5@ A
?" P
7New program - 5 Program ( %
< 8 &
# %* 3" ;
B 9 " a 69 L 0? 2 CCtrl+N> $ O& 3 = U ? %6

24

B 9 " a 8 # %* 0# &

B$ " 1
(- 4 - -

I- -D-

69 ;D

8 Q
& L ( q$ 9 N +0 4 - - 4 - - $ _ # %* ;I
& - ( q< #$9 #
( $g $ O& " (- _ 69 (- ;!
B 9 8 8 # %* 0$ "
5 $ O&

25

Http://plcforall.com

39 ( - - 0 $ %& G O& OK $ O& (- ( - - X - ( - - 1 T P 8 $+


B 9 #$ # %*L 8 [
- & @- 0L - @ , 3" ? %6 T P
4 - 4 - - 1 30T P 8 $+
L & $ %& G O& D $ O& (- ? " P
( 7 6 > # & G O& $ O&
: - m O s R <3
- 4 - - L * %+
:
[ 4 - - <3U[ 4 B
#
:
B< #$9 #
4 - - 4 - - 1 30 8 69

# %*

4 - - - ? %6

Q
$ 4% 6 5
/ -? :
& # %* ' Q
B? %6 ( )7 1 My_fun / - - ? "$
[
(

26

8 # %*- ? %6 Compile

8 # %*rH -

27

/rH -

Http://plcforall.com

28

29

Http://plcforall.com

G @ ,

- ? %6 #
B? %& #

L 6 5 O& 8 : #J- * G <


( ?
'Q
&
8 -?9 9
( & P & $ L 65
$/
8@ A
L 6 5-

[function0 1
B +

cd

?O 5@ ,

0 $6 m O L 6 5<
B<

IN1 IN2 IN3 IN4 IN5 IN6 IN7 out


0 0 0 0 0 0 0 1

30

] 0L <
< T O^
8@ A

=
D' W
'-$

1
*
*
*
*
*

0
1
*
*
*
*

0
0
1
*
*
*

0
0
0
1
*
*

0
0
0
0
1
*

0
0
0
0
0
1

0
0
0
0
0
0

2
3
4
5
6
7

31

Http://plcforall.com

B< @ , L

B$ %& Q

32

$ m O -

m V L 6 5@ A DzI $6 G ' W

<

$$ m O L 6 5

4& O L 6 5- L 6 5
4% 6 5- 4% 6 5S & 0

8@ A

/m O L 6 -

( - -(" ` #
IN BOOl
T_ON Time
T_Off Time
Q
Bool
BOOL 8

CD
& Q
G - BOOL X 8 ( - - $ 3 Q m O L 6 5 <
0 [
B 9 N +0'- $
B$ U % LCD L 6 5
B?
4 - 8 +3
" ( - - 8 ]3
MOVE
8

33

Http://plcforall.com

C' 3

C$

>(

g $g

(%

$g

$ 0# o

" #$ 39
B
- 8 ( " #$ 39 _ 3+ " PLC 30
C$ " PLC 3"> UP Counter ( +, #$ 39 ;
C$ " PLC 3"> Down Counter -2 #$ 39 ;D
W& &> Up/Down Counter -2 ( +, #$ 39 ;
Ring Counter ( =OQ #$ 39 ;I
CUp Counter> ( +, #$ 39 ;

CU=counter up input pulse (Bool)


R=Reset Input (Bool)
PV=Preset value (Int)
Q=Counter out put ( Bool)
CV=Counter value (Int)
R=1
CV=0 CV=>PV
Q=1

<U

3 0R

r *( - -

-$

v 25 6 CV $= CU ( - - r * "
B :
, CV $= B ? %~ ?
/r *1 7 pv=3 5 ' Q

34

C$ " PLC 3"> Down Counter


CD=Counter Down input pulse (Bool)
LD=Load preset value (Bool)
PV=Preset value (Int)
Q=Counter output (Bool)
CV=Counter value (Int)
LD=1 CV=PV
CV=<0 Q=1

B$%6 p 39 X- 9 L * _ 8 LD=0

-2 #$ 39 ;D

[-

CUP/Down Counter> -2 ( +, #$ 39 ;

35

Http://plcforall.com

CU=Counter up pulse Input (Bool)


CD=Counter Down pulse Input (Bool)
R=Reset Input (Bool)
1
LD=Load preset value (Int)
PV=Preset value (Int)
---QU=Up Counter output (Bool)
QD=Down Counter Output (Bool)
CV=Counter value (Int)

-----------------------------| R=1
CV = 0
| LD =1
CV = PV
| CV => PV
QU =
| CV =< 0
QD=1
--------------------------

CRing Counter> ( =OQ #$ 39 ;I

CU=Counter up pulse Input (Bool)


PV=Preset value (Int)
36

R=Rest Input
B

$" P CV PV # :i " #$ 39 L
PV=4 ( ' W

1
2
3
4
^
|
|
|
-------------------

GMWIN L 6 5$ 3 G 3" 9 G 7 SET <


[ , 3" 9 G 7 RESET < (

B$ 3

5Q

9 # 8 IN2 $ O& 7 -

G A

5Q

9 # 8 IN1 $ O& 7 \ 5 69
B
,

'W
G

/ : T D8 -$
- :9 30 /T
8 < T !( 1
r *G
- 5 " & ( ^ ? & ,- S % U% G
"( - - $
<
eMMMM 1
< 5a q : ( 4
^% 3"
- U% Q< T O^
B T " 8 #$9 - @ L +0 ;
( --T
8 #$9 - @ L +0 ;D
T " 8 #$9 @ L +0 ;
& @ L +0 ;I
37

Http://plcforall.com

$
eMMMM @
$ 98 ( - -(4
& $ *v " &
' * $= R ( - 7 " $ %& L +0 q$9

38

1
@
$+0 ;!
$+0 7 q 9 U ( - - ( 4 ;e
!IMMM ( - - @
$+0 7 ;k
0 k!M
E O " <3 [ 7 ;
B< # & <5

$"$
_RTC_TOD

+[-

8 - $ 3 <g $% 3"

CReal Time Clock> RTC


- (/@ A
$ P

o "

Time Of Day
8-

8< 5

TOD#00:00:00
TOD#23:59:59.999
B$%& L 9-

B 9 (8 $ #

0 G ! < ` n <g 8 #8- 3" & $ %& Q

< ` e-

< ` n #8- 3" & $ %& Q


39

( $ 'W

'W

Http://plcforall.com

_RTC_Week

I-

<g 8 - q %9

q %9- q %9 ( "8-

40

" ( "8Mq %9q %9


Dq %9 4R
q % %*
Iq +3
!q %9
eq % 6
( 0 ?"
'W
B$%& &

_RTC_Time[ $g]
|
----------------------------------------------------------------------------------------|
|
|
|
|
|
|
|
0
1
2
3
4
5
6
7
'
#
# "8<g
=[
w
" ( "8[
MM M
M
MM
MM
MM
M
DM

nn
D
D
!n
!n
e
D
'W ( 'W
_RTC_Time[6]=_RTC_Week
<g 8 # " DI
DM L %i3" - # " !
M ( "8- & $ U %
'W
B 9 L 9- s _ G DM M

41

Http://plcforall.com

V #$ 39 ' W

GMWIN
F_Trig

#$ - L *

42

": 0

R_Trig

#$ - _

( 4 8 r *$ 0
= [ " r *$ 0 N

B$

NO P

8] =

0 6 r *$ 0( ?" " PLC


<g

"

r *$ 0 T

8- "

r *$ 0

_RTC_Time [7]

B$%& <g r *G = [ ! " PLC ? " P


43

'W

Http://plcforall.com

B$9

9 ? %0 [Duty cycle G ? 0

# 8 $, SEG -

r * "(8

PLC " <%3:


- PLC L 6 5G

SEG

Function
If EN is 1, it converts BCD or HEX (hexadecimal) of IN into 7 segment display code
as below and produces output OUT. If an input is BCD type, it is available to display
a number between 0000 and 9999. And in case of HEX input, its available to display
a number between 0000 and FFFF on 4-digit 7 segment display.
Display example:
1) 4-digit BCD -> 4-digit 7 segment code: use SEG function
2) 4-digit HEX -> 4-digit 7 segment code: use SEG function
3) INT -> 4-digit BCD-type 7 segment code use INT_TO_BCD function first and
SEG function

44

4) INT - 4-digit HEX-type 7 segment code: use INT_TO_WORD function first and
SEG function
5) When 7 segment display digits are more than 4,
A) in case of BCD, HEX type, use SEG function, after dividing them into 4 digits.
B)INT -> 8-digit BCD-type 7 segment code
Divide INT by 10,000 and convert quotient and remainder into upper/lower 4-digit
7 segment code using INT_TO_BCD and SEG function

(1) If the transition condition (%M0)01 SEG function is executed.


(2) If input variable BCD_DATA (WORD) = 16#1234.
The output is 2#00000110_0l011011_0l001111_01100110 which is displayed as a 7
segment code (1234) and written at SEG_PATTERN (DWORD).

45

Http://plcforall.com

X 8 7 - $9 Dword X 8 $

& XOR p

/?

X $9 Word X 8 7 ( - - # X
B$9 Long word X 8 $
Dword

#$9 #

&

&
B

B? U

. 2 @ A ?U
46

<g

"
[
'W

$9
B? %

47

8@ A $ L

PM - AM @ A ? " P ' Q

Http://plcforall.com

("
Subroutine call
Jump
Return\
("
Shift
Rotate
10111001

11001000

<

<3 ( 4

-$

Shift left
, < <3 ( 4
$
p8

Shift Right
B< Q /r6g - _

Rotate

48

012345678-

8 ( 4% 6 5(-

ADD-Time
Sub-Time
Mul-time
Div-Time
Concat-Time
Sub-TOD
Sub-date
Sub-DT
?"

49

8-

0 o ( " :O3g

& ]3 ADD-Time ;

Http://plcforall.com

?" 8

50

8 - d 0Sub-Time;D

$gG

51

& T F Mul-Time ;

Http://plcforall.com

$gG

52

8 ? U=0Div-Time ;I

?"

8-

53

& A Concat-Time ;!

Http://plcforall.com

: $6 8

54

8 - d 0Sub-TOD ;e

?" 8 8- 0d 0Sub-Date ;k

55

Http://plcforall.com

8 - 8- d 0Sub_DT ;

56

PLC
d[ 2
A/D '
.
D/A. / '

Bt AP Error # 39

1$&

& ? %6

4 - -( -$
( 4 %:

5+

B
& rQ @ & 7
( " Error X - $"$
@ & < +[
B$"$
INT @ ,
5 @ gV
B$"$
@ & /
0 '
$"$
< #$9 S A & 0V
B
[@V
PLC

4 20MA
1 5V
57

DONE
STAT
DATA
& CH
SLOT

J --

Http://plcforall.com

0 10V
-10 10 v
0 5V
B 8 #- 7 < U $% U" 0 $
_ #- 7
B? %& 3g 8 @ , $ r6g J $= @ Q $ 0(
B ? %& $ 04-20MA
0-100 cg @ Q ? " P ' W
0 ----------------------- 100 cg
|
|
4 ------------------------20 MA
20-4=16MA
X=16MA/100=0.16MA

"(8
? %& #$ /<

$= 5F

0.16MA+4MA=4.16MA
B$"$
1cg $= PLC $%&
$= $

&L (
B$ /<

$"

B$ 3 ' %& 8 @ AP
T=0 60 # : ( g &
T=60 75
& ^
T=75 85
Error
T >85
Stop

$=

<U5/ $= ' Q

$ 8 7 %+ 4.16MA

#8 $ N O P ( "
PLC ? " P ' Q
$= 0? " v 25
@ ,
0.16MA
B
#
@ & # 3" & %o%
# : G @ Q & $ %& ? %0- Q ( $ ' W

OU

0 ----------------------- 100 cg
|
|
4 ------------------------20 MA
X=(20-4)mA / 100 = 0.16 mA
T=0*0.16
0+4
4mA
T=60*0.16
9.6+4 = 13.6mA
T=75*0.16 12+4 =
16mA
T=85*0.16
13.6+4 = 17.6mA
B? %6
o _ ( "# - .

0& (- 8
58

= @ & %o%

0 'Q

( 3g o (& / = ^= - 4-20 mA
A $= ($% S %0- _
#$ /<
=
T=0

=5 = @ & %o% (- 8
0 ' Q #$9 #
[
B? -/ <

5mA
1000
------- = ------4mA
A
A=4mA*1000 /5mA =800
B? %6
o
= S 0 0L 3" - A=800 $= T=0 ( r*
T=0 A=800
T=60 A=2720
T=75 A=3200
T=85 A=3520
$g " v 3 &
#
@ & DATA ( $g @ ,
= L
?
R &? 9
B<
60 (- @ Q
$9 2720 $= 7 VW

4mA

Q $+ L 8
PT100 @ &
B? %6
Q
/ $ ' W ( "#

59

&# &? 1
0 ' Qq<

&
$

3g % 0
$ " - ' %&

Http://plcforall.com

4 /T P - 40 &
BJ - <

&I ' & "-

( - - I 1$& " &

25 1

/(

&

%g 0

60

' &I @ & "

DA420
D/A - @ &
M @ & (- ( - - T P (

B J - - $%6 T P

? &T P

06

&

' 3g 8

JUMP
9 -$ L * _ 8 p *
8 LOOP 8 3U[
L
: #$

RETURN - SCAL
l P
8
&?
$%R 8
&
9
[- SCAL
SCAL G $
" ( <U /1
(8 @ A% h $%%& & ? 8
7 # - & #$9 #
Return
8 / *
"57
B< #$9 #$ & A0
: :R 8 69 $ 3 & X- 9 /8 - #
&

61

Http://plcforall.com

ON < Q /qON O [L 6

ON < Q /qOFF O [L 6

q(

q(

&L6

&L6

ON O [

OFF O [

Off /< #$9 #


5Q 6 +[
< L6 G '
9

( $4:

ON /< #$9 #
5Q 6 +[
.< L 6 G '
9

( $4:

&L6

&L6

OFF /v HR 0 < Q 7
B < ( L6
ON U -

ON /v HR 0 < Q 7
B < ( L6
ON U -

/@ o F 0

62