Você está na página 1de 12

Temporizadores, Contadores e Comparadores...

S_ZV
ZV Q
S_AVERZ S
S Q S_EVERZ
PV DUAL S Q
TV DUAL
RR DEZ
DEZ TV DUAL
R DEZ
R DEZ

CMP
==I

IN1
IN2

SIMATIC S7 Data: 07/11/00


Versão: 3.1
Conhecimento em Automação
Training Center
Arquivo: pro1_9.1
Siemens AG 1995. All rights reserved.
Temporizadores com Retardo na Energização/Desenergização
LAD FBD STL
T4 T4
I0.7 S_ODT Q8.5 S_ODT Exemplo:
S Q I0.7 S Q Q8.5 Entrada com
S5T#35s TV BI MW0 S5T#35s TV BI MW0 atraso
I0.5 S_ODT
R BCD MW2 I0.5 R BCD MW2

T5 T5 A I0.7
I1.7 S_OFFDT S_OFFDT
L S5T#35s
Q8.6
S Q I1.7 S Q Q8.6 SD T4
S5T#55s MW4 S5T#55s MW4 A I0.5
TV BI TV BI
I1.5 R T4
R BCD MW6 I1.5 R BCD MW6 L T4
T MW0
T6 T6
LC T4
I1.3 S_ODTS Q8.7 S_ODTS T MW2
S Q I1.3 S Q Q8.7 A T4
S5T#105s TV BI MW10 S5T#105s TV BI MW10 = Q8.5
I1.4
R BCD MW12 I1.4 R BCD MW12

SIMATIC S7 Data: 07/11/00


Versão: 3.1
Conhecimento em Automação
Training Center
Arquivo: pro1_9.2
Siemens AG 1995. All rights reserved.
Temporizadores de Pulsos
LAD FBD STL

T2 T2
I0.0 S_PULSE Q9.0 S_PULSE S_PULSE
S Q I0.0 S Q Q9.0
S5T#45s
I0.1
TV BI MW5 S5T#45s TV BI MW5 A I0.0
R BCD MW7 I0.1 R BCD MW7 L S5T#45s
SP T2
A I0.1
R T2
L T2
T9 T MW5
LC T2
I0.2 S_PEXT Q9.1 S_PEXT
S Q I0.2 S Q Q9.1 T MW7
S5T#85s TV S5T#85s TV MW9
A T2
BI MW9 BI
I0.3 = Q9.0
R BCD MW11 I0.3 R BCD MW11

SIMATIC S7 Data: 07/11/00


Versão: 3.1
Conhecimento em Automação
Training Center
Arquivo: pro1_9.3
Siemens AG 1995. All rights reserved.
Contadores

LAD FBD STL


C3 C3
Exemplo:
I0.0 S_CU Q8.0 S_CU CONTADORES
CU Q I0.0 CU Q Q8.0 A I0.4
I0.2
S I0.2 S CU C5
SC CV MW0 A I0.5
C#12 C#12 SC CV MW0
I0.1 CD C5
R CV_BCD MW2 I0.1 R CV_BCD MW2 A I0.3
L C#20
C5 C5
S C5
S_CUD
E0.4 S_CUD Q8.3 A I0.7
Q I0.4 CD Q Q8.3 R C5
CD
E0.5 L C5
I0.5 CU
CU T MW4
E0.3 LC C5
I0.3 S
S T MW7
MW4 C#20 SC CV MW4
C#20 SC CV A C5
E0.7 I0.7 R CV_BCD MW7 = Q8.3
R CV_BCD MW7

SIMATIC S7 Data: 07/11/00


Versão: 3.1
Conhecimento em Automação
Training Center
Arquivo: pro1_9.4
Siemens AG 1995. All rights reserved.
Instruções de Temporização e Contagem para Bits
LAD FBD STL

I0.0
T5
T5
( SD ) I0.0 & SD SD A I0.0
S5T#25s L S5T#25s
S5T#25s
T9 SD T5
I0.1 T9
& SF SF A I0.1
( SF ) I0.1
S5T#15600ms L S5T#15600MS
S5T#15600mS SF T9
I0.2 T2 T2
SP A I0.2
( SP ) I0.2 & SP
L S5T#12S
S5T#12S S5T#12s SP T2
I0.3 T6
T6
SE A I0.3
( SE ) I0.3 & SE
L S5T#500MS
S5T#500ms S5T#500ms SE T6
I0.4
T10 SS A I0.4
T10
( SS ) I0.4 & SS L S5T#20MS
S5T#20ms S5T#20ms SS T10
I0.5 C14 CU A I0.5
C14 CU C14
( CU) I0.5 & CU
CD A I0.6
C17
I0.6 C17 CD C17
( CD ) I0.6 & CD

SIMATIC S7 Data: 07/11/00


Versão: 3.1
Conhecimento em Automação
Training Center
Arquivo: pro1_9.5
Siemens AG 1995. All rights reserved.
Acumuladores
Instrução para Carga no Conteúdo do Accu 1
31 24 23 16 15 8 7 0

0000 0000 0000 IB 0 L IB 0


31 24 23 16 15 8 7 0

0000 0000 IB 0 IB 1 L IW 0

31 24 23 16 15 8 7 0

MB 0 MB 1 MB 2 MB 3 L MD 0

Instrução de Transferência
31 24 23 16 15 8 7 0

MB 0 MB 1 MB 2 MB 3

T QD 4 T QW 4 T QB 4

SIMATIC S7 Data: 07/11/00


Versão: 3.1
Conhecimento em Automação
Training Center
Arquivo: pro1_9.6
Siemens AG 1995. All rights reserved.
Carregando e Transferindo Dados
LAD/FBD STL

L - Load T - Transfer
MOVE
(Todos os tipos de dados com 8, 16, 32 bits)
EN ENO
Exemplos:
L +5 // Carrega uma constante 16-bit
5 IN L L#523123 // Carrega uma constante 32-bit
O MB 5
L B#16#EF // Carrega byte em hexadecimal
L 2#0001_0110_1110_0011
EN - Habilita Entrada // Carrega valor binário 16-bit
ENO -Habilita Saída L TOD#1:10:3.3
IN - Valor de Entrada // Carrega tempo com 32-bit
(Tamanho de todos os tipos
de dados 8, 16, 32 bit ) T MB0 // Transfere valor para byte de
O - Target address memória 0
(Tamanho de todos os tipos T QD256 // Transfere valor para double
de dados 8, 16, 32 bit ) word 256

SIMATIC S7 Data: 07/11/00


Versão: 3.1
Conhecimento em Automação
Training Center
Arquivo: pro1_9.7
Siemens AG 1995. All rights reserved.
Funções de Comparação

LAD FBD STL

M0.0 CMP Q9.7 ==I CMP ==I


==I M0.0
A M0.0
A(
IW0 IN1 IW0 IN1 L IW0
IW2 IN2 IW2 IN2 L IW2
Q9.7
==I
)
OPÇÕES DE COMPARAÇÃO: = Q9.7

== IGUAL A
<> NÃO IGUAL A
> MAIOR QUE
< MENOR QUE
>= MAIOR QUE OU IGUAL A
<= MENOR QUE OU IGUAL A

SIMATIC S7 Data: 07/11/00


Versão: 3.1
Conhecimento em Automação
Training Center
Arquivo: pro1_9.8
Siemens AG 1995. All rights reserved.
Instruções de Jump Incondicional
Os Jump incondicionais são executados independente de qualquer condição;
Este Jump não lê ou afeta os bits da palavra de status.

LAD FBD STL

Network 1 NEW1 NEW1 Network 1


( JMP ) JMP JU NEW1
Network 2
Network 2 .
.
.
.
.
Network X Network X .
NEW1
Network X .
NEW1
NEW1: AN M5.5
M5.5 I4.7 M69.0 & AN I4.7
I 0.2 Q8.1
( ) = = M69.0
I 0.3

SIMATIC S7 Data: 07/11/00


Versão: 3.1
Conhecimento em Automação
Training Center
Arquivo: pro1_9.9
Siemens AG 1995. All rights reserved.
Jump Condicional, baseado em RLO
O bit “Resultado da Operação Lógica” (RLO) na palavra de status determina
quando estes jumps condicionais serão executados. Duas dessas instruções
também salvam o RLO no bit do resultado binário (BR).

LAD FBD STL


Jump if RLO = 1
Is RLO=1? NEW1
NEW1 A I0.0
I0.0 I1.0 JMP
I0.0 A I1.0
( JMP ) &
I1.0 JC NEW1

Jump if RLO = 0
NEW1
Is RLO=0? I0.0 JMPN
I0.0 I1.0 REC2 & A I0.0
( JMPN ) I1.0 A I1.0
JCN REC2

SIMATIC S7 Data: 07/11/00


Versão: 3.1
Conhecimento em Automação
Training Center
Arquivo: pro1_9.10
Siemens AG 1995. All rights reserved.
Função Master Control Relay
LAD FBD STL
MCRA //Ativado
( MCRA ) MCRA
I0.0
A I0.0 //Habilitar MCR
( MCR< ) I0.0 & MCR<
MCR( //Abrir MCR
I0.7 Q8.5 *
Q8.5*
( ) A I0.7 //Contato NA
I0.7 & =
M0.6 * M0.6* = Q8.5 //Saída
( ) = = M0.6 //Saída

I0.4 Q16.0 Q16.0 A I0.4 //Contato NA


(S) I0.0 & S
S Q16.0 //Setar saída
( MCR> ) MCR>
)MCR //Fechar MCR
M69.0 M69.0*
M5.5 I4.7
( ) M5.5 = AN M5.5 //Contato emer.
&
I4.7 AN I4.7 //Contato emer.
( MCRD ) MCRD = M69.0 //Saída

* Influenciado pelo MCR MCRD //Desativar

SIMATIC S7 Data: 07/11/00


Versão: 3.1
Conhecimento em Automação
Training Center
Arquivo: pro1_9.11
Siemens AG 1995. All rights reserved.
Exercício 9.1: Planta de Engarrafamento
Ciclo de Engarrafamento
Controle das esteiras transportadoras
I0.0 Partir (NA Contato) Recipiente
principal
I0.1 Parar (NF Contato)
Modo de operação Manual/Automático
I0.3 Manual /automático
I0.4 Entrada do modo de operação
I0.5 Movimento para frente
I0.6 Movimento para trás
Q9.0 Funil Enchedor

Sensor de Sensor de Sensor de


garrafa garrafa garrafa
I16.5 I16.6 I16.7

Q 8.5 Correia transportadora para frente


Q 8.6 Correia transportadora para trás

SIMATIC S7 Data: 07/11/00


Versão: 3.1
Conhecimento em Automação
Training Center
Arquivo: pro1_9.12
Siemens AG 1995. All rights reserved.

Você também pode gostar