You are on page 1of 11

Totally Integrated

Automation Portal

Main [OB1]
Main Propiedades
General
Nombre Main Número 1 Tipo OB Idioma FUP
Numeración automática
Información
Título "Main Program Sweep (Cy‐ Autor Comentario Familia
cle)"
Versión 0.1 ID personaliza‐
da

Nombre Tipo de datos Offset Valor predet. Comentario


Temp
OB1_EV_CLASS Byte 0.0 Bits 0-3 = 1 (Coming event), Bits 4-7 = 1 (Event class 1)
OB1_SCAN_1 Byte 1.0 1 (Cold restart scan 1 of OB 1), 3 (Scan 2-n of OB 1)
OB1_PRIORITY Byte 2.0 Priority of OB Execution
OB1_OB_NUMBR Byte 3.0 1 (Organization block 1, OB1)
OB1_RESERVED_1 Byte 4.0 Reserved for system
OB1_RESERVED_2 Byte 5.0 Reserved for system
OB1_PREV_CYCLE Int 6.0 Cycle time of previous OB1 scan (milliseconds)
OB1_MIN_CYCLE Int 8.0 Minimum cycle time of OB1 (milliseconds)
OB1_MAX_CYCLE Int 10.0 Maximum cycle time of OB1 (milliseconds)
OB1_DATE_TIME Date_And_Time 12.0 Date and time OB1 started
Constant

Segmento 1:

>=1
%M0.5
"on"
%M1.6 &
"aon" %M1.6
"aon"
%M1.7 =
"aoff"

Símbolo Dirección Tipo Comentario


"aoff" %M1.7 Bool
"aon" %M1.6 Bool
"on" %M0.5 Bool

Segmento 2:

%M1.7
"aoff"
=
%M0.6
"off"

Símbolo Dirección Tipo Comentario


"aoff" %M1.7 Bool
"off" %M0.6 Bool

Segmento 3:
restabecer es un swithc sino no vale

%M2.1
"arest"
=
%M1.0
"rest"

Símbolo Dirección Tipo Comentario


"arest" %M2.1 Bool
"rest" %M1.0 Bool

Segmento 4:

%M2.0
"acarg"
=
%M0.7
"carg"

Símbolo Dirección Tipo Comentario


"acarg" %M2.0 Bool
"carg" %M0.7 Bool

Segmento 5:
Totally Integrated
Automation Portal

>=1
%M2.1
"arest"
%M76.0 &
"ele" %M76.0
"ele"
%M2.0 =
"acarg"

Símbolo Dirección Tipo Comentario


"acarg" %M2.0 Bool
"arest" %M2.1 Bool
"ele" %M76.0 Bool

Segmento 6:

&
%M0.0
"baj"
%M1.2
"amed"
%M1.3 %M1.1
"aalt" "abaj"
%M76.0 =
"ele"

Símbolo Dirección Tipo Comentario


"aalt" %M1.3 Bool
"abaj" %M1.1 Bool
"amed" %M1.2 Bool
"baj" %M0.0 Bool
"ele" %M76.0 Bool

Segmento 7:

&
%M0.1
"med"
%M1.1
"abaj"
%M1.3 %M1.2
"aalt" "amed"
%M76.0 =
"ele"

Símbolo Dirección Tipo Comentario


"aalt" %M1.3 Bool
"abaj" %M1.1 Bool
"amed" %M1.2 Bool
"ele" %M76.0 Bool
"med" %M0.1 Bool

Segmento 8:

&
%M0.2
"alt"
%M1.1
"abaj"
%M1.2 %M1.3
"amed" "aalt"
%M76.0 =
"ele"

Símbolo Dirección Tipo Comentario


"aalt" %M1.3 Bool
"abaj" %M1.1 Bool
"alt" %M0.2 Bool
"amed" %M1.2 Bool
"ele" %M76.0 Bool

Segmento 9:

&
%M0.3
"hor"
%M1.5 %M1.4
"aant" "ahor"
%M76.0 =
"ele"

Símbolo Dirección Tipo Comentario


"aant" %M1.5 Bool
"ahor" %M1.4 Bool
"ele" %M76.0 Bool
"hor" %M0.3 Bool
Totally Integrated
Automation Portal

Segmento 10:

&
%M0.4
"ant"
%M1.4 %M1.5
"ahor" "aant"
%M76.0 =
"ele"

Símbolo Dirección Tipo Comentario


"aant" %M1.5 Bool
"ahor" %M1.4 Bool
"ant" %M0.4 Bool
"ele" %M76.0 Bool

Segmento 11:

MOVE
%M1.1 %MD4
"abaj" EN OUT1 "var1" MOVE
DINT#1 IN ENO EN %MD8
OUT1 "var2" MOVE
DINT#0 IN ENO EN %MD12
OUT1 "var3"
DINT#0 IN ENO

Símbolo Dirección Tipo Comentario


"abaj" %M1.1 Bool
"var1" %MD4 DInt
"var2" %MD8 DInt
"var3" %MD12 DInt

Segmento 12:

MOVE
%M1.2 %MD8
"amed" EN OUT1 "var2" MOVE
DINT#1 IN ENO EN %MD4
OUT1 "var1" MOVE
DINT#0 IN ENO EN %MD12
OUT1 "var3"
DINT#0 IN ENO

Símbolo Dirección Tipo Comentario


"amed" %M1.2 Bool
"var1" %MD4 DInt
"var2" %MD8 DInt
"var3" %MD12 DInt

Segmento 13:

MOVE
%M1.3 %MD12
"aalt" EN OUT1 "var3" MOVE
DINT#1 IN ENO EN %MD4
OUT1 "var1" MOVE
DINT#0 IN ENO EN %MD8
OUT1 "var2"
DINT#0 IN ENO

Símbolo Dirección Tipo Comentario


"aalt" %M1.3 Bool
"var1" %MD4 DInt
"var2" %MD8 DInt
"var3" %MD12 DInt

Segmento 14:

MOVE
%M1.4 %MD16
"ahor" EN OUT1 "var4" MOVE
DINT#1 IN ENO EN %MD20
OUT1 "var5"
DINT#0 IN ENO

Símbolo Dirección Tipo Comentario


"ahor" %M1.4 Bool
"var4" %MD16 DInt
"var5" %MD20 DInt

Segmento 15:
Totally Integrated
Automation Portal

MOVE
%M1.5 %MD20
"aant" EN OUT1 "var5" MOVE
DINT#1 IN ENO EN %MD16
OUT1 "var4"
DINT#0 IN ENO

Símbolo Dirección Tipo Comentario


"aant" %M1.5 Bool
"var4" %MD16 DInt
"var5" %MD20 DInt

Segmento 16:

%DB5
"contaux"
== CTU
Int Int
%MW54 %M0.7
"acontres" IN1 "carg" CU
2 IN2 R %MW54
CV "acontres"
2 PV Q

Símbolo Dirección Tipo Comentario


"acontres" %MW54 Int
"carg" %M0.7 Bool

Segmento 17:

CONV
Int to DInt
... EN %MD50
%MW54 OUT "contres"
"acontres" IN ENO

Símbolo Dirección Tipo Comentario


"acontres" %MW54 Int
"contres" %MD50 DInt

Segmento 18:

>=1
%M2.0
"acarg"
%M2.1 &
"arest"

==
DInt
%MD4
"var1" IN1 MOVE
DINT#1 IN2 EN %MD24
OUT1 "res1" MOVE
DINT#1 IN ENO EN %MD28
OUT1 "res2" MOVE
DINT#0 IN ENO EN %MD32
OUT1 "res3"
DINT#0 IN ENO

Símbolo Dirección Tipo Comentario


"acarg" %M2.0 Bool
"arest" %M2.1 Bool
"res1" %MD24 DInt
"res2" %MD28 DInt
"res3" %MD32 DInt
"var1" %MD4 DInt

Segmento 19:

>=1
%M2.0
"acarg"
%M2.1 &
"arest"

==
DInt
%MD8
"var2" IN1 MOVE
DINT#1 IN2 EN %MD24
OUT1 "res1" MOVE
DINT#0 IN ENO EN %MD28
OUT1 "res2" MOVE
DINT#1 IN ENO EN %MD32
OUT1 "res3"
DINT#0 IN ENO

Símbolo Dirección Tipo Comentario


"acarg" %M2.0 Bool
Totally Integrated
Automation Portal

Símbolo Dirección Tipo Comentario


"arest" %M2.1 Bool
"res1" %MD24 DInt
"res2" %MD28 DInt
"res3" %MD32 DInt
"var2" %MD8 DInt

Segmento 20:

>=1
%M2.0
"acarg"
%M2.1 &
"arest"

==
DInt
%MD12
"var3" IN1 MOVE
DINT#1 IN2 EN %MD24
OUT1 "res1" MOVE
DINT#0 IN ENO EN %MD28
OUT1 "res2" MOVE
DINT#0 IN ENO EN %MD32
OUT1 "res3"
DINT#1 IN ENO

Símbolo Dirección Tipo Comentario


"acarg" %M2.0 Bool
"arest" %M2.1 Bool
"res1" %MD24 DInt
"res2" %MD28 DInt
"res3" %MD32 DInt
"var3" %MD12 DInt

Segmento 21:

>=1
%M2.0
"acarg"
%M2.1 &
"arest"

==
DInt
%MD16
"var4" IN1 MOVE
DINT#1 IN2 EN %MD36
OUT1 "res4" MOVE
DINT#1 IN ENO EN %MD40
OUT1 "res5"
DINT#0 IN ENO

Símbolo Dirección Tipo Comentario


"acarg" %M2.0 Bool
"arest" %M2.1 Bool
"res4" %MD36 DInt
"res5" %MD40 DInt
"var4" %MD16 DInt

Segmento 22:

>=1
%M2.0
"acarg"
%M2.1 &
"arest"

==
DInt
%MD20
"var5" IN1 MOVE
DINT#1 IN2 EN %MD36
OUT1 "res4" MOVE
DINT#0 IN ENO EN %MD40
OUT1 "res5"
DINT#1 IN ENO

Símbolo Dirección Tipo Comentario


"acarg" %M2.0 Bool
"arest" %M2.1 Bool
"res4" %MD36 DInt
"res5" %MD40 DInt
"var5" %MD20 DInt

Segmento 23:
Totally Integrated
Automation Portal

Segmento 23:
==
DInt
%MD50
"contres" IN1 MOVE
DINT#0 IN2 EN
%MD56
%MD24 OUT1 "ares1" MOVE
"res1" IN ENO EN
%MD60
%MD28 OUT1 "ares2" MOVE
"res2" IN ENO EN
%MD64
%MD32 OUT1 "ares3" MOVE
"res3" IN ENO EN
%MD68
%MD36 OUT1 "ares4"
"res4" IN ENO 1

MOVE
1 EN
%MD72
%MD40 OUT1 "ares5"
"res5" IN ENO

Símbolo Dirección Tipo Comentario


"ares1" %MD56 DInt
"ares2" %MD60 DInt
"ares3" %MD64 DInt
"ares4" %MD68 DInt
"ares5" %MD72 DInt
"contres" %MD50 DInt
"res1" %MD24 DInt
"res2" %MD28 DInt
"res3" %MD32 DInt
"res4" %MD36 DInt
"res5" %MD40 DInt

Segmento 24:

Segmento 24:
==
DInt
%MD50
"contres" IN1 MOVE
DINT#1 IN2 EN
%MD98
%MD24 OUT1 "bres1" MOVE
"res1" IN ENO EN
%MD102
%MD28 OUT1 "bres2" MOVE
"res2" IN ENO EN
%MD106
%MD32 OUT1 "bres3" MOVE
"res3" IN ENO EN
%MD110
%MD36 OUT1 "bres4"
"res4" IN ENO 1

MOVE
1 EN
%MD114
%MD40 OUT1 "bres5"
"res5" IN ENO

Símbolo Dirección Tipo Comentario


"bres1" %MD98 DInt
"bres2" %MD102 DInt
"bres3" %MD106 DInt
"bres4" %MD110 DInt
"bres5" %MD114 DInt
"contres" %MD50 DInt
"res1" %MD24 DInt
"res2" %MD28 DInt
"res3" %MD32 DInt
"res4" %MD36 DInt
"res5" %MD40 DInt

Segmento 25:

==
DInt &
%MD24 %M1.6
"res1" IN1 "aon" >=1
DINT#1 IN2

%Q0.0 &
"fbaj"

<>
DInt %Q0.0
%MD24 %M1.7 "fbaj"
"res1" IN1 "aoff" =
DINT#0 IN2
Totally Integrated
Automation Portal

Símbolo Dirección Tipo Comentario


"aoff" %M1.7 Bool
"aon" %M1.6 Bool
"fbaj" %Q0.0 Bool
"res1" %MD24 DInt

Segmento 26:

==
DInt &
%MD28 %M1.6
"res2" IN1 "aon" >=1
DINT#1 IN2

%Q0.1 &
"fmed"

<>
DInt %Q0.1
%MD28 %M1.7 "fmed"
"res2" IN1 "aoff" =
DINT#0 IN2

Símbolo Dirección Tipo Comentario


"aoff" %M1.7 Bool
"aon" %M1.6 Bool
"fmed" %Q0.1 Bool
"res2" %MD28 DInt

Segmento 27:

==
DInt &
%MD32 %M1.6
"res3" IN1 "aon" >=1
DINT#1 IN2

%Q0.2 &
"falt"

<>
DInt %Q0.2
%MD32 %M1.7 "falt"
"res3" IN1 "aoff" =
DINT#0 IN2

Símbolo Dirección Tipo Comentario


"aoff" %M1.7 Bool
"aon" %M1.6 Bool
"falt" %Q0.2 Bool
"res3" %MD32 DInt

Segmento 28:

==
DInt &
%MD36 %M1.6
"res4" IN1 "aon" >=1
DINT#1 IN2

%Q0.3 &
"fhor"

<>
DInt %Q0.3
%MD36 %M1.7 "fhor"
"res4" IN1 "aoff" =
DINT#0 IN2

Símbolo Dirección Tipo Comentario


"aoff" %M1.7 Bool
"aon" %M1.6 Bool
"fhor" %Q0.3 Bool
"res4" %MD36 DInt

Segmento 29:

==
DInt &
%MD40 %M1.6
"res5" IN1 "aon" >=1
DINT#1 IN2

%Q0.4 &
"fant"

<>
DInt %Q0.4
%MD40 %M1.7 "fant"
"res5" IN1 "aoff" =
DINT#0 IN2
Totally Integrated
Automation Portal

Símbolo Dirección Tipo Comentario


"aoff" %M1.7 Bool
"aon" %M1.6 Bool
"fant" %Q0.4 Bool
"res5" %MD40 DInt

Segmento 30:

& %DB1
%M1.6 "timer"
"aon" TON
%DB1.DBX0.0 Time %DB1.DBX0.0
"timer".IN IN "timer".IN
ET ... =
T#1000ms PT Q

Símbolo Dirección Tipo Comentario


"aon" %M1.6 Bool
"timer".IN %DB1.DBX0.0 Bool

Segmento 31:

%DB2
"conter"
>=1 CTU
%M2.0 Int
"acarg" %DB1.DBX0.0
%M2.1 "timer".IN CU %M48.0
"arest" R %MW2 "asirena"
CV "acont" =
30 PV Q

Símbolo Dirección Tipo Comentario


"acarg" %M2.0 Bool
"acont" %MW2 Int
"arest" %M2.1 Bool
"asirena" %M48.0 Bool
"timer".IN %DB1.DBX0.0 Bool

Segmento 32:

CONV
Int to DInt
... EN %MD44
%MW2 OUT "cont"
"acont" IN ENO

Símbolo Dirección Tipo Comentario


"acont" %MW2 Int
"cont" %MD44 DInt

Segmento 33:
alarma

& %DB3
%M48.0 "alarm1"
"asirena" TON
%DB4.DBX0.0 Time %DB3.DBX0.0
"alarm2".IN IN "alarm1".IN
ET ... =
T#500ms PT Q

Símbolo Dirección Tipo Comentario


"alarm1".IN %DB3.DBX0.0 Bool
"alarm2".IN %DB4.DBX0.0 Bool
"asirena" %M48.0 Bool

Segmento 34:

%DB4
"alarm2"
TON
Time %DB4.DBX0.0
%DB3.DBX0.0 "alarm2".IN
"alarm1".IN IN ET ... =
T#500ms PT Q

Símbolo Dirección Tipo Comentario


"alarm1".IN %DB3.DBX0.0 Bool
"alarm2".IN %DB4.DBX0.0 Bool

Segmento 35:
Totally Integrated
Automation Portal

&
%DB3.DBX0.0 %Q0.5
"alarm1".IN "fsirena"
%DB4.DBX0.0 =
"alarm2".IN

Símbolo Dirección Tipo Comentario


"alarm1".IN %DB3.DBX0.0 Bool
"alarm2".IN %DB4.DBX0.0 Bool
"fsirena" %Q0.5 Bool

Segmento 36:

Segmento 36:
==
Int &
%MW54 %M1.0
"acontres" IN1 "rest" MOVE
1 IN2 EN
%MD4
%MD56 OUT1 "var1" MOVE
"ares1" IN ENO EN
%MD8
%MD60 OUT1 "var2" MOVE
"ares2" IN ENO EN
%MD12
%MD64 OUT1 "var3"
"ares3" IN ENO 1

MOVE
1 EN
%MD16
%MD68 OUT1 "var4" MOVE
"ares4" IN ENO EN
%MD20
%MD72 OUT1 "var5"
"ares5" IN ENO

Símbolo Dirección Tipo Comentario


"acontres" %MW54 Int
"ares1" %MD56 DInt
"ares2" %MD60 DInt
"ares3" %MD64 DInt
"ares4" %MD68 DInt
"ares5" %MD72 DInt
"rest" %M1.0 Bool
"var1" %MD4 DInt
"var2" %MD8 DInt
"var3" %MD12 DInt
"var4" %MD16 DInt
"var5" %MD20 DInt

Segmento 37:

Segmento 37:
==
Int &
%MW54 %M1.0
"acontres" IN1 "rest" MOVE
0 IN2 EN
%MD4
%MD98 OUT1 "var1" MOVE
"bres1" IN ENO EN
%MD8
%MD102 OUT1 "var2" MOVE
"bres2" IN ENO EN
%MD12
%MD106 OUT1 "var3"
"bres3" IN ENO 1

MOVE
1 EN
%MD16
%MD110 OUT1 "var4" MOVE
"bres4" IN ENO EN
%MD20
%MD114 OUT1 "var5"
"bres5" IN ENO

Símbolo Dirección Tipo Comentario


"acontres" %MW54 Int
"bres1" %MD98 DInt
"bres2" %MD102 DInt
"bres3" %MD106 DInt
"bres4" %MD110 DInt
"bres5" %MD114 DInt
"rest" %M1.0 Bool
"var1" %MD4 DInt
"var2" %MD8 DInt
"var3" %MD12 DInt
"var4" %MD16 DInt
"var5" %MD20 DInt
Totally Integrated
Automation Portal

Segmento 38:

MOVE
%Q0.0 %MD78
"fbaj" EN OUT1 "fbb" MOVE
DINT#1 IN ENO EN %MD82
OUT1 "fmm" MOVE
DINT#0 IN ENO EN %MD86
OUT1 "faa"
DINT#0 IN ENO

Símbolo Dirección Tipo Comentario


"faa" %MD86 DInt
"fbaj" %Q0.0 Bool
"fbb" %MD78 DInt
"fmm" %MD82 DInt

Segmento 39:

MOVE
%Q0.1 %MD82
"fmed" EN OUT1 "fmm" MOVE
DINT#1 IN ENO EN %MD78
OUT1 "fbb" MOVE
DINT#0 IN ENO EN %MD86
OUT1 "faa"
DINT#0 IN ENO

Símbolo Dirección Tipo Comentario


"faa" %MD86 DInt
"fbb" %MD78 DInt
"fmed" %Q0.1 Bool
"fmm" %MD82 DInt

Segmento 40:

MOVE
%Q0.2 %MD86
"falt" EN OUT1 "faa" MOVE
DINT#1 IN ENO EN %MD78
OUT1 "fbb" MOVE
DINT#0 IN ENO EN %MD82
OUT1 "fmm"
DINT#0 IN ENO

Símbolo Dirección Tipo Comentario


"faa" %MD86 DInt
"falt" %Q0.2 Bool
"fbb" %MD78 DInt
"fmm" %MD82 DInt

Segmento 41:

MOVE
%Q0.3 %MD90
"fhor" EN OUT1 "fhh" MOVE
DINT#2 IN ENO EN %MD94
OUT1 "fantt"
DINT#0 IN ENO

Símbolo Dirección Tipo Comentario


"fantt" %MD94 DInt
"fhh" %MD90 DInt
"fhor" %Q0.3 Bool

Segmento 42:

MOVE
%Q0.4 %MD94
"fant" EN OUT1 "fantt" MOVE
DINT#2 IN ENO EN %MD90
OUT1 "fhh"
DINT#0 IN ENO

Símbolo Dirección Tipo Comentario


"fant" %Q0.4 Bool
"fantt" %MD94 DInt
"fhh" %MD90 DInt

Segmento 43:
Totally Integrated
Automation Portal

MOVE
%M1.7 %MD78
"aoff" EN OUT1 "fbb" MOVE
DINT#0 IN ENO EN %MD82
OUT1 "fmm" MOVE
DINT#0 IN ENO EN %MD86
OUT1 "faa" MOVE
DINT#0 IN ENO EN %MD94
OUT1 "fantt" MOVE
DINT#0 IN ENO EN %MD90
OUT1 "fhh"
DINT#0 IN ENO

Símbolo Dirección Tipo Comentario


"aoff" %M1.7 Bool
"faa" %MD86 DInt
"fantt" %MD94 DInt
"fbb" %MD78 DInt
"fhh" %MD90 DInt
"fmm" %MD82 DInt

You might also like