4. Tipos de Industria
Manufactura
producir un bien cualquiera utilizando
herramientas o máquinas
(transformación mecánica a través de
sucesivas operaciones);
Proceso
Conjunto de
operaciones/transformaciones realizadas
sobre un material, con la finalidad de
variar sus propiedades físicas/químicas.
Procesos pueden ser contínuos o
discontinuos (batch).
5. Niveles de control - Funciones
Gerenciamiento
COMUNICACIÓN
Supervisión
COMUNICACIÓN
La Zona de Control
COMUNICACIÓN
Sensores / Actuadores
8. Niveles de Control (3)
N ív e l
d e P la n ta
C ic lo
< 1 s
PC M E
1 2 3
CN C 4 5 6
7 8 9 H ost
0
N ív e l
d e C o n tro le
C ic lo
< 100 m s VM EPC
PLC DCS
N ív e l
de C am po
P R O F IB U S - D P
C ic lo
< 10 m s
D is p o s i t i v o D is p o s i t i v o
E /S Tra n s -
A c io n a d o r V á lv u la s de de
R e m o to m is s o r
C am p o C am po
9. Conceptos
Control es “aplicación de una acción pre-
planeada para que aquello que se considera
como objeto de control alcance ciertos
objetivos” (Miyagi, 1996).
Sistemas de control:
SVC (sistemas de variables continuas)
igualar el valor de una variable física
(var. de control) a un valor de referencia;
SED (Sistema de eventos discretos)
ejecución de operaciones conforme
procedimiento prestablecido.
10. Conceptos
Dispositivo de Control (SVC)
Variábles de
actuación
Regulador Actuador Objeto de
control
e d ser o a V
a c ner ef er
l
Detector
Señales de Variables controladas
i
realimentación
Dispositivo de Control (SED)
Comandos de Variables de
Control actuación
Procesador de Actuador Objeto de
Comandos control
aer at e d
s odna m C
o
Detector
Estados Variables controladas
11. Conceptos
Sistema de Control SED Recursos
Dispositivo de Dispositivo Dispositivo de
Comando de Actuación
Realización
Dispositivo de de Control Dispositivo de
Monitoreo Detección
l ort no C e d o e b O
o r a us U/ r odar e p O
Dispositivo de Control
t j
Sistema de Control
Productos
i
12. Conceptos
Dispositivos de comando (E): botoneras, llaves
rotativas, etc;
Dispositivos de actuación(S): contactores,
solenoides(válvulas), servo-motores, etc;
Dispositivos de detección(E): llaves fin de
curso, potenciómetros, sensores, encoders, etc;
Dispositivos de monitoreo(S): lámparas,
bocinas, displays, registradores, etc.
Dispositivos de Realización: circuitos eléctricos,
CLPs, etc.
15. Histórico
Hasta el final de la década de 60 los sistemas
de control eran electromecánicos
(realizados para armarios/cuadros de relés);
Ocupaban mucho espacio y eran de difícil
mantenimiento;
Modificaciones en las líneas de producción
demandaban mucho tiempo y practicamente
exigían el montage de nuevos cuadros;
En 1968 la GM (USA) lanzó una
especificación técnica de un nuevo dispositivo
de control.
16. Histórico
Requisitos de especificación:
Fácil programación y mantenimiento
(reprogramación);
Alta confiabilidad en el ambiente industrial
(vibración, calentamiento, polvo, etc.);
Dimensiones reducidas;
Capacidad de enviar datos a un Sistema
Central;
Ser modular (expansible);
Señales de E/S de 115VCA (2A mínimo
salida)
17. Histórico
En 1969 surgieron los primeros controladores
Eran muy simples apenas con E/S digitales;
La fácil programación fue una de las claves
del éxito (basada en ladder);
A lo largo de la década del 70 fueron siendo
introducidas nuevas funcionalidades
(temporización, computación numérica, etc.)
A partir de la década de 80 las funciones de
comunicación fueron perfeccionadas
18. Histórico
Hoy el PLC es un sistema microcontrolador
(microprocesador) industrial con software y
hardware adaptado para ambiente industrial
(especialmente ruído eletromagnético) con
muchas opciones de programación, con
capacidad de operar en red en diversos
niveles.
20. Componentes
CPU
Microcontrolador de 16/32 bits:
Funciones:
Comunicación entre las partes del PLC;
Control de entradas y salidas;
Ejecución;
Operación de memoria;
Check-ups internos.
21. Componentes
Memoria
La memoria es divida en 2 grandes bloques:
Memoria del Sistema
Programa de Ejecución;
Área de Borrador: flags, cálculos, alarmas, errores.
Memoria del Usuario
Programa del usuario (binario);
Tabla de Datos: Mapa E/S, valor actual y pre-set de
contadores y temporizadores, variables de
programa.
22. Componentes
Módulos de E/S
Pueden ser Discretos o Analógicos
Discretos
Cantidad de Puntos Disponibles
AC, DC, Relé
DC: Tipo P ou Tipo N
Salida: necesidad de alimentación externa, fusibles
Analógicos
Número de Canales, Resolución del conversor A/D
Faja de operación: 0-20mA, 4-20mA, 0-5V, 0-10V, +-
5V, +-10V, temperatura (termopar - J,E,K ... ,
termorresistencia – PT100, ...)
23. Funcionamiento
Basado en procesamiento cíclico compuesto, de
forma simplificada, por 3 etapas visibles al usuario:
Adquisición de las entradas;
Procesamiento;
Actualización de Salidas;
Comunicación y Mantenimiento del S.O
(Carga de módulos, actualización de timers, tratamiento de
interrupción, etc.)
X ms para cada 1000 instrucciones
1 ciclo con período de T segundos
Com. - Man. SO
Adquisición de Actualización de
Procesamiento
entradas Salidas
24. Funcionamiento
Las etapas son distintas e independientes;
El proceso se inicia después que las señales
de entrada son mostradas;
Durante el proceso las entradas y salidas
permanecen inalteradas (cualquier alteración
de las E/S y estados internos solo puede
ocurrir fuera de este intervalo);
Durante la actualización de las salidas los
valores de las entradas permanecen
inalterados
25. Funcionamiento
Una entrada debe permanecer accionada, como mínimo:
tiempo de varredura de las entradas + tiempo de procesamiento
LA
27. Clasificación
Basada en el número de E/S (no
padronizado):
Nano: hasta 50 puntos de E/S;
Micro: hasta 250 puntos de E/S;
Medio:hasta 1000 puntos de E/S;
Generalmente asociado al aumento del
número de E/S están asociados aumentos de
los recursos de programación y disminución
de los tiempos de respuestas.
28. Ejemplos de Aplicaciones
máquinas industriales (operadoras, inyectoras
de plástico, textiles, calzados);
equipamientos industriales para procesos
( siderurgia, papel y celulosa, petroquímica,
química, alimentación, minería, etc);
equipamientos para control de energia
(demanda, factor de carga);
adquisición de datos de supervisión en:
fábricas, edificios;
bancadas de test automático de componentes
industriales.
31. Introducción
Las herramientas para programación de CLP
no evoluconarían a la misma velocidad que las
herramientas para programación de
computadores pues no presentan (aban):
Facilidad de uso
Portabilidad
Interoperabilidad entre diferentes
productos
Padrones de comunicación
La norma IEC 61131 busca llenar esta laguna
32. Norma IEC 61131
Define la sintaxis y el comportamiento del
lenguage
Provee un conjunto de lenguages interligados
para resolver diferentes problemas de control
Mejora la calidad del software aplicado a
través de las técnicas de proyecto
estructurado, encapsulamiento de datos, etc.
33. Norma IEC 61131
Part 1 – General Overview, definitions
Part 2 – Hardware, I/O Signals, safety
requeriments, environment
Part 3 – Programming Languages
Part 4 –User Guidelines
Part 5 – Messaging Service Specification
34. Norma IEC 61131 – parte 3
Principales características
Programación estructurada y lenguage de alto
nivel para construcción de grandes programas
Conjunto padronizado de instrucciones (en
inglés)
Programación Simbólica
Gran variedad de tipos de datos padronizados
Funciones reutilizables pueden ser creadas
Conjunto de funciones matemáticas
padronizadas disponibles (trigronométricas,
logaritmos, etc.)
35. La estrutura de la Norma IEC 61131-3
Elementos Comunes
Lenguages de Programación
36. La estructura de la Norma IEC 61131-3
Elementos Comunes
Lenguages de Programación
37. IEC 61131-3 : Elementos Comunes
ELEMENTOS COMUNES
1. Tipos de Datos y Variables
2. Modelo de Software
* Configuración, Recursos, Tareas
3. POUs (Unidades de Organización de Programa)
* Funciones
* Bloques de Función (FB’s)
* Programas
38. IEC 61131-3 : Elementos Comunes
ELEMENTOS COMUNES
1. Tipos de Datos y Variables
2. Modelo de Software
* Configuración, Recursos, Tareas
3. POUs (Unidades de Organización de Programa)
* Funciones
* Bloques de Función (FB’s)
* Programas
39. Variables y Tipos de Datos
Que es esto?
01010101 10101010
Históricamente
• Referencia a una posición física de memoria
• Referencia a una entrada física
40. Variables y Tipos de Datos
Sensor_Temperatura_1 : Integer
• Representación simbólica
• Área propia para mapeo de I/O
• Código independente de hardware
• Altamente transparente y comprensible
• Menos errores
43. IEC 61131-3 : Elementos Comunes
ELEMENTOS COMUNES
1. Tipos de Datos y Variables
2. Modelo de Software
* Configuración, Recursos, Tareas
3. POUs (Unidades de Organización de Programa)
* Funciones
* Bloques de Función (FB’s)
* Programas
44. IEC 61131-3 Modelo de Software
Configuración
Conjunto de software que define el
comportamiento de un hardware (CP) para
una aplicación específica
Función de Comunicación
45. IEC 61131-3 Modelo de Software
Configuración
Recurso Recurso
Soporte para la ejecución de un
programa, interface entre
programas y las E/S de
controlador
Función de Comunicación
46. IEC 61131-3 Modelo de Software
Configuración
Recurso Recurso
Task
Task Task Task
(Tarea)
un mecanismo de escalonamiento que ejecuta Programs o
function blocks periódicamente o en respuesta a un evento
(cambio de estado de alguna variable booleana),
permitiendo la ejecución de programas en diferentes tareas
Função de Comunicação
con objetivo de optimizar el uso de recurso del controlador
47. IEC 61131-3 Modelo de Software
Tipos de Tareas (Task ):
No preemptiva: siempre completa su
procesamiento
Preemptiva: puede ser interrumpida por otra de
mayor prioridad
Cualquiera puede ser activada cíclicamente,
por tiempo o por evento)
Cada tarea se puede atribuir un período de
ejecución y una prioridad
un Program o function block quedará aguardando
su ejecución hasta que sea asociado a una
determinada Tarea y esta sea activada por una
ejecución periódica o por un determinado evento
48. IEC 61131-3 : Elementos Comunes
ELEMENTOS COMUNES
1. Tipos de Datos y Variables
2. Modelo de Software
* Configuración, Recursos, Tareas
3. POUs (Unidades de Organización de Programa)
* Funciones
* Bloques de Función (FB’s)
* Programas
49. IEC 61131-3 Modelo de Software
Configuración
Recurso Recurso
Task Task Task Task
Program
Program Program
Program (Programa)
Camino de
Típicamente, un Program consiste de un número de bloques control de
ejecución
uncionales interconectados, capaces de intercambiar datos a
vés de las conecciones de software. Un Program puede anular
las variables de CLP y comunicar con otros Programs.
Função de Comunicação
50. IEC 61131-3 Modelo de Software
Programs ( Programas)
pueden contener variables de acceso, las
cuales permiten el acceso remoto por los
servicios de comunicación.
pueden contener instancias de bloques
funcionales, mas no de otros programas,
(no pueden ser aninhados)
as instâncias de blocos funcionais de um
programa podem ser executadas por
diferentes tarefas de controle.
51. IEC 61131-3 Modelo de Software
Programs ( Programas)
podem ser declarados somente no nível
do recurso.
podem conter declarações de variáveis
de endereçamento direto
(endereçamento direto de pontos de E/S.
podem conter declarações de variáveis
globais, as quais podem ser acessíveis
pelos Function Blocks através do uso de
variáveis externas.
52. IEC 61131-3 Modelo de Software
Configuração
Recurso Recurso caminho de
acesso a
CI de softwares. Possuem um conjunto de
Variável
dados que pode ser alterados por um Tarefa
Tarefa Tarefa Tarefa
algoritmo interno FB
Bloco de
Função’’
Programa Programa Programa Programa
Variável
FB FB FB FB
Caminho do
Variáveis globais e diretas
controle de
execução
Caminho de acesso
Função de Comunicação
Todo o mapeamento de memória pode ser acessado pelo gerenciador global de variáveis
53. IEC 61131-3 Modelo de Software
Functions Blocks (Blocos de Funções)
podem ser utilizados para a criação de
elementos de software totalmente
reutilizáveis, desde a criação de outros
Function Blocks mais simples, até
Programs complexos.
possuem um conjunto de dados, os quais
podem ser alterados por um algoritmo
interno (algoritmos + dados)
podem ser escritos em qualquer
linguagem
54. IEC 61131-3 Modelo de Software
Functions Blocks (Blocos de Funções)
Os dados possuem persistência (estados
internos que são mantidos entre uma
execução e outra)
podem ser utilizados para a criação de
outros Function Blocks (blocos
derivados), aumentando ainda mais a
capacidade de reutilização do software.
55. Functions Blocks (Blocos de Funções)
Blocos de Função padrões
Biestáveis: SR, RS, SEMA
Detecção de Borda: R_TRIG, F_TRIG
Contadores: CTU, CTD, CTUD
Temporizadores: TP, TON, TOF, RTC
Blocos de Função fornecidos adicionalmente
pelo fabricante
Blocos de Função definidos pelo usuário
Todos FBs são altamente reutilizáveis no
mesmo programa, diferentes programas ou
projetos
57. Exemplo de Function Block construído
pelo usuário
FUNCTION_BLOCK HYSTERISIS
Hysterisis VAR_INPUT
XIN1, XIN2 : REAL;
REAL XIN1 Q BOOL EPS : REAL; (* faixa de
REAL XIN2 histerese *)
END_VAR
REAL EPS VAR_OUTPUT
Q : BOOL := 0
END_VAR
IF Q THEN
Q
IF XIN1 < (XIN2-EPS) THEN
1 Q := 0 (* XIN1 diminuindo *)
END_IF;
0 ELSIF XIN1 > (XIN2 + EPS ) THEN
Q := 1; (* XIN1 aumentando *)
EPS EPS END_IF;
XIN2 END_FUNCTION_BLOCK
58. IEC 61131-3 Modelo de Software
Functions (Funções)
são elementos de software que não
aparecem no modelo de software, porém
podem ser reutilizados
não possuem persistência, existindo apenas
em tempo de execução, assim como
subrotinas (não armazenam dados)
não possuem estados internos, ou seja,
sempre produzem o mesmo resultado para o
mesmo conjunto de entradas
podem ter apenas uma saída
podem ser escritas em qualquer linguagem
59. Functions (Funções)
Funções padrões
Bit: ADD, OR, XOR, NOT SHL, SHR, ROL, ROR
Numéricas: ADD, SUB, MULT, DIV, MOD, EXPT,
ABS, SQRT, LN, LOG, EXP, SIN, COS, TAN, ASIN,
ACOS, ATAN
Conversão de tipo
Seleção: SEL, MIM, MAX, LIMIT, MUX
Cadeias de Caracteres: LEN, LEFT,RIGHT, MID,
CONCAT, INSERT, DELETE, REPLACE, FIND
60. Functions (Funções)
Exemplo de funções definidas pelo usuário
FUNCTION SIMPLE_FUN : REAL
VAR_INPUT
A, B : REAL;
C : REAL := 1.0;
END_VAR
SIMPLE_FUN := A*B/C;
END FUNCTION
63. IEC 61131-3 x PLC convencional
Configuração
Recurso Recurso caminho de
acesso a
Variável
Tarefa Tarefa Tarefa Tarefa
FB
Bloco de
Função’’
Programa Programa Programa Programa
Variável
FB FB FB FB
Caminho do
Variáveis globais e diretas controle de
execução
Caminho de acesso
Função de Comunicação
64. PLC convencional x IEC 61131-3
Tarefa 1 Temporizada
Recurso Loop Infinito:
Tarefas Tarefa 2 Evento
Lê entradas
Executa lógica Evento Tarefa 3
Programa
Atualiza saídas
Temporizada Tarefa 4
65. Vantagens das POU’s
Crie suas próprias bibliotecas de FBs (por tipo
de aplicação)
FBs são testados e documentados
Faça bibliotecas acessíveis em todo o mundo
Reutilize o máximo possível
Mude da programação para a criação de redes
de FBs
Economize 40% no próximo projeto
66. A estrutura da Norma IEC 61131-3
Elementos Comuns
Linguagens de Programação
67. Linguagens de Programação
IEC 61131 – parte 3
Definição de Cinco Linguagens Interligadas
Sintaxe e Semântica de 2 linguagens textuais
e 2 gráficas:
Instruction List (IL)
Structered Text (ST)
Ladder Diagram (LD)
Function Block Diagram (FBD)
Linguagem para estruturação da Programação
Sequential Function Chart (SFC)
70. Linguagens Novas
Structered Text (ST)
Linguagem estruturada de alto nível
Sintaxe semelhante ao Pascal
Permitido o uso de declarações complexas e
instruções aninhadas
Suporte para:
Laços de controle (REPEAT-UNTIL; WHILE-DO)
Execução condicional (IF-THEN-ELSE; CASE)
Funções (SQRT(), SIN())
71. Linguagens Novas
Sequential Function Chart (SFC)
Técnica gráfica muito poderosa para descrever o
comportamento seqüencial de um programa de
controle
Usado para particionar um problema de controle
Mostra uma visão geral, desejável para um rápido
diagnóstico
72. Processo de Fermentação
Agitador
Reagente ácido Válvula de alimentação
Reagente básico
Sensor de temperatura
Sensor de pH
Camisa de
aquecimento
Válvula de dreno
Como criar um programa de controle de forma
estruturada?
73. Passo 1 :
Identificação das interfaces externas do sistema
Sinais de Entrada (sensores):
sensor de temperatura
sensor de PH
posições das válvulas
velocidade motor
Sinais de Saída (atuadores):
válvulas
motor
aquecedor
74. Passo 2:
Definição dos principais sinais entre o Sistema e o
restante do processo
Neste exemplo não existe nenhum acoplamento do
processo, mas poderia existir, do tipo:
… acoplamento com os vasos com líquidos principais
… acoplamento com o sistema de transporte / estação
de enchimento após o dreno
75. Passo 3:
Definição de todas as interações com o Operador,
intervenções e dados de supervisão
Para o operador foram definidos:
… um botão ‘Liga’
… um botão ‘Desliga’
… uma entrada ‘Duracao’
Agora estão definidas todas as interfaces
76. Passo 4:
“Quebrar” o problema de cima para baixo em partições
lógicas (funcionalidades)
SequenciaPrinc – enchimento, aquecimento,
agitação, fermentação, descarga, limpeza.
ControleValvulas – comando das vávulas para
encher e esvaziar o vaso
ControleTemp – controle de temperatura
ControleAgitador – controle do motor do agitador
(velocidade)
ControlepH – controle de pH
77. Passo 5:
Definição das POUs necessárias
(Programas e Blocos de Função)
Usando as definições anteriores e
Representando na linguagem gráfica de programação
Diagrama de Blocos de Função temos …
78. Programa de Controle da Fermentação
Entradas Saídas
ControleTemp
Aquecer Aquecer
SetPoint
Esfriar Esfriar
SensorTemp PV
SensorpH
ControlepH
SequenciaPrinc AdicAcido AdicAcido
SetPoint
Liga Temp PV AdicBase AdicBase
Liga
Desliga pH
Desliga
ControleAgitador
Duracao Duracao Agitacao
LiberEncher SetPoint VelocMotor VelocMotor
PV
VelocAgitador
ControleValvulas
Libera Encher Encher
PosicaoValvulas Drenar Drenar
79. Seqüência principal (MainSequence) em SFC
Apresenta os S1
Inicialização
principais
estados do processo
S2 Enchimento
Os Blocos de Ação e as S3 Aquecimento
Transições podem ser
S4 Fermentação
programados em
qualquer uma das S5 Descarga
quatro Linguagens de
S6 Limpeza
Programação IEC
80. Passo 6:
Definição dos tempos do ciclo de scan
para as diferentes partes da aplicação
Neste exemplo temos apenas um ciclo em modo
contínuo
O tempo restante pode ser usado por outros ciclos
para:
…. o sistema de enchimento / transporte
… verificação de limites e condições de erro (em
uma seqüência paralela)
81. Passo 7:
Configuração do Sistema:
Definição dos Recursos, Tarefas
e conexão do programa com o I/O físico
Depende do sistema utilizado
Inclui o mapeamento do I/O físico com os símbolos
usados
Mapeamento dos recursos (leia: CPUs do sistema)
Definição dos ciclos de scan e eventos (vide Passo 6)
Notas del editor
There are a lot of ways to look to this part 3 of IEC 1131. The one we use here is very simple: the standard consists of two main blocks: the Common Elements, valid throughout the specification and the Programming Languages Let us take a closer look to the common elements…….
There are a lot of ways to look to this part 3 of IEC 1131. The one we use here is very simple: the standard consists of two main blocks: the Common Elements, valid throughout the specification and the Programming Languages Let us take a closer look to the common elements…….
Within the common elements, the Functions, Function Blocks and Programs are called Program Organization Units. They provide you with reusab le code, from macro level to micro level. Let us have a closer look at them,. First the functions…...
Within the common elements, the Functions, Function Blocks and Programs are called Program Organization Units. They provide you with reusab le code, from macro level to micro level. Let us have a closer look at them,. First the functions…...
The first to mention are Datatypes and Variables Historically, one looked to real memory locations. So what is the example here? 16 bits of digital in p ut? Or output? Or 2 characters, or an integer. You do not know, and so you can make errors
Within IEC 61131-3, one uses variables with sensible names. In addition one tells what we deal with. In this example we use the variable name Temperature_Sensor_1, because that is a clear name, and we couple this to a datatype integer. Now we know we do not get back a string, telling us the temperature in text, but we get a number back. For the rest of the program we now use the name: this is much more readable and understandable. Why this datatyping? Well, IEC 1131-3 is designed to help you to find errors as early as possible in the programming phase. As you all know, that is the fastest and cheapest way. Now you know if the data is a string, a date, and integer or 16 bits of Boolean input. There is no confusion about this anymore, and there is no conflict between different people using the textual representation (that means, the name of the variable)
Within IEC 61131-3, one uses variables with sensible names. In addition one tells what we deal with. In this example we use the variable name Temperature_Sensor_1, because that is a clear name, and we couple this to a datatype integer. Now we know we do not get back a string, telling us the temperature in text, but we get a number back. For the rest of the program we now use the name: this is much more readable and understandable. Why this datatyping? Well, IEC 1131-3 is designed to help you to find errors as early as possible in the programming phase. As you all know, that is the fastest and cheapest way. Now you know if the data is a string, a date, and integer or 16 bits of Boolean input. There is no confusion about this anymore, and there is no conflict between different people using the textual representation (that means, the name of the variable)
Within IEC 61131-3, one uses variables with sensible names. In addition one tells what we deal with. In this example we use the variable name Temperature_Sensor_1, because that is a clear name, and we couple this to a datatype integer. Now we know we do not get back a string, telling us the temperature in text, but we get a number back. For the rest of the program we now use the name: this is much more readable and understandable. Why this datatyping? Well, IEC 1131-3 is designed to help you to find errors as early as possible in the programming phase. As you all know, that is the fastest and cheapest way. Now you know if the data is a string, a date, and integer or 16 bits of Boolean input. There is no confusion about this anymore, and there is no conflict between different people using the textual representation (that means, the name of the variable)
Within the common elements, the Functions, Function Blocks and Programs are called Program Organization Units. They provide you with reusab le code, from macro level to micro level. Let us have a closer look at them,. First the functions…...
At the highest level, the entire system required to solve a particular control problem is called a Configuration.
Within a configuration, one or more Resources can be defined. A resource is like a CPU in your system , providing processor power .
A resource include one or more Tasks . Tasks control the execution of different parts of programs…..
At the highest level, the entire system required to solve a particular control problem is called a Configuration.
Within the common elements, the Functions, Function Blocks and Programs are called Program Organization Units. They provide you with reusab le code, from macro level to micro level. Let us have a closer look at them,. First the functions…...
Programs can be written in any of the IEC languages ….
At the highest level, the entire system required to solve a particular control problem is called a Configuration.
At the highest level, the entire system required to solve a particular control problem is called a Configuration.
and in the end calls function blocks. Let us compare this to a conventional PLC……….
At the highest level, the entire system required to solve a particular control problem is called a Configuration.
At the highest level, the entire system required to solve a particular control problem is called a Configuration.
They are like the software equivalent of Integrated Circuits, ICs. Like black boxes that represent a specialized control function You have standard defined function blocks, like timers, counters and triggers….
They are like the software equivalent of Integrated Circuits, ICs. Like black boxes that represent a specialized control function You have standard defined function blocks, like timers, counters and triggers….
In this example, the body code is written in the language Structured Text It uses the inputs,does some calculation, and sets the outputs. The first part deals with the data structure, the second half with the algorithm In this case it does not use additional data. But it could. No matter which name was used for this local data inside the body, there would be no conflict with its name: one could use this name on different places, without conflict, This example of data encapsulation takes away a big source of errors.
At the highest level, the entire system required to solve a particular control problem is called a Configuration.
We all know functions like Add, Square root, SINus, COSinus, Greater Than, etc., IEC has a enormous set of these defined. You also can create your own functions like this simple_function Once defined, you can use it over and over again….. The same is valid for Function Blocks…..
We all know functions like Add, Square root, SINus, COSinus, Greater Than, etc., IEC has a enormous set of these defined. You also can create your own functions like this simple_function Once defined, you can use it over and over again….. The same is valid for Function Blocks…..
As shown here in red, a conventional PLC consists of one resource, running one task, controlling one program As you can easily see, IEC 61131-3 can go well beyond conventional PLCs. It can provide you with a state-of-the-art multitasking, real-time environment
The conventional PLC reads the input, does some calculations and sets the output. Then it read again the inputs, does some calculations, and sets again the outputs….and again and again. It does not matter that there are inputs who do not change during this time. In IEC 61131-3 tasks, you split up the program in several pieces. And coupled to the needs, you run the tasks on a time basis like every millisecond or minute, or even on event basis: something changes and needs attention. This task management also makes IEC 61131 applicable to a much broader area as just PLCs. It can be used in a broad range of application area’s, without having to learn additional programming languages.
The strategy to follow with these Program Organization Units is as follows: You create your own Function Block Libraries (per application area) These FBs you test and document, for instance in the first project. After that you make this library accessible to your whole organization In this wau you improve the re-use of these blocks as much as possible With the next program, you are more creating networks of FBs that already exists, giving you the opportunity to focus on the new topics. In this way one easily can save 40% on this next project. Even figures above 80% are mentioned, but that means that the next project must be quit similar.
There are a lot of ways to look to this part 3 of IEC 1131. The one we use here is very simple: the standard consists of two main blocks: the Common Elements, valid throughout the specification and the Programming Languages Let us take a closer look to the common elements…….
The whole process is drawn here. There is a large vessel, which can be filled (Feed Valve) with the liquid, can be heated with the heater band (cooling via convection), which can be stirred via the motor, and where acid and alkali fluid can be added into.
Step 1 – see slide
See slide
Step 3: Definition of all Operator interactions, overrides and supervisory data For the operator we define: … a ‘Start’ button … a ‘Stop’ button … a ‘Duration’ input And with this we have defined all the external interactions
In Step 4 we make a brake down from the top in logical partitions (meaning logical functional units)
Step 5: Definition of the required POUs (Programs and Function Blocks) Using the definitions of the previous slide and representing it in the graphical programming language Function Block Diagram gives the folowing diagram …
In this case all basic blocks have been defined, which is one of the basic steps needed to convert the problem to a solution (read from left to right side: on the left the inputs, on the right the outputs) The Function Block Main Sequence is linked to the operator inputs. It is supported by the other blocks for control, which are linked to the relevant inputs and outputs. These additional blocks could be blocks that are delivered by your suppliers, like the temperature control block, using a PID control loop. Alternatively, these blocks can be created by yourself. For instance, this is the case with the block Main Sequence. Looking closer to this block, we could structure its sequence with Sequential Function Charts, SFC, as follows:
For the main sequence we would use the structuring tool Sequential Function Chart. We start at the top with the Initialization: since we do not know the status of the system when we first switch it on, we got to check here the position of the valves, etc. Then we start filling till the right level has been reached. Next phase is the heating till the fermentation process starts If it starts, we get to the next phase: the actual fermentation process control part After completion, we harvest, and after that clean, and we are ready to restart at the top. This decomposition gives everybody involved a clear overview which sequences are involved, and how it is further decomposed into the function blocks which can be programmed in any of the four languages. Or, stated differently: our user requirement specification is (nearly) done!
In this example we have in principle only one cycle, which we can run is a continuous mode. Alternatively, we could have it run on a time basis, for instance every 20 msec. The remaining time can be used for additional sequences, for instance checking or controlling the transportation / bottling system during harvesting, or checking all kind of boundary and/or error conditions.
This phase is dedicated to the system involved. It includes the physical mapping of the symbols to I/O addresses. By using symbolic representation one creates a far better hardware independence. This is especially valid for the creation of the function blocks, which should be hardware independent. By identifying clearly where the physical mapping is done, rewiring in the filed is a lot easier to accomplish. For instance, exchanging the wiring of two digital inputs means that within the physical mapping one has to change two lines. The rest of the program is still valid, and need no changes. Also here the resources are mapped, meaning which part runs on which processor in the system. IEC 61131-3 support multiprocessing environments, although most of the actual systems still use one processor only for the programs. Last but not least, one has to map the tasks to the scan cycles and events, as defined in step 6. In this way one can have multiple programs in one system, for instance the fermentation process as described here, supported by overall checks and control of the supporting environments, like bottling or the levels in the supplying chain upfront.