vault backup: 2025-05-11 12:02:34

This commit is contained in:
Miguel 2025-05-11 12:02:34 +02:00
parent 507781d314
commit 8b67a46b66
486 changed files with 64289 additions and 307 deletions

View File

@ -1,3 +1,3 @@
{
"backlinkInDocument": true
"backlinkInDocument": false
}

View File

@ -24,7 +24,6 @@
"obsidian-auto-link-title",
"advanced-canvas",
"obsidian-minimal-settings",
"shiki-highlighter",
"obsidian-mindmap-nextgen",
"obsidian-plantuml"
]

View File

@ -6,9 +6,11 @@
"emojiStyle": "native",
"iconColor": null,
"recentlyUsedIcons": [
"LiHelp",
"🤖",
"🔒"
"🪛",
"LiScriptEngine",
"👉",
"LiCheckSquare2",
"✅"
],
"recentlyUsedIconsSize": 5,
"rules": [],
@ -33,5 +35,7 @@
"useInternalPlugins": false
},
"01-Documentation/SIDEL/SIDEL - Passwords.md": "🔒",
"01-Documentation/AI - IA - LLM - Artificial Intelligence": "🤖"
"04-SIDEL/SIDEL - Upgrades - Promemoria.md": "👉",
"04-SIDEL/CheckList": "LiCheckSquare2",
"01-Documentation/AI - IA - LLM - Artificial Intelligence": "🪛"
}

View File

@ -5,7 +5,6 @@
null,
null,
null,
null,
null
],
"settings": {

View File

@ -1,204 +1,204 @@
{
"recentFiles": [
{
"basename": "SAE196 - IO Adapted",
"path": "04-SIDEL/06 - E5.007363 - Modifica O&U - SAE196 (cip integrato)/SAE196 - IO Adapted.md"
"basename": "9.402x - Notes for technician on site - CARTON REJECT SYSTEM",
"path": "03-VM/33 - 9.402x - Shibuya/Notes for techinician on site/9.402x - Notes for technician on site - CARTON REJECT SYSTEM.md"
},
{
"basename": "Python Notes",
"path": "01-Documentation/Python/Python Notes.md"
"basename": "9.402x - Shibuya - Logics & Control",
"path": "03-VM/33 - 9.402x - Shibuya/Notes for techinician on site/9.402x - Shibuya - Logics & Control.md"
},
{
"basename": "Script para obtener las ultimas versiones",
"path": "01-Documentation/Python/Scripts Python/Script para obtener las ultimas versiones.md"
"basename": "9.402x - After FAT considerations from customer",
"path": "03-VM/33 - 9.402x - Shibuya/9.402x - After FAT considerations from customer.md"
},
{
"basename": "Group Scripts Manager",
"path": "01-Documentation/Python/Scripts Python/Group Scripts Manager.md"
"basename": "ADAM 4021 - 485 to 4..20ma - Commissioning & Firmware update",
"path": "01-Documentation/Dispositivos - Manuales/ADAM/ADAM 4021 - 485 to 4..20ma - Commissioning & Firmware update.md"
},
{
"basename": "Conda - Anaconda - miniconda",
"path": "01-Documentation/Python/Scripts Python/Conda - Anaconda - miniconda.md"
"basename": "GIT commands HELP",
"path": "01-Documentation/GIT/GIT commands HELP.md"
},
{
"basename": "Miniconda Como hacer un backup completo de un entorno creado con Miniconda",
"path": "01-Documentation/Python/Scripts Python/Miniconda Como hacer un backup completo de un entorno creado con Miniconda.md"
"basename": "SysInternals Tools",
"path": "01-Documentation/Windows/SysInternals Tools.md"
},
{
"basename": "API Google Translate",
"path": "01-Documentation/Python/Scripts Python/API Google Translate.md"
"basename": "Git - Start New Repository with Visual Studio Code - VS Code",
"path": "01-Documentation/GIT/Git - Start New Repository with Visual Studio Code - VS Code.md"
},
{
"basename": "Allen Bradley HMI Translate - Python - LLM - Google Translate",
"path": "01-Documentation/Python/Scripts Python/Allen Bradley HMI Translate - Python - LLM - Google Translate.md"
"basename": "Emails",
"path": "04-SIDEL/10 - E5.007095 - Modifica O&U - SAE463/Emails.md"
},
{
"basename": "E5.007600 - SAE469 - FDM",
"path": "04-SIDEL/07 - E5.007600 - SAE469/E5.007600 - SAE469 - FDM.md"
"basename": "Differences",
"path": "04-SIDEL/10 - E5.007095 - Modifica O&U - SAE463/Differences.md"
},
{
"basename": "Docker Basics - Essential Commands and Usage Guide",
"path": "01-Documentation/Dockers/Docker Basics - Essential Commands and Usage Guide.md"
"basename": "Misuratori Endress&Hauser",
"path": "04-SIDEL/CheckList/Misuratori Endress&Hauser.md"
},
{
"basename": "Radarr - Lidarr - Sonarr - QBittorrent - Prowlarr - Unmanic",
"path": "01-Documentation/Dockers/Radarr - Lidarr - Sonarr - QBittorrent - Prowlarr - Unmanic.md"
"basename": "8F3B25-AAILABBFAASAFMWAA1+NB - Adapter RJ45 M12 (service interface)",
"path": "01-Documentation/Endress+Houser/8F3B25-AAILABBFAASAFMWAA1+NB - Adapter RJ45 M12 (service interface).md"
},
{
"basename": "FB1751 - BlenderPID_PIDSPCalc Documentation",
"path": "04-SIDEL/00 - MASTER/MIXER/Documentacion/FB1751 - BlenderPID_PIDSPCalc Documentation.md"
"basename": "Maselli Sensor to Siemens PLC Communication Implementation",
"path": "04-SIDEL/09 - SAE452 - Diet as Regular - San Giovanni in Bosco/Maselli Sensor to Siemens PLC Communication Implementation.md"
},
{
"basename": "94102 - ALPLA- USA - Notes for technician on site",
"path": "03-VM/39 - 94102 - Alpla - Usa/94102 - ALPLA- USA - Notes for technician on site.md"
"basename": "Maselli - Protocol - Gateway - 485 - Ethernet",
"path": "01-Documentation/Dispositivos - Manuales/Maselli/Maselli - Protocol - Gateway - 485 - Ethernet.md"
},
{
"basename": "OPC UA",
"path": "01-Documentation/Siemens/TIA Portal/OPC UA.md"
"basename": "CableMAX - Converter 485 - Serial Adaptor RS232 - CM-RSDB9-PRO",
"path": "01-Documentation/Dispositivos - Manuales/CableMAX - Converter 485 - Serial Adaptor RS232 - CM-RSDB9-PRO.md"
},
{
"basename": "Backups - Mikrotik",
"path": "01-Documentation/Routers/Mikrotik - Network Redes/Backups - Mikrotik.md"
"basename": "Notes - Git - Gitea",
"path": "01-Documentation/GIT/Notes - Git - Gitea.md"
},
{
"basename": "Radarr - Lidarr - Sonarr - QBittorrent - Prowlarr - Unmanic",
"path": "01-Documentation/Lidarr - Radarr/Radarr - Lidarr - Sonarr - QBittorrent - Prowlarr - Unmanic.md"
"basename": "PC HMI Zenon",
"path": "04-SIDEL/CheckList/PC HMI Zenon.md"
},
{
"basename": "Configurazione ZeroTier con Home Assistant - Riccardo",
"path": "01-Documentation/VPN - Zerotier - Wireguard/Configurazione ZeroTier con Home Assistant - Riccardo.md"
"basename": "MSI decompiler",
"path": "01-Documentation/Decompiler/MSI decompiler.md"
},
{
"basename": "Mikrotik - Zerotier - zero_work network",
"path": "01-Documentation/Routers/Mikrotik - Network Redes/Mikrotik - Zerotier - zero_work network.md"
"basename": "cSharp Decompiler",
"path": "01-Documentation/Decompiler/cSharp Decompiler.md"
},
{
"basename": "S7 Software Calls",
"path": "04-SIDEL/00 - MASTER/MIXER/S7 Software Calls.md"
"basename": "Singleton",
"path": "01-Documentation/Visual Studio Cn/Singleton.md"
},
{
"basename": "Análisis Detallado OBs",
"path": "04-SIDEL/00 - MASTER/MIXER/Documentacion/Análisis Detallado OBs.md"
"basename": "SAE196_c0.2_CAx_Export_Hardware_Tree",
"path": "04-SIDEL/06 - E5.007363 - Modifica O&U - SAE196 (cip integrato)/Source/SAE196_c0.2_CAx_Export_Hardware_Tree.md"
},
{
"basename": "Análisis del Software PLC Mixer",
"path": "04-SIDEL/00 - MASTER/MIXER/Documentacion/Análisis del Software PLC Mixer.md"
},
{
"basename": "94102 - Alpla - Usa",
"path": "03-VM/39 - 94102 - Alpla - Usa/94102 - Alpla - Usa.md"
},
{
"basename": "FB1751 - BlenderPID_PIDSPCalc Map",
"path": "04-SIDEL/00 - MASTER/MIXER/Documentacion/FB1751 - BlenderPID_PIDSPCalc Map.md"
},
{
"basename": "FB1751 - BlenderPID_PIDSPCalc Diagrams",
"path": "04-SIDEL/00 - MASTER/MIXER/Documentacion/FB1751 - BlenderPID_PIDSPCalc Diagrams.md"
},
{
"basename": "BlenderCtrl__Main",
"path": "04-SIDEL/00 - MASTER/MIXER/Documentacion/BlenderCtrl__Main.md"
},
{
"basename": "Zero-Tier ONE - Lan NAT",
"path": "01-Documentation/Routers/Zero-Tier ONE - Lan NAT.md"
},
{
"basename": "SIDEL - Master - IPs",
"path": "04-SIDEL/00 - MASTER/SIDEL - Master - IPs.md"
},
{
"basename": "Endress+Hauser WEB Access",
"path": "01-Documentation/Endress+Houser/Endress+Hauser WEB Access.md"
},
{
"basename": "Secomea Layer 2 Setup",
"path": "01-Documentation/Vetromeccanica/Sacomea/Secomea Layer 2 Setup.md"
},
{
"basename": "Sacomea Help",
"path": "01-Documentation/Vetromeccanica/Sacomea/Sacomea Help.md"
},
{
"basename": "SAE196 - IO",
"path": "04-SIDEL/06 - E5.007363 - Modifica O&U - SAE196 (cip integrato)/SAE196 - IO.md"
},
{
"basename": "SIDEL - Mixer - Equivalences",
"path": "04-SIDEL/00 - MASTER/MIXER/SIDEL - Mixer - Equivalences.md"
},
{
"basename": "SIDEL - Passwords",
"path": "01-Documentation/SIDEL/SIDEL - Passwords.md"
},
{
"basename": "Activate License on Zenon 10 HMI - B&R PC",
"path": "04-SIDEL/00 - MASTER/MIXER/HMI/B&R Zenon 10/Activate License on Zenon 10 HMI - B&R PC.md"
},
{
"basename": "Blender - Video - Editing",
"path": "01-Documentation/Blender Software/Video Editing/Blender - Video - Editing.md"
},
{
"basename": "Update to PROMASS 300",
"path": "04-SIDEL/00 - MASTER/MIXER/PLC/S7 Software/Update to PROMASS 300.md"
},
{
"basename": "Start new PC B&R from image",
"path": "04-SIDEL/00 - MASTER/MIXER/HMI/B&R Zenon 10/Start new PC B&R from image.md"
"basename": "MCP",
"path": "01-Documentation/AI - IA - LLM - Artificial Intelligence/MCP.md"
},
{
"basename": "AI Prompts useful",
"path": "01-Documentation/AI - IA - LLM - Artificial Intelligence/AI Prompts useful.md"
},
{
"basename": "Shiki Plugin - Highlither - Syntax - Editor",
"path": "01-Documentation/Obsidean/Shiki Plugin - Highlither - Syntax - Editor.md"
"basename": "Routes",
"path": "DB/RouteHelper/Routes.md"
},
{
"basename": "Jellyfin en Synology DS220+",
"path": "01-Documentation/Synology/DS220+/Jellyfin en Synology DS220+.md"
"basename": "SIDEL - Mixer - Equivalences",
"path": "04-SIDEL/00 - MASTER/MIXER/SIDEL - Mixer - Equivalences.md"
},
{
"basename": "Siemens HMI Translate - Python - LLM - Google Translate",
"path": "01-Documentation/Python/Scripts Python/Siemens HMI Translate - Python - LLM - Google Translate.md"
"basename": "Backups - Mikrotik",
"path": "01-Documentation/Routers/Mikrotik - Network Redes/Backups - Mikrotik.md"
},
{
"basename": "60034 - Motor trifasico - Chingioli",
"path": "01-Documentation/Motors/Lenze/60034 - Motor trifasico - Chingioli.md"
"basename": "Test - Fatto su Maselli - 06-05-2025",
"path": "04-SIDEL/09 - SAE452 - Diet as Regular - San Giovanni in Bosco/Test - Fatto su Maselli - 06-05-2025.md"
},
{
"basename": "Pasted image 20250426010944",
"path": "01-Documentation/Lidarr - Radarr/adjuntos/Pasted image 20250426010944.png"
"basename": "ADAM -",
"path": "04-SIDEL/09 - SAE452 - Diet as Regular - San Giovanni in Bosco/ADAM -.md"
},
{
"basename": "Análisis Comparativo de Routers MikroTik",
"path": "01-Documentation/Routers/Mikrotik - Network Redes/Análisis Comparativo de Routers MikroTik.md"
"basename": "SIDEL - Upgrades - Promemoria",
"path": "04-SIDEL/SIDEL - Upgrades - Promemoria.md"
},
{
"basename": "NAT Mikrotik",
"path": "01-Documentation/Routers/Mikrotik - Network Redes/NAT Mikrotik.md"
"basename": "Riunione Endress&Hauser",
"path": "01-Documentation/Endress+Houser/Riunione Endress&Hauser.md"
},
{
"basename": "Estructura XML Detallada para Topología de Red en Exportaciones AML de TIA Portal",
"path": "01-Documentation/CAx AutomationML/Estructura XML Detallada para Topología de Red en Exportaciones AML de TIA Portal.md"
"basename": "E5.007600 - SAE469 - FDM",
"path": "04-SIDEL/07 - E5.007600 - SAE469/E5.007600 - SAE469 - FDM.md"
},
{
"basename": "Especificación Formal del Formato CAx (AML)",
"path": "01-Documentation/CAx AutomationML/Especificación Formal del Formato CAx (AML).md"
"basename": "Endress+Hauser WEB Access",
"path": "01-Documentation/Endress+Houser/Endress+Hauser WEB Access.md"
},
{
"basename": "Mikrotik Scripts",
"path": "01-Documentation/Routers/Mikrotik - Network Redes/Mikrotik Scripts.md"
"basename": "Profibus_Variables",
"path": "04-SIDEL/06 - E5.007363 - Modifica O&U - SAE196 (cip integrato)/Source/source/Profibus_Variables.md"
},
{
"basename": "Mikrotik - Setup Commands for Layer 2 Wi-Fi Bridge",
"path": "01-Documentation/Routers/Mikrotik - Network Redes/Mikrotik - Setup Commands for Layer 2 Wi-Fi Bridge.md"
"basename": "MFMAnalogValues",
"path": "04-SIDEL/06 - E5.007363 - Modifica O&U - SAE196 (cip integrato)/Source/source/MFMAnalogValues.md"
},
{
"basename": "EOip Vetromeccanica",
"path": "01-Documentation/Routers/Mikrotik - Network Redes/EOip Vetromeccanica.md"
"basename": "xref_calls_tree",
"path": "04-SIDEL/06 - E5.007363 - Modifica O&U - SAE196 (cip integrato)/Source/xref_calls_tree.md"
},
{
"basename": "SAE196 - IO Adapted",
"path": "04-SIDEL/06 - E5.007363 - Modifica O&U - SAE196 (cip integrato)/SAE196 - IO Adapted.md"
},
{
"basename": "SAE196 - IO",
"path": "04-SIDEL/06 - E5.007363 - Modifica O&U - SAE196 (cip integrato)/SAE196 - IO.md"
},
{
"basename": "Maselli - Utility",
"path": "01-Documentation/Dispositivos - Manuales/Maselli/Maselli - Utility/Maselli - Utility.md"
},
{
"basename": "UI.Library - Sensor Management Library Documentation",
"path": "01-Documentation/Dispositivos - Manuales/Maselli/Maselli - Utility/UI.Library - Sensor Management Library Documentation.md"
},
{
"basename": "SIMATIC ET 200S 2AI I 4WIRE ST",
"path": "01-Documentation/Siemens/Peripherics - Schede - IM/SIMATIC ET 200S 2AI I 4WIRE ST.md"
},
{
"basename": "DB5100 - Supervisor SIPA - Script en VBA for Import and Export DB from Tia Portal",
"path": "01-Documentation/VB.NET Scripts VBA/DB5100 - Supervisor SIPA - Script en VBA for Import and Export DB from Tia Portal.md"
},
{
"basename": "FC551 FC FC Compute Machine Speed",
"path": "03-VM/9..... MASTER Transport/Standard Transport/FC551 FC FC Compute Machine Speed.md"
},
{
"basename": "Software General Description",
"path": "01-Documentation/Dispositivos - Manuales/Maselli/Maselli - Utility/Software General Description.md"
},
{
"basename": "Maselli Proprietary Serial-Socket Protocol",
"path": "01-Documentation/Dispositivos - Manuales/Maselli/Maselli - Utility/Maselli Proprietary Serial-Socket Protocol.md"
},
{
"basename": "Instrument Protocol Switching Mechanism",
"path": "01-Documentation/Dispositivos - Manuales/Maselli/Maselli - Utility/Instrument Protocol Switching Mechanism.md"
},
{
"basename": "Instrument Communication Service",
"path": "01-Documentation/Dispositivos - Manuales/Maselli/Maselli - Utility/Instrument Communication Service.md"
},
{
"basename": "Basic FAQ Software",
"path": "01-Documentation/Dispositivos - Manuales/Maselli/Maselli - Utility/Basic FAQ Software.md"
},
{
"basename": "Maselli - ADAM - Protocol",
"path": "01-Documentation/Dispositivos - Manuales/Maselli/Maselli - ADAM - Protocol.md"
},
{
"basename": "Masselli (UR62 & UR29)",
"path": "04-SIDEL/09 - SAE452 - Diet as Regular - San Giovanni in Bosco/Masselli (UR62 & UR29).md"
},
{
"basename": "Diet As Regular - Emails",
"path": "04-SIDEL/09 - SAE452 - Diet as Regular - San Giovanni in Bosco/Emails/Diet As Regular - Emails.md"
},
{
"basename": "CIPLocal",
"path": "04-SIDEL/00 - MASTER/Source/source/CIPLocal.md"
}
],
"omittedPaths": [],

View File

@ -13,12 +13,13 @@
"state": {
"type": "markdown",
"state": {
"file": "04-SIDEL/06 - E5.007363 - Modifica O&U - SAE196 (cip integrato)/SAE196 - IO.md",
"file": "04-SIDEL/06 - E5.007363 - Modifica O&U - SAE196 (cip integrato)/Source/source/Profibus_Variables.md",
"mode": "source",
"source": false
"source": false,
"backlinks": false
},
"icon": "lucide-file",
"title": "SAE196 - IO"
"title": "Profibus_Variables"
}
},
{
@ -27,73 +28,62 @@
"state": {
"type": "markdown",
"state": {
"file": "04-SIDEL/00 - MASTER/MIXER/SIDEL - Mixer - Equivalences.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "SIDEL - Mixer - Equivalences"
}
},
{
"id": "b44a0fb4ad99b202",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "04-SIDEL/07 - E5.007600 - SAE469/E5.007600 - SAE469 - FDM.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "E5.007600 - SAE469 - FDM"
}
},
{
"id": "c3eb7a4ad13c9617",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "01-Documentation/Routers/Mikrotik - Network Redes/Backups - Mikrotik.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "Backups - Mikrotik"
}
},
{
"id": "71b347c5a00c61de",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "01-Documentation/Routers/Zero-Tier ONE - Lan NAT.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "Zero-Tier ONE - Lan NAT"
}
},
{
"id": "04a27eed4746bbe4",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "04-SIDEL/06 - E5.007363 - Modifica O&U - SAE196 (cip integrato)/SAE196 - IO Adapted.md",
"file": "01-Documentation/Windows/SysInternals Tools.md",
"mode": "source",
"source": false,
"backlinks": false
},
"icon": "lucide-file",
"title": "SAE196 - IO Adapted"
"title": "SysInternals Tools"
}
},
{
"id": "7ca06d73d28f59fc",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "01-Documentation/GIT/Git - Start New Repository with Visual Studio Code - VS Code.md",
"mode": "source",
"source": false,
"backlinks": false
},
"icon": "lucide-file",
"title": "Git - Start New Repository with Visual Studio Code - VS Code"
}
},
{
"id": "70fc8b0e35ca06c6",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "01-Documentation/GIT/GIT commands HELP.md",
"mode": "source",
"source": false,
"backlinks": false
},
"icon": "lucide-file",
"title": "GIT commands HELP"
}
},
{
"id": "f3acf87b79b7f9ad",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "03-VM/33 - 9.402x - Shibuya/Notes for techinician on site/9.402x - Notes for technician on site - CARTON REJECT SYSTEM.md",
"mode": "source",
"source": false,
"backlinks": false
},
"icon": "lucide-file",
"title": "9.402x - Notes for technician on site - CARTON REJECT SYSTEM"
}
}
],
"currentTab": 5
"currentTab": 4
}
],
"direction": "vertical"
@ -125,7 +115,7 @@
"state": {
"type": "search",
"state": {
"query": "",
"query": "tag:#Figure",
"matchingCase": false,
"explainSearch": false,
"collapseAll": false,
@ -160,7 +150,7 @@
}
],
"direction": "horizontal",
"width": 288.5
"width": 286.5
},
"right": {
"id": "403186784ae0fd88",
@ -287,54 +277,54 @@
"obsidian-importer:Open Importer": false
}
},
"active": "04a27eed4746bbe4",
"active": "f3acf87b79b7f9ad",
"lastOpenFiles": [
"01-Documentation/Python/Python Notes.md",
"01-Documentation/Python/Scripts Python/Script para obtener las ultimas versiones.md",
"01-Documentation/Python/Scripts Python/Group Scripts Manager.md",
"01-Documentation/Python/Scripts Python/Conda - Anaconda - miniconda.md",
"01-Documentation/Python/Scripts Python/Miniconda Como hacer un backup completo de un entorno creado con Miniconda.md",
"01-Documentation/Python/Scripts Python/API Google Translate.md",
"01-Documentation/Python/Scripts Python/Allen Bradley HMI Translate - Python - LLM - Google Translate.md",
"04-SIDEL/06 - E5.007363 - Modifica O&U - SAE196 (cip integrato)/SAE196 - IO Adapted.md",
"04-SIDEL/07 - E5.007600 - SAE469/E5.007600 - SAE469 - FDM.md",
"01-Documentation/Dockers/Docker Basics - Essential Commands and Usage Guide.md",
"01-Documentation/Dockers/Docker - Prometheus.md",
"01-Documentation/Dockers/Radarr - Lidarr - Sonarr - QBittorrent - Prowlarr - Unmanic.md",
"04-SIDEL/00 - MASTER/MIXER/Documentacion/FB1751 - BlenderPID_PIDSPCalc Documentation.md",
"Untitled Diagram 1.svg",
"Untitled Diagram.svg",
"Untitled Diagram 2.svg",
"03-VM/39 - 94102 - Alpla - Usa/94102 - ALPLA- USA - Notes for technician on site.md",
"01-Documentation/Dockers/Untitled Diagram.svg",
"01-Documentation/Siemens/TIA Portal/OPC UA.md",
"01-Documentation/Routers/Mikrotik - Network Redes/Backups - Mikrotik.md",
"01-Documentation/Lidarr - Radarr/Radarr - Lidarr - Sonarr - QBittorrent - Prowlarr - Unmanic.md",
"01-Documentation/Dockers",
"01-Documentation/VPN - Zerotier - Wireguard/Configurazione ZeroTier con Home Assistant - Riccardo.md",
"01-Documentation/VPN - Zerotier - Wireguard/adjuntos/Pasted image 20250501184305.png",
"01-Documentation/VPN - Zerotier - Wireguard/adjuntos/Pasted image 20250501184158.png",
"01-Documentation/VPN - Zerotier - Wireguard/adjuntos",
"01-Documentation/Routers/Mikrotik - Network Redes/Mikrotik - Zerotier - zero_work network.md",
"01-Documentation/VPN - Zerotier - Wireguard",
"Untitled.md",
"Untitled 1.md",
"03-VM/33 - 9.402x - Shibuya/Notes for techinician on site/9.402x - Shibuya - Logics & Control.md",
"03-VM/33 - 9.402x - Shibuya/9.402x - After FAT considerations from customer.md",
"03-VM/33 - 9.402x - Shibuya/Notes for techinician on site/9.402x - Notes for technician on site - CARTON REJECT SYSTEM.md",
"01-Documentation/Dispositivos - Manuales/ADAM/ADAM 4021 - 485 to 4..20ma - Commissioning & Firmware update.md",
"01-Documentation/GIT/GIT commands HELP.md",
"01-Documentation/Windows/SysInternals Tools.md",
"01-Documentation/GIT/Git - Start New Repository with Visual Studio Code - VS Code.md",
"04-SIDEL/10 - E5.007095 - Modifica O&U - SAE463/Emails.md",
"04-SIDEL/10 - E5.007095 - Modifica O&U - SAE463/Differences.md",
"04-SIDEL/CheckList/Misuratori Endress&Hauser.md",
"01-Documentation/Endress+Houser/8F3B25-AAILABBFAASAFMWAA1+NB - Adapter RJ45 M12 (service interface).md",
"04-SIDEL/10 - E5.007095 - Modifica O&U - SAE463/adjuntos/Pasted image 20250509125112.png",
"04-SIDEL/10 - E5.007095 - Modifica O&U - SAE463/adjuntos/Pasted image 20250509125000.png",
"04-SIDEL/10 - E5.007095 - Modifica O&U - SAE463/adjuntos",
"04-SIDEL/09 - SAE452 - Diet as Regular - San Giovanni in Bosco/Maselli Sensor to Siemens PLC Communication Implementation.md",
"04-SIDEL/10 - E5.007095 - Modifica O&U - SAE463",
"01-Documentation/Endress+Houser/adjuntos/Pasted image 20250508205345.png",
"01-Documentation/Endress+Houser/adjuntos/Pasted image 20250508205329.png",
"markitdown-output/My Endress+Hauser _ Endress+Hauser.md",
"markitdown-output/1746730275557_My Endress+Hauser _ Endress+Hauser.html",
"markitdown-output",
"01-Documentation/Dispositivos - Manuales/Maselli/Maselli - Protocol - Gateway - 485 - Ethernet.md",
"01-Documentation/Dispositivos - Manuales/CableMAX - Converter 485 - Serial Adaptor RS232 - CM-RSDB9-PRO.md",
"01-Documentation/GIT/Notes - Git - Gitea.md",
"04-SIDEL/CheckList/PC HMI Zenon.md",
"01-Documentation/Decompiler/MSI decompiler.md",
"01-Documentation/Decompiler/cSharp Decompiler.md",
"01-Documentation/Visual Studio Cn/Singleton.md",
"01-Documentation/Decompiler",
"04-SIDEL/06 - E5.007363 - Modifica O&U - SAE196 (cip integrato)/Source/SAE196_c0.2_CAx_Export_Hardware_Tree.md",
"01-Documentation/AI - IA - LLM - Artificial Intelligence/MCP.md",
"01-Documentation/AI - IA - LLM - Artificial Intelligence/AI Prompts useful.md",
"DB/RouteHelper/Routes.md",
"04-SIDEL/00 - MASTER/MIXER/SIDEL - Mixer - Equivalences.md",
"adjuntos/Promag300_500DP_verificationreport_2025-04-14_1243.pdf",
"adjuntos/presente_indicativo_completo.pdf",
"adjuntos",
"04-SIDEL/00 - MASTER/MIXER/S7 Software Calls.md",
"04-SIDEL/00 - MASTER/MIXER/Documentacion/Análisis Detallado OBs.md",
"04-SIDEL/00 - MASTER/MIXER/Documentacion/Análisis del Software PLC Mixer.md",
"03-VM/39 - 94102 - Alpla - Usa/94102 - Alpla - Usa.md",
"04-SIDEL/00 - MASTER/MIXER/Documentacion/FB1751 - BlenderPID_PIDSPCalc Map.md",
"04-SIDEL/00 - MASTER/MIXER/Documentacion/adjuntos/Pasted image 20250429213121.png",
"04-SIDEL/00 - MASTER/MIXER/Documentacion/adjuntos",
"01-Documentation/Routers/Mikrotik - Network Redes/adjuntos/Pasted image 20250429124724.png",
"01-Documentation/Vetromeccanica/Sacomea/adjuntos/Pasted image 20250428204503.png",
"04-SIDEL/07 - E5.007600 - SAE469/adjuntos/Pasted image 20250428173456.png",
"01-Documentation/Blender Software/Video Editing/adjuntos",
"01-Documentation/Blender Software/Video Editing",
"01-Documentation/Blender Software",
"01-Documentation/Routers/Mikrotik - Network Redes/Backups - Mikrotik.md",
"04-SIDEL/CheckList/adjuntos/Pasted image 20250508101219.png",
"04-SIDEL/CheckList/adjuntos/Pasted image 20250508101103.png",
"04-SIDEL/CheckList/adjuntos/Pasted image 20250508101040.png",
"04-SIDEL/CheckList/adjuntos",
"04-SIDEL/CheckList",
"05-COMS/02 - PANELLO NESTLE/Reporte",
"01-Documentation/Siemens/Peripherics - Schede - IM/adjuntos/Pasted image 20250507112955.png",
"03-VM/9..... MASTER Transport/Standard Transport/adjuntos/Pasted image 20250507111418.png",
"01-Documentation/Dispositivos - Manuales/Maselli/adjuntos/Pasted image 20250506165059.png",
"03-Revised/93789 Sipa Italia - Tinny - HSCounters - Piattaforma/Divider/Untitled.canvas",
"04-InLavoro/9..... MASTER Transport/Standard Transport/FB500 Logic.canvas",
"04-InLavoro/HENKEL/93040 - HENKEL - BowlingGreen/TL22-L25/Synoptic Change/Q3.canvas",

View File

@ -0,0 +1,2 @@
[lessmsi-gui.exe](file:///C:%5CProgramData%5Cchocolatey%5Clib%5Clessmsi%5Ctools%5Clessmsi-gui.exe)

View File

@ -0,0 +1,12 @@
***
### CodemerxDecompile
***
[CodemerxDecompile.exe](file:///D:%5CProyectos%5CVisualStudio%5CDecompilers%5CCodemerxDecompile-windows-x64%5CCodemerxDecompile.exe)
* No tan bueno como ILSpy
### ILSpy
***
[ILSpy.exe](file:///C:%5CUsers%5Cmigue%5CAppData%5CLocal%5CPrograms%5CILSpy%5CILSpy.exe)
* Realmente muy bueno

View File

@ -0,0 +1,16 @@
***
![[Pasted image 20250506144537.png|341]]
* When the ADAM is new needs to setup the speed and check the firmware required for the Serial ADAM Protocol.
*
![[01-Documentation/Dispositivos - Manuales/ADAM/adjuntos/Screenshot 2025-05-06 111701.jpg|800]]
![[01-Documentation/Dispositivos - Manuales/ADAM/adjuntos/Screenshot 2025-05-06 111755.jpg|800]]
![[01-Documentation/Dispositivos - Manuales/ADAM/adjuntos/Screenshot 2025-05-06 113243.jpg]]
![[01-Documentation/Dispositivos - Manuales/ADAM/adjuntos/Screenshot 2025-05-06 114159.jpg|800]]

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

View File

@ -0,0 +1,48 @@
[USB_to_RS-232-422-485_Manual_V13.11.4.pdf](file:///D:%5CInstalad%5CRS232%20-%20422%20-%20485%5CUSB_to_RS-232-422-485_Manual_V13.11.4.pdf)
### FTDI USB to RS-232 / RS-422 / RS-485 Pro Grade Configurable Adapter
***
[FTDI USB to RS-232 / RS-422 / RS-485 Pro Grade Configurable Adapter](https://cablemax.com/cm-rsdb9-pro?srsltid=AfmBOop-yFcIXoTWivwgHDn54W61usNIBS1UhGzRC-E89_QwlKlPd2Rw)
### App for SETUP SERIAL
***
[RS-232_422_485 AP.lnk](file:///C:%5CProgramData%5CMicrosoft%5CWindows%5CStart%20Menu%5CPrograms%5CRS-232_422_485%20AP%5CRS-232_422_485%20AP.lnk)
### Terminal software:
***
Terminal Software: [AccessPort.exe](file:///D:%5CInstalad%5CRS232%20-%20422%20-%20485%5CAccessPort%5CAccessPort137%5CAccessPort.exe)
Directory: [AccessPort137](file:///D:%5CInstalad%5CRS232%20-%20422%20-%20485%5CAccessPort%5CAccessPort137)
## USB to RS-232/422/485 Adapter
The USB to serial interface adapter offers an easy way to connect a DB9 serial device to a USB port. All configuration and electrical interface selections are handled through the driver, eliminating the need to open the enclosure to set jumpers or switches.
The serial port is software configurable for RS-232, RS-422, and RS-485 with the electrical interface settings maintained locally, allowing the host computer to be repaired or upgraded without reconfiguring the serial port.
## Features and Specifications
- Full compliance with the USB Specification 2.0 & 1.1
- RS-232 / RS-422 / RS-485 (Echo mode / Bias resister / Terminal resister) set up by Windows application program
- Bus powered, no external power required
- Support 32 Node on the network
- High data rate up to 230 kbps (RS-232) ~ 3 M Baud (RS-422 or RS-485)
- ±15kV HBM ESD Protected
- DB-9 Male Pin Assignment
- RS-232 RS-422 RS-485
- Chip FTDI 1 DCD TX- D-
- Data Rate RS-232 230 Kbps 2 RXD TX+ D+
- RS-422 / RS-485 3 M Baud 3 TXD RX+
- LED 3 4 DTR RX-
- Connector Host USB Type A Male 5 GND GND GND
- Device DB-9 Male 6 DSR RTS-
- Compliant USB Spec. 2.0 / 1.1 7 RTS RTS+
- Housing Plastic 8 CTS CTS+
- Dimension ( L x W x H ) 66 x 39 x 20 mm 9 RI CTS-
### OS Support
- Windows Windows 7, 8, & 10
- Linux and Mac OS 10.X

View File

@ -0,0 +1,7 @@
![[Pasted image 20250504120154.png]]
* Al final para lograr que funcione con el NVIDIA Shield tuve que conectarlo parearlo con la PC y luego el adaptador Unified usado lo conecte en el NVIDIA. Como ya estaban funcionando en la PC luego siguio funcionando en el Shield. Lo conecte en el puerto USB superior del SHIELD.
![[k400-quick-start-guide.pdf]]

View File

@ -0,0 +1,25 @@
***
#maselli #adam
Maselli sensor can be interfaced to ADAM converter as depicted in Figure 1.
![[Pasted image 20250506165035.png]]
`(Figure 1) - Maselli sensors with ADAM connection `
Maselli sensor UR29 communicates with ADAM with RS485 with ==115200==, 8N1 settings. Maselli sensor UR62 communicates with ADAM with RS485 with ==19200==, 8N1 settings.
Maselli sensors communicate periodically (in a unidirectional way) to ADAM sending a string in following format:
| Field | Start (1 char) | Adam address (2 chars) | Brix or Temperature value in mA (XX.YYY: 6 chars) | Checksum (2 chars) | Carriage return (1 char) |
| :-----: | :------------: | :--------------------: | :-----------------------------------------------: | :----------------: | :----------------------: |
| Example | # | 01 | 02.145 | CkCk | Cr |
Be aware that the value is already in mA, so the range must be configured in the UR:
* 4 mA--------------------- UR Brix Low value (ex: 0 Brix)
* 20 mA------------------- UR Brix High value (ex: 80 Brix)
An example of string can be seen in the terminal depicted in Figure 2.
![[Pasted image 20250506165059.png]]
`(Figure 2) Maselli string in serial terminal`

View File

@ -0,0 +1,321 @@
# Maselli Sensor to Siemens PLC Communication Implementation
## Introduction
This document provides an implementation guide for establishing communication between a Maselli sensor (which uses the ADAM protocol over RS485) and a Siemens S7-315 DP/PN PLC using a Waveshare RS232/485 TO WIFI ETH (B) gateway. This implementation handles the unidirectional communication where data flows from the sensor to the PLC.
## Maselli Protocol with ADAM Overview
As per the provided documentation, the Maselli sensor communicates with the following characteristics:
- **Maselli UR29**: RS485 with 115200 baud, 8N1 settings
- **Maselli UR62**: RS485 with 19200 baud, 8N1 settings
- **Communication Type**: Unidirectional (sensor sends data to PLC)
- **Data Format**: String with specific format:
```
# XX XX.YYY CkCk Cr
```
Where:
- `#` is the start character
- `XX` is the ADAM address (2 chars)
- `XX.YYY` is the Brix or Temperature value in mA (6 chars)
- `CkCk` is the checksum (2 chars)
- `Cr` is the carriage return
- **Value Range Example**:
- 4 mA corresponds to Low Brix value (e.g., 0 Brix)
- 20 mA corresponds to High Brix value (e.g., 80 Brix)
## SCL Implementation
The following SCL code provides a complete implementation for handling this communication. The implementation consists of multiple parts:
1. A function block for managing TCP/IP communication with the gateway
2. Functions for parsing the Maselli protocol string
3. Functions for scaling the mA value to the appropriate Brix value
4. Configuration functions for the TCP connection
### Main Function Block
```pascal
FUNCTION_BLOCK "FB_Maselli_Communications"
VAR_INPUT
xExecute : BOOL; // Trigger to initiate connection
tConnectionID : TCON_IP_v4; // TCP connection parameters
END_VAR
VAR_OUTPUT
xConnected : BOOL; // Connection status
xError : BOOL; // Communication error
wErrorID : WORD; // Error code
rBrixValue : REAL; // Calculated Brix value
rTempValue : REAL; // Calculated Temperature value (if applicable)
rCurrentmA : REAL; // Received mA value
END_VAR
VAR
// TCP communication variables
fbTCON : TCON; // FB for TCP connection
fbTRCV : TRCV; // FB for TCP reception
xTCONExecute : BOOL;
xTRCVExecute : BOOL;
wTCONID : WORD := 1; // Connection ID
// Buffer and processing variables
aRxBuffer : ARRAY[0..255] OF BYTE; // Reception buffer
iRxLength : INT; // Received length
sRxString : STRING[255]; // Reception string
sParsedValue : STRING[6]; // Extracted value as string (XX.YYY)
// Parsing variables
iState : INT := 0; // Parsing state
xNewDataReceived : BOOL := FALSE; // New data flag
// Scaling variables
rLowBrix : REAL := 0.0; // Low Brix value (4mA)
rHighBrix : REAL := 80.0; // High Brix value (20mA)
END_VAR
VAR CONSTANT
START_CHAR : BYTE := 16#23; // '#' in ASCII
END_VAR
BEGIN
// ---- TCP Connection Management ----
IF xExecute AND NOT xConnected THEN
xTCONExecute := TRUE;
END_IF;
// Establish connection
fbTCON(
EN := TRUE,
ENO => ,
REQ := xTCONExecute,
ID := wTCONID,
CONNECT := tConnectionID,
DONE => xConnected,
BUSY => ,
ERROR => xError,
STATUS => wErrorID
);
// Reset connection trigger
IF xConnected OR xError THEN
xTCONExecute := FALSE;
END_IF;
// ---- Data Reception ----
IF xConnected THEN
xTRCVExecute := TRUE;
// Receive data
fbTRCV(
EN := TRUE,
ENO => ,
REQ := xTRCVExecute,
ID := wTCONID,
LEN := 0, // Adhoc mode (receives whatever is available)
DATA := aRxBuffer,
RCVD_LEN => iRxLength,
DONE => xNewDataReceived,
BUSY => ,
ERROR => xError,
STATUS => wErrorID
);
// Process received data
IF xNewDataReceived AND iRxLength > 0 THEN
// Convert data to string for processing
sRxString := '';
FOR i := 0 TO iRxLength-1 DO
sRxString := CONCAT(IN1 := sRxString,
IN2 := CHR(IN := aRxBuffer[i]));
END_FOR;
// Process Maselli/ADAM protocol
ParseMaselliString(sRxString);
// Calculate Brix value based on mA value (linear scale)
rBrixValue := LinearScale(rCurrentmA, 4.0, 20.0, rLowBrix, rHighBrix);
// Reset flag
xNewDataReceived := FALSE;
END_IF;
END_IF;
END_FUNCTION_BLOCK
```
### Parsing Function
```pascal
// Function to process the received Maselli/ADAM string
FUNCTION "ParseMaselliString" : VOID
VAR_INPUT
sInputString : STRING;
END_VAR
VAR_TEMP
sCurrentChar : STRING(1);
iPos : INT := 0;
iParseState : INT := 0; // 0:Waiting for #, 1:Reading addr, 2:Reading value, 3:Reading checksum
sAddrStr : STRING(2);
sValueStr : STRING(6);
sChecksumStr : STRING(2);
END_VAR
BEGIN
// Reset variables
sAddrStr := '';
sValueStr := '';
sChecksumStr := '';
// Parse the string character by character
FOR iPos := 0 TO LEN(sInputString) - 1 DO
sCurrentChar := MID(IN := sInputString, L := 1, P := iPos + 1);
CASE iParseState OF
0: // Waiting for start character '#'
IF sCurrentChar = '#' THEN
iParseState := 1;
END_IF;
1: // Reading ADAM address (2 characters)
sAddrStr := CONCAT(IN1 := sAddrStr, IN2 := sCurrentChar);
IF LEN(sAddrStr) = 2 THEN
iParseState := 2;
END_IF;
2: // Reading mA value (6 characters, format XX.YYY)
sValueStr := CONCAT(IN1 := sValueStr, IN2 := sCurrentChar);
IF LEN(sValueStr) = 6 THEN
iParseState := 3;
// Convert string to real value
#rCurrentmA := STRING_TO_REAL(sValueStr);
END_IF;
3: // Reading checksum (2 characters)
sChecksumStr := CONCAT(IN1 := sChecksumStr, IN2 := sCurrentChar);
// Checksum validation not implemented in this simplified example
END_CASE;
END_FOR;
END_FUNCTION
```
### Scaling Function
```pascal
// Function to linearly scale the mA value to Brix
FUNCTION "LinearScale" : REAL
VAR_INPUT
rInput : REAL; // Value to scale (mA)
rInMin : REAL; // Input minimum (4mA)
rInMax : REAL; // Input maximum (20mA)
rOutMin : REAL; // Output minimum (0 Brix)
rOutMax : REAL; // Output maximum (80 Brix)
END_VAR
BEGIN
// Linear scaling formula
#LinearScale := (rInput - rInMin) * (rOutMax - rOutMin) / (rInMax - rInMin) + rOutMin;
// Ensure result is within limits
IF #LinearScale < rOutMin THEN
#LinearScale := rOutMin;
ELSIF #LinearScale > rOutMax THEN
#LinearScale := rOutMax;
END_IF;
END_FUNCTION
```
### Main Application Block
```pascal
// Main application block
ORGANIZATION_BLOCK "OB1"
VAR_TEMP
// Temporary variables
END_VAR
BEGIN
// Configure TCP connection
"ConfigureTCPConnection"();
// Process Maselli data
"FB_Maselli_Communications"(
xExecute := TRUE,
tConnectionID := "g_tConnection"
);
// Additional code to use Brix values can be added here
END_ORGANIZATION_BLOCK
```
### Connection Configuration Function
```pascal
// Function to configure TCP connection parameters
FUNCTION "ConfigureTCPConnection" : VOID
VAR_GLOBAL
g_tConnection : TCON_IP_v4; // Global variable for connection parameters
END_VAR
BEGIN
// Configure TCP connection parameters
g_tConnection.InterfaceId := 64; // Ethernet interface ID (verify in hardware)
g_tConnection.ID := 1; // Connection ID
g_tConnection.ConnectionType := 11; // Connection type: TCP
g_tConnection.ActiveEstablished := TRUE; // PLC initiates connection
// IP and port of Waveshare gateway
g_tConnection.RemoteAddress.ADDR[1] := 192; // IP Address: 192.168.x.x
g_tConnection.RemoteAddress.ADDR[2] := 168; // Adjust according to gateway IP
g_tConnection.RemoteAddress.ADDR[3] := 1; // Adjust according to gateway IP
g_tConnection.RemoteAddress.ADDR[4] := 10; // Adjust according to gateway IP
g_tConnection.RemotePort := 8899; // Default gateway port
// Local port for TCP connection
g_tConnection.LocalPort := 2000; // Arbitrary local port
END_FUNCTION
```
## Configuration Guide
To implement this solution, follow these steps:
### 1. Configure the Waveshare Gateway
Configure the Waveshare RS232/485 TO WIFI ETH (B) gateway in transparent transmission mode with these parameters:
- **For UR29 sensor**:
- RS485: 115200 baud, 8N1
- TCP Server mode (recommended)
- Fixed IP address on your network
- **For UR62 sensor**:
- RS485: 19200 baud, 8N1
- TCP Server mode (recommended)
- Fixed IP address on your network
### 2. PLC Configuration
- Import the SCL code into your TIA Portal project
- Adjust the IP address settings in the `ConfigureTCPConnection` function to match your gateway's IP
- Modify the `rLowBrix` and `rHighBrix` values according to your specific application requirements
- Configure the Ethernet port of the S7-315 PLC to be on the same subnet as the gateway
### 3. Verification
After implementing the code:
- Monitor the `xConnected` output to verify the connection status
- Check the `rBrixValue` output to see the converted Brix values
- Use the `xError` and `wErrorID` outputs for troubleshooting if connection issues occur
## Additional Notes
- This implementation focuses on handling the reception of data in the specified Maselli/ADAM format
- The checksum validation is not implemented in this example but could be added for improved reliability
- For optimal performance, ensure the network connection between the PLC and the gateway is stable
- Consider adding watchdog functionality to detect communication failures

View File

@ -0,0 +1,109 @@
Este proyecto, denominado [Uc09_Utility](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html), es una aplicación de escritorio de Windows Forms diseñada para interactuar con instrumentos Maselli.
**Funcionamiento General:**
1. **Inicio y Configuración ([Program.cs](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html) y [FormPrincipaleMDI_Load](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)):**
- La aplicación se inicia ejecutando [FormPrincipaleMDI](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html) ([Uc09_Utility\FormPrincipaleMDI.cs](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)).
- Configura el entorno de la aplicación, incluyendo estilos visuales y manejo global de excepciones. Las excepciones no controladas se registran en un archivo `log.txt` dentro de una carpeta `logs`.
- Al cargar el formulario principal ([FormPrincipaleMDI_Load](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)):
- Detecta la versión de Windows.
- Procesa argumentos de línea de comandos para activar modos especiales como "DEMO", "PROVABRIX", "DEBUG" o "CCD".
- Carga la configuración desde un archivo `setup.txt`.
- Ajusta la resolución de la aplicación según la configuración o la pantalla.
- Define rutas para archivos de servicio, iconos e imágenes.
- Inicializa variables y los instrumentos Maselli ([ClassInizializzazioni.InizializzaStrumenti()](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)).
- Establece la comunicación serial ([ClassSerialeStrumenti](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)) con los instrumentos basándose en la configuración (puerto COM, baudrate).
- Inicializa una conexión a una base de datos SQL (`ClassDatabaseSQLMaselli`).
- Un servicio ([CommunicationHandlerLoggerService](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)) se encarga de eliminar datos antiguos (más de seis meses).
2. **Interfaz Principal (MDI):**
- [FormPrincipaleMDI](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html) es un contenedor MDI (Multiple Document Interface), lo que significa que puede albergar múltiples ventanas secundarias (paneles) dentro de ella.
3. **Navegación por Paneles ([timer1_Tick](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)):**
- Un temporizador ([timer1](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)) se ejecuta periódicamente (cada 800 ms).
- En cada [Tick](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html) del temporizador, el método [timer1_Tick](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html) ([Uc09_Utility\FormPrincipaleMDI.cs](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)) verifica la variable [Pannelli.NumeroPannello](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html).
- Si [Pannelli.NumeroPannello](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html) cambia, el panel (formulario) actual se cierra y se abre uno nuevo correspondiente al nuevo número. Existe una larga serie de `if-else if` que instancia diferentes formularios (ej. [Form1](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html), [Frm_setup](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html), [FormUC08Liv1](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html), [FrmParameters](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html), etc.) según este número.
- Este mecanismo permite cambiar dinámicamente la interfaz que se muestra al usuario.
4. **Comunicación con Instrumentos:**
- La aplicación se comunica con los instrumentos Maselli a través del puerto serie.
- Maneja eventos como el cambio de protocolo de comunicación de un instrumento a "Maselli" ([OnProtocolFunctionChangedToMaselli](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)).
5. **Manejo de Cierre ([MainFormClosing](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)):**
- Antes de cerrar, si la comunicación serial está activa, presenta un diálogo de confirmación.
- Permite al usuario decidir si confirma el protocolo MASELLI o si se deben realizar cambios antes de cerrar la comunicación serial.
**¿Qué permite realizar?**
La aplicación parece ser una utilidad central para:
- **Monitorear y controlar** diversos tipos de instrumentos Maselli (identificados por los diferentes formularios como [FormUC08Liv1](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html), [FormURXXLivello1](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html), [FrmOssigenoLiv1](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html), etc.).
- **Configurar** los instrumentos y los parámetros de la aplicación (ej. [Frm_setup](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html), [Frm_InstrumentConfiguration](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)).
- **Visualizar datos** provenientes de los instrumentos (posiblemente en formularios como [FormDataAcquisition](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html), [FormMisureUR70](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)).
- Realizar **diagnósticos** y ver **alarmas** ([FormDiagnostica](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html), [FormAlarms](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)).
- Gestionar la **calibración** y **certificados** ([Frm_certif_calibr](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)).
- Guardar datos o configuraciones ([FormSaveFile](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)).
- Operar en diferentes modos (normal, demo, debug) para pruebas o funcionalidades específicas.
En resumen, [Uc09_Utility](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html) actúa como un panel de control y gestión para una variedad de instrumentos Maselli, facilitando su configuración, monitoreo y la adquisición de datos en un entorno industrial o de laboratorio.
### Communicacion:
***
La comunicación con los dispositivos Maselli en este proyecto se gestiona principalmente a través de la comunicación serial (puerto COM). Aquí te explico los puntos clave:
1. **Inicialización de la Comunicación Serial (`ClassSerialeStrumenti` y `FormPrincipaleMDI_Load`):**
- En el evento `FormPrincipaleMDI_Load` ([Uc09_Utility\FormPrincipaleMDI.cs](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)), después de cargar la configuración, se llama a `ClassInizializzazioni.InizializzaStrumenti()`.
- Dentro de `ClassInizializzazioni` (no visible en el `.csproj` pero inferido por su uso), es muy probable que se instancie y configure un objeto de la clase `ClassSerialeStrumenti`.
- `ClassSerialeStrumenti` (tampoco visible directamente, pero su nombre es muy indicativo) sería la responsable de:
- Abrir el puerto COM especificado en el archivo de configuración (`setup.txt`).
- Configurar los parámetros del puerto serie como baudrate, paridad, bits de datos y bits de parada, también leídos desde la configuración.
- Manejar el envío y recepción de datos hacia/desde los instrumentos Maselli.
2. **Protocolo de Comunicación:**
- La aplicación parece soportar un protocolo específico de Maselli. Esto se evidencia en el método `OnProtocolFunctionChangedToMaselli` en `FormPrincipaleMDI.cs`.
- Este método se activa cuando un instrumento cambia su función de protocolo a "Maselli", lo que sugiere que la aplicación adapta su comportamiento de comunicación según el protocolo activo del instrumento.
3. **Envío y Recepción de Comandos/Datos:**
- Una vez establecida la conexión serial, la aplicación enviará comandos a los instrumentos para solicitar datos, cambiar configuraciones, iniciar mediciones, etc.
- Recibirá respuestas de los instrumentos que contienen los datos medidos, estados, confirmaciones, o errores.
- La clase `ClassSerialeStrumenti` probablemente encapsula la lógica para formatear los comandos según el protocolo Maselli y para interpretar los datos recibidos.
4. **Manejo de Eventos y Datos:**
- Los diferentes formularios (paneles) que representan a cada instrumento (`FormUC08Liv1`, `FormURXXLivello1`, etc.) interactuarán con `ClassSerialeStrumenti` (directa o indirectamente) para:
- Enviar solicitudes específicas al instrumento que representan.
- Recibir y mostrar los datos actualizados del instrumento.
- Gestionar alarmas o eventos reportados por el instrumento.
5. **Cierre de la Comunicación:**
- En el evento `MainFormClosing` de `FormPrincipaleMDI.cs`, se verifica si la comunicación serial está activa.
- Si lo está, se presenta un diálogo al usuario. Esto es importante para asegurar que cualquier operación en curso con el instrumento se complete o se cancele de forma segura antes de cerrar el puerto.
- Se ofrece la opción de "Confirmar Protocolo MASELLI" o realizar cambios, lo que podría implicar enviar un comando final al instrumento antes de cerrar la conexión.
En resumen, la comunicación se basa en una conexión serial configurada según los parámetros definidos en `setup.txt`. Una clase dedicada (`ClassSerialeStrumenti`) maneja las operaciones de bajo nivel del puerto COM y la implementación del protocolo Maselli, mientras que los formularios de la interfaz de usuario interactúan con esta clase para controlar y monitorear los instrumentos.
### Cambio de protocolo:
***La aplicación, específicamente [Uc09_Utility](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html), no parece _realizar_ el cambio de protocolo en el dispositivo Maselli en sí misma, sino que _reacciona_ a una notificación de que el protocolo del instrumento ha cambiado a "Maselli".
Este manejo se centra en el método `OnProtocolFunctionChangedToMaselli` que se encuentra en `FormPrincipaleMDI.cs`. Así es como probablemente funciona:
1. **Detección y Notificación Externa:**
- El instrumento Maselli cambia su protocolo de comunicación a "Maselli". Esto puede ser iniciado por el propio instrumento, por una configuración directa en el dispositivo, o a través de un comando enviado (posiblemente por esta utilidad u otra).
- Una librería o componente de más bajo nivel, encargado de la comunicación directa con el instrumento (potencialmente parte de `UI.Library.dll`, que está referenciada en tu archivo [Uc09_Utility.csproj](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)), detecta este cambio.
- Este componente de bajo nivel luego dispara un evento dentro de la aplicación para notificar sobre el cambio de protocolo.
2. **Suscripción al Evento:**
- En el código de `FormPrincipaleMDI.cs`, el método `OnProtocolFunctionChangedToMaselli` está suscrito a ese evento específico. Esto significa que cuando el evento de "cambio de protocolo a Maselli" se dispara, este método se ejecuta automáticamente.
3. **Acciones Dentro de `OnProtocolFunctionChangedToMaselli`:**
- Una vez que se llama a `OnProtocolFunctionChangedToMaselli`, la aplicación [Uc09_Utility](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html) toma las medidas necesarias para adaptarse al nuevo estado del protocolo del instrumento. Las acciones específicas dentro de este método podrían incluir:
- Registrar el evento de cambio de protocolo (por ejemplo, en un archivo de log).
- Actualizar variables internas de la aplicación que rastrean el estado actual del protocolo de comunicación.
- Reconfigurar aspectos de la comunicación serial (manejada por `ClassSerialeStrumenti`) si el protocolo "Maselli" tiene requisitos diferentes a un protocolo anterior (por ejemplo, diferentes estructuras de comando, análisis de datos o temporizaciones).
- Modificar la interfaz de usuario, habilitando o deshabilitando funciones, o cambiando la información mostrada, si estas son específicas del protocolo "Maselli".
En resumen, el archivo `.csproj` indica el uso de librerías externas como `UI.Library.dll`. Es muy probable que esta librería (o una similar que esta utilice) gestione la comunicación con el hardware Maselli y sea responsable de generar el evento al que `OnProtocolFunctionChangedToMaselli` responde. La aplicación [Uc09_Utility](vscode-file://vscode-app/c:/Users/migue/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html) actúa como un observador que se adapta cuando se le informa que el instrumento está operando bajo el protocolo "Maselli".

View File

@ -0,0 +1,129 @@
# Instrument Communication Service
This document describes the Instrument Communication Service, a core component of the software responsible for managing all aspects of communication with connected Maselli instruments. The primary class implementing this service is `Uc09_Utility.ClassSerialeStrumenti`.
## 1. Overview and Purpose
The Instrument Communication Service acts as a central hub for bi-directional data exchange between the software application and one or more Maselli instruments. Its main purpose is to abstract the complexities of low-level communication protocols and hardware interfaces, providing a consistent way for other parts of the application to interact with instruments.
**Key Responsibilities:**
* **Multi-Instrument Management:** Handles communication with multiple instruments, potentially on different lines or addresses.
* **Command Queuing and Dispatch:** Manages a queue of commands to be sent to instruments, ensuring orderly and timely execution.
* **Protocol Implementation:** Encodes outgoing commands and decodes incoming responses according to the Maselli Proprietary Serial/Socket Protocol.
* **Transport Layer Abstraction:** Supports communication over both direct serial (RS-232/RS-485) connections and TCP/IP sockets (Ethernet Bridge).
* **Instrument Lifecycle Management:** Handles instrument detection, recognition, initialization, active communication, and graceful disconnection.
* **Data Synchronization:** Updates shared data structures (e.g., `UtilityMaselli.Variabili`) with values read from instruments.
* **Event Notification:** Provides callbacks or events for significant communication occurrences (e.g., data received, protocol change).
* **Error Handling and Logging:** Detects communication errors, retries commands, and logs relevant information.
## 2. Core Class: `Uc09_Utility.ClassSerialeStrumenti`
This class is the heart of the Instrument Communication Service.
**Key Internal Components and Mechanisms:**
* **Instrument Registry (`ListaStrumenti`)**:
* A list (`List<ClassStrumentoMaselli>`) that holds instances of all instruments the service is configured to manage.
* Each `ClassStrumentoMaselli` object contains instrument-specific details like address, function numbers, and communication state (`InstrumentSerial`).
* **Command Queue (`QueueComandiSeriali`)**:
* A thread-safe queue (`ConcurrentQueue<ComandoSeriale>`) that stores commands submitted from various parts of the application.
* Commands are processed in a FIFO (First-In, First-Out) manner, though the service prioritizes commands for instruments that are actively communicating.
* **Main Processing Loop (driven by `_timerSerialeUtility`)**:
* A `System.Timers.Timer` periodically triggers the main logic of the service.
* This loop iterates through the `ListaStrumenti`, processing each instrument based on its current communication phase (`InstrumentSerial.FaseComunicazione`).
* It handles sending commands from the queue, managing timeouts, processing received data, and transitioning instruments through different communication states.
* **Physical Communication Layer:**
* **Serial Port (`_serialPortUtility`):** An instance of `System.IO.Ports.SerialPort` used for direct serial communication. Configured based on settings in `UtilityMaselli.Setup` (COM port, baud rate, etc.).
* **Socket Communication (`_maselliSocketUtility`):** An instance of `MaselliSocket.ClassMaselliSocket` used when the Ethernet bridge is enabled (`UtilityMaselli.Setup.EnableEthernetBridge`). This class encapsulates TCP/IP client socket operations.
* The service seamlessly switches between these layers based on configuration.
* **Protocol Encoding/Decoding Engine:**
* `PreparaComando()`: Constructs the full command string according to the Maselli protocol, including address, command type, function number, value, length, and checksum.
* `CalcolaChecksum()`: Calculates the checksum for outgoing commands.
* `GestioneComandoRicevuto()`: The primary method for parsing incoming responses. It checks for protocol errors (e.g., `NOxx`), identifies response types (data, image, acknowledgment), and routes data for further processing.
* `DecoderProtocolloMaselli()`: Extracts values from standard data responses (`!VALUE`) and updates the corresponding `ClassVariabile` objects in `UtilityMaselli.Variabili`.
* `DecodificaImmagine()`: Handles the more complex task of parsing and assembling image data received from instruments.
* **Communication State Machine (`InstrumentSerial.FaseComunicazione`)**:
* Each instrument managed by the service has an associated communication phase. The service transitions instruments through these phases:
* Initial connection attempts.
* Sending "super commands" for recognition or protocol forcing.
* Instrument recognition (matching response with `Identifier.RecognizingStrings`).
* Sending instrument-specific startup commands.
* `LINKED` state for active data exchange.
* Handling image requests and multi-part responses.
* Closing communication and sending exit commands.
* **Error Handling and Retries:**
* The service checks for protocol errors (`NOxx`) in responses.
* Commands can have a retry count (`ComandoSeriale.NumeroRipetizioni`). If a command fails (timeout or error response), it can be re-queued for a limited number of retries.
* The `CommunicationHandlerLoggerService` (an implementation of `ILoggerService`) is used to log communication errors and significant events.
## 3. Service Operations and Flow
### 3.1. Initialization and Instrument Addition
1. The `ClassSerialeStrumenti` service is typically initialized once at application startup.
2. Instruments (instances of `ClassStrumentoMaselli` derivatives) are added to the service using the `AddStrumento()` method. This registers them for management.
3. The service attempts to open the configured communication port (serial or socket) via `ApriPortaComunicazione()`.
### 3.2. Submitting Commands
1. Other parts of the application (e.g., UI event handlers, automated processes) submit commands to instruments by calling `InserisciComandoSeriale()`.
2. This method populates a `ComandoSeriale` object with the necessary details (instrument address, command type, function number, value, etc.) and adds it to the `QueueComandiSeriali`.
### 3.3. Command Processing Cycle (Timer Tick)
1. The `_timerSerialeUtility_Elapsed` event handler executes periodically.
2. **Command Sending:**
* The service checks if the communication line is free (`_statoComunicazione == StatiComunicazione.LIBERO`).
* It iterates through `ListaStrumenti`. For each instrument, it checks its `FaseComunicazione`.
* If an instrument is in a state to send commands (e.g., `SEND_SUPER_COMMAND_RECOGNIZE_EQUIPMENT`, `LINKED`), the service dequeues the next relevant command (either a special command or from `QueueComandiSeriali`).
* The command is formatted using `PreparaComando()`.
* The formatted command is sent via `_serialPortUtility.Write()` or `_maselliSocketUtility.Send()`.
* The service transitions to a `WAIT_RX` state and sets a timeout for the response.
3. **Response Handling:**
* Data received on the serial port (`_serialPortUtility_DataReceived`) or socket (`_maselliSocketUtility.eventoResponseEthBridge`) triggers processing.
* The received data is passed to `GestioneComandoRicevuto()`.
* This method parses the response, checks for errors, and determines the response type.
* If it's a data response, `DecoderProtocolloMaselli()` updates the global `UtilityMaselli.Variabili`.
* If it's an image response, `DecodificaImmagine()` processes the image data.
* The command status (`ComandoSeriale.Stato`) is updated (e.g., `OK_COMMAND`, `ERROR_COMMAND`).
* Relevant callbacks/events like `ReceiveCallback` or `ModifiedReceived` are invoked.
4. **State Transitions:**
* Based on successful command execution or received data, the instrument's `FaseComunicazione` is updated (e.g., from `RECOGNIZE_EQUIPMENT` to `SEND_STARTUP_COMMANDS`, then to `LINKED`).
### 3.4. Instrument Recognition
* During initial phases, the service sends "super commands" (e.g., requesting instrument memory name).
* The response is compared against `Identifier.RecognizingStrings` for each configured instrument.
* Once a match is found, `Identifier.EquipmentRecognized` is set to true, and the instrument model may be further refined (e.g., differentiating UC07 from UC08 based on the memory name).
* The `ProtocolChangedToMaselli` event can be raised if the instrument confirms it's in Maselli mode.
### 3.5. Data Synchronization
* When `DecoderProtocolloMaselli()` successfully parses a response to a read command (`V`), it finds the corresponding `ClassVariabile` in `UtilityMaselli.Variabili` (based on instrument and function number) and updates its `Valore` property.
* This makes the latest instrument data available to the rest of the application.
## 4. Interaction with Other System Components
* **`UtilityMaselli.Setup`**: Provides configuration parameters for the communication channel (port, speed, bridge settings).
* **`UtilityMaselli.Variabili`**: The global list of `ClassVariabile` objects that this service reads from (for "M" commands, using the current value in the variable if not explicitly provided in `ComandoSeriale`) and writes to (after "V" commands).
* **`ClassStrumentoMaselli` (and derivatives)**: Provide instrument-specific information like address, function number definitions, startup/exit commands, and recognizing strings.
* **Application Logic/UI**: Submits commands via `InserisciComandoSeriale()` and consumes data from `UtilityMaselli.Variabili`. Listens to events from the service for UI updates.
* **`MaselliSocket.ClassMaselliSocket`**: Used as the transport layer when Ethernet bridge is active.
* **`CommunicationHandlerLoggerService`**: Used for logging errors and important communication events.
## 5. Service Robustness
* **Timeouts:** Manages timeouts for responses to prevent indefinite blocking.
* **Retries:** Failed commands can be retried a configurable number of times.
* **Checksums:** Validates command integrity for serial transmission.
* **Error Logging:** Provides diagnostic information for troubleshooting.
* **Concurrent Queue:** Ensures thread-safe command submission.
The Instrument Communication Service is thus a critical and complex component, orchestrating the entire flow of information between the software and the physical Maselli instruments.

View File

@ -0,0 +1,57 @@
## 1. Introduction
This document outlines the mechanism employed by the software system to command a connected instrument to switch its communication protocol, specifically to the proprietary Maselli bidirectional protocol. This is a critical function, particularly when instruments might initialize in, or be operating under, other protocols such as ADAM or PROFIBUS, which are often predominantly unidirectional (instrument primarily transmits data) and do not support the full range of commands required by the software.
The core of this mechanism relies on sending specific "Super Commands" during the initial phases of communication establishment.
## 2. The Challenge: Unidirectional Protocols
Certain industrial protocols, like ADAM or PROFIBUS (in some configurations), are designed for instruments to primarily broadcast data or respond to a very limited set of polling commands. In such states, the instrument may not be actively "listening" for or capable of processing the complex command set of the Maselli proprietary protocol.
To enable full bidirectional communication, data retrieval, parameter modification, and advanced operations (like image acquisition), the instrument must be switched from such a mode into the Maselli proprietary protocol mode.
## 3. The Solution: "Super Commands" for Protocol Forcing
The software utilizes a system of "Super Commands" to actively instruct an instrument to change its operational protocol.
**Key Components:**
* **`ClassStrumentoMaselli`**:
* Each instrument type (derived from `ClassStrumentoMaselli`) defines a list of `SuperComandi` (of type `List<ComandiDaInviare>`).
* These `SuperComandi` are pre-defined command sequences specifically designed to be understood by the instrument even if it's not fully in the Maselli protocol mode. They might be very basic commands or specific byte sequences that trigger a mode switch in the instrument's firmware.
* The `ModalitaMaselli` boolean flag within this class tracks whether the instrument is confirmed to be operating in the Maselli protocol.
* Flags like `ForzaProtocolloADAM` or `ForzaProtocolloPROFIBUS` indicate the system's awareness that an instrument might need to be switched *from* these protocols.
* **`Uc09_Utility.ClassSerialeStrumenti` (Instrument Communication Service)**:
* This service manages the communication lifecycle for each instrument.
* It employs a state machine with specific phases for communication establishment. One crucial phase is `SEND_SUPER_COMMAND_FORCED_PROTOCOLL`.
* During this phase, the `ClassSerialeStrumenti` retrieves the `SuperComandi` from the respective `ClassStrumentoMaselli` instance and sends them to the instrument.
## 4. Mechanism of Operation
1. **Initialization**: When communication with an instrument is initiated, `ClassSerialeStrumenti` begins its state machine.
2. **Entering Protocol Forcing Phase**: The service enters the `SEND_SUPER_COMMAND_FORCED_PROTOCOLL` phase (or a similar initial phase dedicated to sending these critical commands).
3. **Dispatching Super Commands**:
* The `SuperComandi` defined for the specific instrument type are retrieved.
* These commands are formatted according to the basic requirements of the Maselli protocol (e.g., `>LLLLAA T;FFFVALUE;cc\r`) but their `VALUE` or `FFF` (Function Number) part might represent a special instruction for protocol switching.
* The commands are sent to the instrument.
4. **Instrument Response and State Change**:
* The instrument, upon receiving and recognizing a valid "Super Command" for protocol switching, is expected to change its internal communication mode to the Maselli proprietary protocol.
* It should then respond in a way that confirms this change, or at least becomes receptive to further Maselli protocol commands (like identification requests).
5. **Confirmation and Transition**:
* `ClassSerialeStrumenti` awaits a response. A successful protocol switch might be confirmed by:
* A specific acknowledgment response from the instrument.
* The instrument subsequently responding correctly to standard Maselli protocol identification commands (e.g., requests for memory name or serial number).
* Once confirmed, the `ModalitaMaselli` flag for the instrument is set to `true`.
* The `ProtocolChangedToMaselli` event may be raised by `ClassSerialeStrumenti` to signal that the instrument is now ready for full Maselli protocol communication.
* The communication service then transitions to subsequent phases like `RECOGNIZE_EQUIPMENT` and `LINKED`, now expecting full Maselli protocol interaction.
## 5. Rationale and Importance
* **Enabling Bidirectional Control**: The Maselli proprietary protocol is bidirectional, allowing the software to send a wide array of commands (read, write, execute functions, request images) and receive detailed responses. This level of control is generally not possible if the instrument remains in a unidirectional or limited-command-set protocol.
* **Unlocking Full Functionality**: Access to instrument parameters, calibration routines, data acquisition, and other advanced features managed by the software relies on the instrument operating under the Maselli protocol.
* **Standardized Interaction**: By forcing all instruments into a common, feature-rich protocol, the software can interact with diverse instrument types in a standardized manner once the initial protocol switch is successful.
In essence, the "Super Command" mechanism is a foundational step in the communication process, acting as a software-initiated handshake to ensure the instrument is in the correct operational mode for detailed and comprehensive interaction. Without this active forcing mechanism, communication with instruments that default to or are stuck in other protocol modes would be severely limited or impossible.

View File

@ -0,0 +1,7 @@
***
Password: 20 - Level 3
Utility - [MAU_V_2_9_6.msi](file:///D:%5CInstalad%5CMaselli%20-%20Utility%5CMAU_V_2_9_6.msi)

View File

@ -0,0 +1,48 @@
# Maselli Proprietary Serial/Socket Protocol
This document describes the proprietary communication protocol used by Maselli instruments, as implemented in the provided C# software, primarily within the `Uc09_Utility.ClassSerialeStrumenti` and related classes. The protocol is used for both direct serial communication and when bridged over TCP/IP sockets.
## 1. Core Principles
* **Master-Slave:** The software acts as the master, sending commands to instrument slaves.
* **Addressed Communication:** Each instrument on a communication line is assigned an address.
* **Function-Oriented:** Commands target specific functions or parameters within the instrument using numeric codes (Function Numbers).
* **Text-Based:** The primary protocol commands and responses are text-based strings.
* **Checksum Protected:** Commands include a checksum for integrity validation.
* **Bridged over TCP/IP:** The same serial protocol strings can be encapsulated and transmitted over TCP/IP when the Ethernet bridge functionality is enabled.
## 2. Command Structure
The general structure of a command sent from the master (software) to the instrument (slave) is:
`>` + `LLLL` + `AA` + ` ` + `T` + `;` + `FFF` + `VALUE` + `;` + `cc` + `\r`
Where:
* `>`: Start of command character.
* `LLLL`: Four-digit hexadecimal representation of the **total length of the command string**, starting from `AA` up to and including the checksum `cc`. Padded with leading zeros if necessary (e.g., "001A").
* `AA`: Two-digit hexadecimal instrument address. Padded with a leading zero if necessary (e.g., "01", "0A").
* ` `: A space character.
* `T`: Command Type (a single character). See section "Command Types" below.
* `;`: Semicolon delimiter.
* `FFF`: Three-digit decimal function number (parameter ID). Padded with leading zeros (e.g., "001", "023", "100").
* `VALUE`: The value associated with the command, if applicable. Its format depends on the command type and function.
* For read commands (`V`), this part might be absent or ignored by the instrument.
* For modify commands (`M`), this contains the data to be written.
* `;`: Semicolon delimiter.
* `cc`: Two-character hexadecimal checksum. Calculated on the string portion from `AA` up to (but not including) the preceding semicolon. See section "Checksum Calculation".
* `\r`: Carriage return (ASCII 13), command terminator.
**Example Command Preparation (from `ClassSerialeStrumenti.PreparaComando`)**:
```csharp
// Simplified logic
string comando = string.Format("{0} {1};{2:000}{3}",
addressHex, // AA
tipoComando, // T
numeroFunzione, // FFF
valoreComando // VALUE
);
string lunghezza = string.Format("{0:X4}", comando.Length + 3); // LLLL (+3 for ";cc")
string checksum = CalcolaChecksum(comando); // cc
string finalCommand = string.Format(">{0}{1};{2}\r", lunghezza, comando, checksum);

View File

@ -0,0 +1,439 @@
# Software Documentation
This document outlines the functionalities, protocols, and services of the provided software components, based on the C# source code.
## Namespaces and Classes
### 1. `ClasseSQL`
This namespace is responsible for interactions with a SQL database.
* **`ClassSQL` (internal)**
* **Functionalities:**
* Provides static methods to manage a SQL database connection.
* `SetConnectionString(string Stringa)`: Sets the main part of the SQL connection string.
* `SetInitialCatalog(string Stringa)`: Sets the initial catalog (database name) for the SQL connection.
* `SendComandoSQL(string SQLCommand)`: Executes a given SQL command string and returns the results as a `DataTable`. It handles opening and closing the SQL connection.
* **Protocols:**
* Uses **System.Data.SqlClient**, indicating interaction with Microsoft SQL Server.
* **Services:**
* Provides a basic SQL database querying service.
* **`ComandoSQL` (internal, implements `IDisposable`)**
* **Functionalities:**
* Represents a SQL command to be executed.
* Constructor `ComandoSQL(string StringaConnessione, string StringaComando)`: Initializes a new SQL command with a connection string and the command text.
* `AddParameter(string IDParametro, object Valore)`: Adds parameters to the SQL command to prevent SQL injection and handle various data types.
* `Send()`: Executes the SQL command (presumably a SELECT query) and fills a `DataTable` with the results. It manages connection opening/closing and basic error handling.
* `Error` (property): Boolean indicating if an error occurred during the command execution.
* `TableReturned` (property): Returns the `DataTable` containing the query results.
* `ErrorString` (property): Provides the error message if an error occurred.
* Implements `IDisposable` to release resources like `SqlConnection`, `SqlCommand`, and `DataTable`.
* **Protocols:**
* Uses **System.Data.SqlClient** for SQL Server communication.
* **Services:**
* Offers a more structured way to execute parameterized SQL queries and retrieve data.
### 2. `MaselliPanel`
This namespace appears to be related to panel management, possibly for a user interface, but also includes a global error handling class.
* **`ErrGlobale` (public)**
* **Functionalities:**
* A simple class to store global error messages.
* Contains `Messaggio` (message string) and `Visualizzato` (boolean flag, likely for UI purposes to track if an error has been displayed).
* **Services:**
* Basic global error information holder.
* **`Pannelli` (public)**
* **Functionalities:**
* Defines a large number of constants (`NUM_PANNELLO_*`), likely representing unique identifiers for different UI panels or sections within the application. These constants seem to be related to various instruments and their functionalities (CO2, Ossigeno, URXX, UC08, UV, US, etc.) and specific operations (Setup, Calibration, Linearization, Parameters, Data Acquisition).
* Static fields `NumeroPannello` and `NumeroPannelloBack` to track the current and previous panel, respectively. This suggests a navigation system.
* **Services:**
* Provides a centralized definition and tracking mechanism for UI panel navigation.
### 3. `MaselliScreen`
This namespace contains classes primarily for UI management, screen drawing, and custom UI elements. While the user is not interested in graphical aspects, the functionalities provided by these classes are noted.
* **`ClassScreen` (public)**
* **Functionalities:** (Ignoring graphical details)
* `SetRisoluzioneApp(int RisoluzioneX, int RisoluzioneY)`: Sets the application's screen resolution.
* `LoadImmagineDaFile(...)`: Methods to load images for UI elements.
* **Services:**
* Basic UI helper functions.
* **`MaselliColours` (internal)**
* **Functionalities:** Defines static color properties for UI elements. (Details ignored as per user request).
* **`MaselliInputBox` (public)**
* **Functionalities:**
* Provides static methods `Show(...)` to display a custom input dialog to the user.
* Can be configured to show a password input field.
* **Services:**
* Custom user input dialog service.
* **`MaselliMessageBox` (public)**
* **Functionalities:**
* Provides static methods `Show(...)` to display custom message boxes with different buttons (OK, OKCancel, YesNo) and icons (Information, Warning, Question, Error).
* **Services:**
* Custom message display service.
* **`MaselliSaveAs` (public, implements `IDisposable`)**
* **Functionalities:**
* A custom "Save As" dialog implementation.
* `ShowDialog()`: Displays the dialog.
* Allows navigation through drives and directories.
* **Services:**
* Custom file saving dialog service.
### 4. `MaselliSerial`
This namespace deals with serial communication commands.
* **`ComandoSeriale` (public)**
* **Functionalities:**
* Represents a serial command to be sent to an instrument.
* Properties include:
* `StringaComando`: The actual command string.
* `TipoComando`: Type of command (e.g., "M" for modify, "V" for read variable, "P"/"I"/"i"/"X" for image requests).
* `Indirizzo`: Instrument address.
* `NumeroFunzione`: Function number/code.
* `ValoreComando`: Value associated with the command.
* `FormatoValore`: Format of the value.
* `Stato`: Status of the command (e.g., PENDING, OK_COMMAND).
* `NumeroRipetizioni`: Number of times the command has been retried.
* `Timeout`: Timeout for the command.
* `Terminatore`: Terminator byte for the command response.
* `Linea`: Communication line number.
* **Protocols:**
* Implies a custom serial communication protocol where commands have specific types, addresses, and function codes.
* **Services:**
* Data structure for serial commands.
* **`StatiComando` (internal)**
* **Functionalities:**
* Defines constants for the different states a serial command can be in (e.g., `EMPTY`, `PENDING`, `WAIT_TX`, `WAIT_RX`, `OK_COMMAND`, `ERROR_COMMAND`).
* **Services:**
* Provides status definitions for serial command processing.
### 5. `MaselliSocket`
This namespace handles network communication via sockets.
* **`ClassMaselliSocket` (internal)**
* **Functionalities:**
* Manages a TCP/IP socket connection.
* Constructor initializes a socket for `AddressFamily.InterNetwork`, `SocketType.Stream`, `ProtocolType.Tcp`.
* `Connect(string host, int port)`: Connects to a specified host and port.
* `Disconnect()`: Disconnects the socket.
* `Close()`: Closes the socket and stops an internal timer.
* `Send(byte[] message)` / `Send(string message)`: Sends data over the socket.
* Handles receiving data asynchronously using a timer (`timerSocket`) and processing it.
* `FlagResponse` / `FlagResponseImage`: Flags indicating if a text response or image data has been received.
* `RxBuffer` / `RxBufferBytes`: Buffers for received text and byte data.
* Internal state management for socket phases (e.g., `OPEN`, `READ`, `RECONNECT`).
* Appears to be used in conjunction with `ClassSerialeStrumenti` when `EnableEthernetBridge` is active, suggesting it acts as a bridge for serial commands over TCP/IP.
* **Protocols:**
* **TCP/IP Sockets**: Explicitly uses `System.Net.Sockets.Socket` with `ProtocolType.Tcp`.
* **Services:**
* Provides TCP/IP client communication services, potentially for bridging serial communication over a network.
### 6. `MaselliVariables`
This namespace defines classes for handling variables, likely from instruments.
* **`ClassVariabile` (public)**
* **Functionalities:**
* Represents a variable, likely a parameter or measurement from an instrument.
* Properties include:
* `Scritta`, `ScrittaPerStampa`: Display names for the variable.
* `NumeroStrumento`, `NomeStrumento`: Identifiers for the instrument the variable belongs to.
* `Valore`: The current value of the variable.
* `Presenza`: Indicates if the variable is present/active.
* `Formato`: String format for displaying the value.
* `ListaValori`: A list of `ItemValore` for variables that have predefined sets of values (e.g., enums).
* `UnitaMisura`: Unit of measurement.
* `LimiteLow`, `LimiteHigh`: Low and high limits for the variable's value.
* `NumeroFunzione`, `NumeroFunzioneUniAna`: Function numbers, likely for communication protocols.
* `ValueConversion`: A delegate for custom value conversions (e.g., temperature scales).
* Methods:
* `ValoreToSQL()`: Formats the variable's value for SQL insertion.
* `ValoreFormattato()`: Formats the variable's value for display, handling units and lists.
* `ToDouble()`, `ToFloat()`, `ToInteger()`, `ToShort()`: Converts the variable's value to different numeric types, applying conversions if necessary.
* `Modifica()`: A method that likely opens a UI dialog (`Clas_dynamic.SuperInputBox` or `FrmSceltaVar`) to allow the user to modify the variable's value, performing validation against limits.
* **Protocols:**
* Interaction with UI elements (`Clas_dynamic.SuperInputBox`, `FrmSceltaVar`) for modification.
* Formatting for SQL suggests interaction with database services.
* **Services:**
* Manages instrument variables, including their values, display formats, units, limits, and modification logic.
* **`ItemValore` (public)**
* **Functionalities:**
* A simple class to hold a value (`Valore`) and its corresponding display text (`Scritta`). Used for variables that represent a selection from a list (e.g., an enum).
* **Services:**
* Represents a single item in a list of possible values for a `ClassVariabile`.
### 7. `RicetteMaselli`
This namespace seems to handle "recipes," which are likely sets of parameters to be sent to an instrument.
* **`ClassRicetta` (public)**
* **Functionalities:**
* Represents a recipe.
* `Invia`: Boolean flag to indicate if the recipe should be sent.
* `Address`: Target instrument address for the recipe.
* `Parametri`: A list of `ElementoRicetta` objects, forming the recipe's content.
* **Services:**
* Container for instrument recipes.
* **`ElementoRicetta` (public)**
* **Functionalities:**
* Represents a single parameter within a `ClassRicetta`.
* `NumeroFunzione`: Function number of the parameter.
* `Valore`: Value of the parameter.
* `Formato`: Format of the parameter's value.
* **Services:**
* Data structure for individual recipe parameters.
### 8. `StrumentiMaselli`
This is a core namespace defining the structure and behavior of various Maselli instruments.
* **`ClassCertificazione` (public)**
* **Functionalities:**
* Holds data related to instrument certification/calibration.
* Properties for serial number, memory name function numbers, measured value, certified value, accuracy, tolerance, technician, batch info, etc.
* **Services:**
* Manages certification data for an instrument.
* **`ClassResettable` (public)**
* **Functionalities:**
* Defines constants `NO` (0) and `YES` (1), likely for boolean-like flags.
* **`ClassStrumentoMaselli` (public, abstract)**
* **Functionalities:**
* Abstract base class for all Maselli instruments.
* `Presenza`: Boolean indicating if the instrument is detected.
* `NumeroLinea`: Communication line number.
* `Serial`: An `InstrumentSerial` object managing serial communication details.
* `Identification`: An `Identifier` object for instrument type and name.
* `Inizializzato`: Flag indicating if the instrument has been initialized.
* Various `NumFun*` properties (e.g., `NumFunMemoryName`, `NumFunSerialNumber`): Store function numbers for specific instrument operations, crucial for the Maselli communication protocol.
* `ForzaProtocolloADAM`, `ForzaProtocolloPROFIBUS`: Flags to force specific communication protocols.
* `RicettaDaInviare`: A `ClassRicetta` object for sending recipes to the instrument.
* `SuperComandi`, `ComandiAvvio`, `ComandiUscita`: Lists of `ComandiDaInviare` for various stages of instrument interaction.
* `TabellaCorrispondenzaUniAna`: Array mapping universal/analog function numbers to specific instrument function numbers.
* `ListaDataAcquisition`: Dictionary for data acquisition configuration.
* `DatiSQL`: Holds data to be saved to a SQL database for the instrument.
* `Certificazione`: `ClassCertificazione` object.
* `ModalitaMaselli`: Boolean indicating if the instrument is in "Maselli" communication mode (likely a proprietary protocol).
* Abstract methods (e.g., `InizializzaListaVariabili`, `RecognizeEquipment`, `AddStartupCommands`) to be implemented by derived instrument classes.
* `InitAfterRecognize()`: Method to perform initialization steps after an instrument is recognized.
* `AssegnaTabellaCorrispondenzaUniAna()`: Populates the function number mapping table.
* **Protocols:**
* Defines the framework for interacting with instruments using function numbers, addresses, and specific command sequences (Maselli proprietary protocol).
* Implies support for ADAM and PROFIBUS protocols.
* **Services:**
* Base framework for instrument communication, identification, parameter management, and data handling.
* **`ComandiDaInviare` (public)**
* **Functionalities:**
* Represents a command to be sent, containing the command string, function number, and value.
* **Services:**
* Data structure for commands used in `ClassStrumentoMaselli`.
* **`DatiSQL` (public)**
* **Functionalities:**
* Stores data (`OrdineLavoro`, `Matricola`, `Note`, and a list of `ElementoDatabase`) intended for SQL database storage.
* **Services:**
* Data container for instrument-related information to be saved in a database.
* **`ElementoDatabase` (public)**
* **Functionalities:**
* Represents a single data element to be stored in the database, linking a name, a function number (to retrieve its value from `UtilityMaselli.Variabili`), and its string value.
* **Services:**
* Defines a database-bound data item.
* **`Identifier` (public)**
* **Functionalities:**
* Stores identification information for an instrument: `DeviceName`, `RecognizingStrings` (used to identify the instrument model from its response), `EquipmentRecognized` flag, `DeviceType`, `EquipmentType`, and `MemoryYear`.
* **Services:**
* Provides instrument identification capabilities.
* **`Image<T>` (public, generic where `T` : struct)**
* **Functionalities:**
* A generic class to store image data (e.g., CCD or pressure sensor readings).
* `Data`: Array of type `T` to hold the image pixels/data points.
* `Request`: The command string used to request this image.
* `IsNewData`: Flag indicating if new image data is available.
* **Services:**
* Generic image data container.
* **`InstrumentSerial` (public)**
* **Functionalities:**
* Holds serial communication parameters and state for an instrument.
* Properties like `Protocol`, `Indirizzo` (address), `FaseComunicazione` (communication phase), timeouts, and flags for image requests or special command handling.
* **Services:**
* Manages serial communication state for an instrument.
* **`StrumentoWithCCDImage` (public, abstract, inherits `StrumentoWithImage<ushort>`)**
* **Functionalities:**
* Abstract class for instruments that use a CCD image sensor. Inherits from `StrumentoWithImage` specialized with `ushort` for image data.
* **Services:**
* Base class for CCD-based instruments.
* **`StrumentoWithImage<TImage>` (public, abstract, inherits `ClassStrumentoMaselli`)**
* **Functionalities:**
* Abstract generic class for instruments that produce image data.
* `Immagine`: An `Image<TImage>` object to store the instrument's image data.
* **Services:**
* Generic base class for image-producing instruments.
* **`StrumentoWithPressureImage` (public, abstract, inherits `StrumentoWithImage<double>`)**
* **Functionalities:**
* Abstract class for instruments that produce pressure image/profile data. Inherits from `StrumentoWithImage` specialized with `double`.
* **Services:**
* Base class for pressure-profile instruments.
### 9. `Uc09_Utility`
This namespace provides various utility classes and global static members used throughout the application.
* **`BaudRate_UC` (public)**
* **Functionalities:** Defines constants for standard baud rates.
* **`BITCW` (public, enum : ushort, Flags)**
* **Functionalities:** Defines bit flags, likely for a control word or status register.
* **`BitcwState` (public, Form)**
* **Functionalities:** (UI class, details ignored as per request, but functional aspect noted)
* Displays the state of individual bits within a BITCW (control word) variable.
* **Services:**
* UI for visualizing BITCW states.
* **`BITCW_UR` (public)**
* **Functionalities:** Defines constants representing specific alarm or status bits for "UR" type instruments (e.g., `LOW_BRIX`, `MEMORY_FAIL`).
* **`CCDPoint` (public, struct)**
* **Functionalities:** A simple struct to store X and Y coordinates, likely for CCD image data points.
* **`ClassDataAcquisition` (public, implements `IDisposable`)**
* **Functionalities:**
* Manages data acquisition to a file.
* `Enable(short time, string path)`: Starts data acquisition, writing data to the specified `path` at intervals defined by `time`.
* `Disable()`: Stops data acquisition.
* Uses a timer to periodically write formatted data (including date, time, and values from `UtilityMaselli.StrumentoAcquisizioneDati.ListaDataAcquisition`) to the log file.
* **Services:**
* Provides a service for logging instrument data to a file over time.
* **`ClassDatabaseSQL` (public, implements `IDisposable`)**
* **Functionalities:**
* Handles more complex database interactions, specifically for saving instrument calibration data and parameters to different tables (`UC07Calib`, `Sonico`, `Ossigeno`, `DsLottoModello`) based on instrument type.
* `CreaListaPerDatabase(ClassStrumentoMaselli StrumentoDaSalvare)`: Prepares and sends data for a given instrument to the appropriate SQL table. It iterates through `StrumentoDaSalvare.DatiSQL.ListaElementiDatabase` and formats values for SQL insertion.
* `SalvaPontremoliDb(...)`: Asynchronously saves/updates data to a table named `DsLottoModello`, likely for a specific production/testing environment ("Pontremoli"). This method is more complex, handling different update queries based on whether an image is being saved or parameters. It also appears to dynamically add user scale parameters if a certain condition is met.
* `cerca_identificativo_utente()`: Queries an `Utente` table to find a user ID based on `utente_utility`.
* Uses `OleDbConnection` and `OleDbCommand`, suggesting it might connect to databases via OLEDB providers (which could include SQL Server or others like Access). The connection string `Provider=SQLOLEDB` points to SQL Server.
* **Protocols:**
* **OLEDB** for database communication, specifically with a SQL Server provider (`SQLOLEDB`).
* **Services:**
* Advanced database service for logging specific instrument data and production/testing records.
* **`ClasseOSK` (internal)**
* **Functionalities:**
* Manages the On-Screen Keyboard (OSK).
* `Attiva()`: Starts the `osk.exe` process.
* `Disattiva()`: Kills the `osk.exe` process.
* Handles Wow64 file system redirection for 64-bit OS.
* **Services:**
* Provides control over the Windows On-Screen Keyboard.
* **`ClassFormControlsEnanche` (internal)**
* **Functionalities:** (UI helper, functional aspect noted)
* Enhances form controls by managing their actions (e.g., modify variable, change panel) and enabling/disabling them based on communication state or variable presence.
* `AddControl(...)`: Adds controls to its internal management list with specified actions and associated function numbers.
* `VisualizeValuesInLabels()`: Updates text of managed labels with formatted variable values.
* `EnableControls()`: Enables/disables controls based on the instrument's communication phase and variable presence.
* **Services:**
* Advanced UI control management and data binding helper.
* **`ClassInizializzazioni` (internal)**
* **Functionalities:**
* `InizializzaVariabili()`: Initializes the global `UtilityMaselli.Variabili` list with default `ClassVariabile` objects.
* `InizializzaStrumenti()`: Initializes instances of various instrument classes (`ClassStrumentoUCXX`, `ClassStrumentoUG`, etc.) based on `UtilityMaselli.Setup` settings. It configures their addresses, device names, recognizing strings, menu numbers, and essential function numbers.
* **Services:**
* Provides application startup initialization for variables and instruments.
* **`ClassSerialeStrumenti` (public, implements `IDisposable`)**
* **Functionalities:**
* The core class for managing serial (and bridged socket) communication with Maselli instruments.
* `AddStrumento(ClassStrumentoMaselli strumento)`: Adds an instrument to its management list.
* `InserisciComandoSeriale(...)`: Adds a serial command to a concurrent queue (`QueueComandiSeriali`) for processing.
* `PreparaComando(...)`: Formats a command string according to the Maselli protocol (e.g., `>LLLLAA T;FFFVALUE;cc\r`). This includes calculating length and checksum.
* `CalcolaChecksum(...)`: Calculates the checksum for a command string.
* Manages communication phases for each instrument (`FaseComunicazione` in `InstrumentSerial`). Phases include recognizing, sending super commands, linked, closing, etc.
* Handles sending commands from the queue and processing received responses.
* `GestioneComandoRicevuto(...)`: Parses responses, checks for errors (NO02-NO07), and decodes data or images.
* `DecodificaRisposta(...)`, `DecoderProtocolloMaselli(...)`: Decodes Maselli protocol responses, updates `ClassVariabile` objects in `UtilityMaselli.Variabili`.
* `DecodificaImmagine(...)`: Decodes image data from responses.
* Manages serial port (`System.IO.Ports.SerialPort`) or socket (`ClassMaselliSocket`) communication based on `UtilityMaselli.Setup.EnableEthernetBridge`.
* Uses a timer (`_timerSerialeUtility`) to drive its state machine and command processing loop.
* Handles instrument recognition by comparing received memory names with `RecognizingStrings` in the instrument's `Identifier`.
* Invokes events for various stages like `ReceiveCallback`, `ModifiedReceived`, `FirstRequestCallback`, `ProtocolChangedToMaselli`.
* **Protocols:**
* **Maselli Serial Protocol**: Implements the logic for constructing, sending, and parsing commands based on a proprietary Maselli protocol that uses addresses, function numbers, types (V, M, P, I, X, k), length fields, and checksums. The structure `>LLLLAA T;FFFVALUE;cc\r` is characteristic of this.
* **System.IO.Ports.SerialPort** for direct serial communication.
* **TCP/IP Sockets** (via `ClassMaselliSocket`) for Ethernet-bridged serial communication.
* **Services:**
* Central communication hub for all connected Maselli instruments, managing command queues, protocol encoding/decoding, and instrument state.
* **`ClassSetup` (public)**
* **Functionalities:**
* Manages application settings, loading them from a file (`FilePath`) and saving them back.
* Settings include COM port, baud rate, instrument addresses, UI preferences (virtual keyboard, resolution), data acquisition parameters, and flags for enabling specific instruments or communication modes (Ethernet bridge, ADAM/Profibus protocol switching).
* **Services:**
* Application configuration management.
* **Instrument-specific classes (`ClassStrumentoUCXX`, `ClassStrumentoUG`, `ClassStrumentoURXX`, `ClassStrumentoUSXX`, `ClassStrumentoUVXX`)**: These inherit from `ClassStrumentoMaselli` or its derivatives.
* **Functionalities:**
* Override abstract methods from the base class to provide instrument-specific initialization for variables, data acquisition lists, print parameter lists, database element lists, startup commands, and value conversions.
* `RecognizeEquipment()`: Often refines equipment type based on the memory name (e.g., UC8 vs. UC07).
* `InizializzaListaVariabili()`: Defines specific `ClassVariabile` objects with their function numbers, formats, limits, and units for that instrument type.
* `InitializeValueConversion()`: Assigns specific conversion delegates (e.g., for temperature, CO2, pressure) to relevant variables.
* `AddStartupCommands()`: Adds specific "super commands" or initial commands to be sent to the instrument upon connection or recognition.
* **Services:**
* Implement the specific logic and parameter definitions for each type of Maselli instrument.
* **`UtilityMaselli` (internal, static)**
* **Functionalities:**
* Acts as a global static container for application-wide objects and settings.
* Holds references to:
* `Setup`: The application settings.
* `Variabili`: The global list of all `ClassVariabile` objects.
* Instances of each instrument type (e.g., `StrumentoUC`, `StrumentoUR`).
* `SerialeStrumenti`: The main serial communication object.
* `CurrentDevice`, `StrumentoAcquisizioneDati`, `StrumentoStampa`, `StrumentoCertificazione`: References to the currently active/focused instrument for different operations.
* Paths for icons, executable, service files, images.
* `DataBaseSQLMaselli`: The database interaction object.
* **Services:**
* Global access point for shared application resources and state.
* **`ControlAction`, `ControlsEnabling`, `DefinitionItems`, `Definitions`, `FasiSerialeUtility`, `FasiStrumento`, `StatiComunicazione`, `StatiSeriale`**: These classes define constants used throughout the application for managing states, actions, and types.
### General Protocols & Services Summary
* **Protocols:**
* **Maselli Proprietary Serial/Socket Protocol:** The core communication method with instruments, characterized by commands like `>LLLLAA T;FFFVALUE;cc\r`, function numbers, addresses, and checksums. Managed by `ClassSerialeStrumenti`.
* **SQL Database Protocol:** Interaction with SQL Server using `System.Data.SqlClient` (in `ClasseSQL`) and `OleDbConnection` with `SQLOLEDB` provider (in `ClassDatabaseSQL`).
* **TCP/IP:** Used by `ClassMaselliSocket` for network communication, likely as a bridge for the Maselli serial protocol.
* **ADAM/PROFIBUS:** Mentioned as protocols that can be forced for instruments, suggesting the system can switch instruments to these standard industrial protocols.
* **Services:**
* **Instrument Communication Service:** `ClassSerialeStrumenti` provides the central service for communicating with all instruments, handling command queuing, sending, receiving, and basic decoding.
* **Database Interaction Service:** `ClasseSQL` and `ClassDatabaseSQL` offer services to query and store data in a SQL database. This includes instrument parameters, calibration data, and potentially production/testing records.
* **Variable Management Service:** `MaselliVariables.ClassVariabile` and `UtilityMaselli.Variabili` manage the state, display, and modification of instrument parameters and measurements.
* **Configuration Service:** `ClassSetup` manages loading and saving application and instrument settings.
* **UI Management Services:** Various classes in `MaselliScreen` and `MaselliPanel` (though graphical details are excluded) provide functionalities for UI panel navigation, custom dialogs, and screen adaptation.
* **Data Acquisition Service:** `Uc09_Utility.ClassDataAcquisition` logs instrument data to files over time.
* **Error Handling:** Basic error tracking in `ComandoSQL` and `ErrGlobale`, with more structured logging in `CommunicationHandlerLoggerService` (used by `ClassSerialeStrumenti`).
* **Instrument Abstraction:** `StrumentiMaselli.ClassStrumentoMaselli` and its derived classes provide an abstraction layer for different types of Maselli instruments.

View File

@ -0,0 +1,235 @@
# UI.Library - Sensor Management Library Documentation
## Table of Contents
1. [Overview](https://claude.ai/chat/04749c64-82af-4403-a784-664d5dc353ff#overview)
2. [Architecture](https://claude.ai/chat/04749c64-82af-4403-a784-664d5dc353ff#architecture)
3. [Core Components](https://claude.ai/chat/04749c64-82af-4403-a784-664d5dc353ff#core-components)
- [Constants](https://claude.ai/chat/04749c64-82af-4403-a784-664d5dc353ff#constants)
- [Enumerations](https://claude.ai/chat/04749c64-82af-4403-a784-664d5dc353ff#enumerations)
- [Data Transfer Objects (DTOs)](https://claude.ai/chat/04749c64-82af-4403-a784-664d5dc353ff#data-transfer-objects-dtos)
- [Services](https://claude.ai/chat/04749c64-82af-4403-a784-664d5dc353ff#services)
- [Factory Pattern](https://claude.ai/chat/04749c64-82af-4403-a784-664d5dc353ff#factory-pattern)
4. [Workflow Examples](https://claude.ai/chat/04749c64-82af-4403-a784-664d5dc353ff#workflow-examples)
5. [API Communication](https://claude.ai/chat/04749c64-82af-4403-a784-664d5dc353ff#api-communication)
6. [Error Handling](https://claude.ai/chat/04749c64-82af-4403-a784-664d5dc353ff#error-handling)
7. [Sensor Types and Capabilities](https://claude.ai/chat/04749c64-82af-4403-a784-664d5dc353ff#sensor-types-and-capabilities)
## Overview
UI.Library is a comprehensive C# library designed for managing industrial sensors and their data across various phases of operation. The library provides a structured way to communicate with a central datasheet API, allowing applications to retrieve, create, and update sensor information and calibration data.
The library is particularly focused on handling industrial measurement sensors such as refractometers, density meters, and various control units, with support for different operational phases (primarily Phase 2 and Phase 3, which likely correspond to calibration and final configuration phases).
## Architecture
The library follows a layered architecture:
1. **DTO Layer** - Contains Data Transfer Objects for transferring data between the client and server
2. **Service Layer** - Provides services for interacting with the API
3. **Factory Layer** - Instantiates appropriate service implementations based on sensor type and phase
This architecture enables a clean separation of concerns and makes the library extensible for additional sensor types.
## Core Components
### Constants
The library defines constants for API communication:
```csharp
public class Constants
{
public const string DATASHEET_API_ADDRESS = "http://10.0.0.122/";
}
```
This address serves as the base URL for all API communications.
### Enumerations
The `TipiSensore` enumeration defines all supported sensor types:
```csharp
public enum TipiSensore
{
DR20 = 1,
MD01 = 2,
MD09 = 3,
MD12 = 4,
MD15 = 5,
UR20_TETRA = 6,
UR24 = 7,
// ... and many more
}
```
### Data Transfer Objects (DTOs)
The DTO structure is hierarchical, with base classes providing common properties and derived classes adding sensor-specific properties:
#### Base DTOs
- `PhaseBaseRequest` - Base class for all request DTOs
- `PhaseBaseResponse` - Base class for all response DTOs
- `PhaseBaseInsertRequest` - For creating new phase data
- `PhaseBaseUpdateRequest` - For updating existing phase data
#### Phase-Specific DTOs
- Phase2 DTOs: Used for calibration processes
- Phase3 DTOs: Used for final configuration and operational parameters
#### Sensor-Specific DTOs
Each sensor type has its own specialized DTOs that inherit from the base DTOs and add properties specific to that sensor type.
### Services
The library provides two main service interfaces:
#### ISensorService
Responsible for general sensor operations:
```csharp
public interface ISensorService
{
Task<SensorResponse> GetSensorBySerialNumberAsync(string serialNumber, CancellationToken token = default);
Task<int?> GetIdBySerialNumberAsync(string serialNumber, CancellationToken token = default);
Task<SensorResponse> InsertSensorAsync(SensorInsertRequest sensor, CancellationToken token = default);
}
```
#### IPhaseService
Handles phase-specific operations for a particular sensor type:
```csharp
public interface IPhaseService<TInsert, TUpdate, TResponse>
where TInsert : PhaseBaseInsertRequest
where TUpdate : PhaseBaseUpdateRequest
where TResponse : PhaseBaseResponse
{
Task<TResponse> GetLastRepetitionBySensorIdAsync(int sensorId, CancellationToken token = default);
Task<bool> InsertAsync(TInsert entity, CancellationToken token = default);
Task<bool> UpdateAsync(TUpdate entity, CancellationToken token = default);
}
```
### Factory Pattern
The `SensorServiceFactory` implements a factory pattern to create appropriate service instances:
```csharp
public static class SensorServiceFactory
{
public static IPhaseService<TInsert, TUpdate, TResponse> GetPhase2Service<TInsert, TUpdate, TResponse>()
where TInsert : PhaseBaseInsertRequest
where TUpdate : PhaseBaseUpdateRequest
where TResponse : PhaseBaseResponse
{
// Implementation determines which service to return based on generic types
}
public static IPhaseService<TInsert, TUpdate, TResponse> GetPhase3Service<TInsert, TUpdate, TResponse>()
where TInsert : PhaseBaseInsertRequest
where TUpdate : PhaseBaseUpdateRequest
where TResponse : PhaseBaseResponse
{
// Implementation determines which service to return based on generic types
}
}
```
## Workflow Examples
### Retrieving Sensor Information
```csharp
// Create a sensor service instance
ISensorService sensorService = new SensorService();
// Get a sensor by its serial number
SensorResponse sensor = await sensorService.GetSensorBySerialNumberAsync("ABC123456");
// Check if the sensor exists
if (sensor != null)
{
// Process sensor information
Console.WriteLine($"Sensor ID: {sensor.Id}");
Console.WriteLine($"Sensor Type: {sensor.TipoId}");
}
```
### Working with Phase Data
```csharp
// Get the appropriate Phase 2 service for a UR20 sensor
var phase2Service = SensorServiceFactory.GetPhase2Service<Phase2UR20InsertRequest, Phase2UR20UpdateRequest, Phase2UR20Response>();
// Get the last Phase 2 data for a sensor
var phase2Data = await phase2Service.GetLastRepetitionBySensorIdAsync(1001);
// Create new Phase 2 data
var newPhase2Data = new Phase2UR20InsertRequest
{
StrumentoId = 1001,
Operatore = "John Doe",
// Set other properties as needed
};
// Insert the new Phase 2 data
bool success = await phase2Service.InsertAsync(newPhase2Data);
```
## API Communication
The library uses HTTP for all API communications:
- **GET** requests for retrieving information
- **POST** requests for creating new data
- **PUT** requests for updating existing data
All communications use JSON for data serialization/deserialization.
Example API endpoint construction:
```csharp
string url = DatasheetApiEndpoints.GetDatasheetEndpointBySensorType(TipiSensore.UR20) + "/phases2/insert";
// Results in: "api/ur20s/phases2/insert"
```
## Error Handling
The library implements error handling through exceptions:
- HTTP errors are propagated as `InvalidOperationException` with the response content as the message
- Input validation is performed before sending requests (e.g., checking for required properties)
- `404 Not Found` responses are handled specially and return `null` instead of throwing an exception
## Sensor Types and Capabilities
The library supports various sensor types, each with specific capabilities:
### Refractometer Sensors (UR Series)
- Measure refractive index and Brix (sugar content)
- Support temperature compensation
- Can include prism temperature control
### Density Meters (DR Series)
- Measure density of liquids
- Support for multiple CCD sensors
### CO2 Sensors (UC Series)
- Measure CO2 concentration
- Support pressure and temperature compensation
Each sensor type has specific calibration parameters and operational settings that can be configured through the library.
---
This documentation provides an overview of the UI.Library functionality. For specific details about individual classes and methods, refer to the inline XML documentation in the source code.

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

@ -0,0 +1,6 @@
[My Endress+Hauser \| Endress+Hauser](https://www.us.endress.com/en/shop?t.tabId=product-configure&nebp.language=en&nebp.cartToken=ac2cba61-98e0-4394-9a3a-1bd75a61b3bd#Cart:)
![[Pasted image 20250508205329.png]]
![[Pasted image 20250508205345.png]]

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -0,0 +1,161 @@
# Essential Git Commands for Common Problems
This guide covers basic Git commands to help you handle common challenges like merge conflicts, overwriting changes, and navigating commit history.
## Basic Commands
```bash
# Check status of your repository
git status
# Check commit history
git log
git log --oneline --graph --decorate # More visual representation
# View changes before committing
git diff
git diff --staged # View staged changes
```
## Handling Merge Conflicts
When your branch falls behind and you encounter conflicts:
```bash
# Update your local repository with remote changes
git fetch origin
# Merge changes from origin/main to your current branch
git merge origin/main
# If conflicts occur, Git will tell you which files are in conflict
# Edit the files manually to resolve conflicts, then:
git add <conflicted-files>
git commit -m "Resolve merge conflicts"
# Alternative: abort the merge if needed
git merge --abort
```
## Force Your Version as the Latest
When you want your version to override others:
```bash
# Force push your changes (use with caution!)
git push --force origin <branch-name>
# A safer alternative: force-with-lease checks if remote has new changes
git push --force-with-lease origin <branch-name>
# Overwrite local changes with remote changes
git reset --hard origin/<branch-name>
# Overwrite a single file with the version from another branch
git checkout <branch-name> -- <file-path>
```
## Going Back to a Specific Commit
```bash
# Move back to a specific commit without changing files (detached HEAD)
git checkout <commit-hash>
# Reset your branch to a specific commit (will lose later commits)
git reset --hard <commit-hash>
# Create a new commit that undoes changes from a previous commit
git revert <commit-hash>
```
## Branch Management
```bash
# Create and switch to a new branch
git checkout -b <new-branch-name>
# Switch to an existing branch
git checkout <branch-name>
# List all branches
git branch # Local branches
git branch -r # Remote branches
git branch -a # All branches
# Delete a branch
git branch -d <branch-name> # Safe delete (prevents deleting unmerged changes)
git branch -D <branch-name> # Force delete
```
## Stashing Changes
Useful when you need to switch branches but aren't ready to commit:
```bash
# Save changes to the stash
git stash save "Your stash message"
# List stashes
git stash list
# Apply the most recent stash without removing it
git stash apply
# Apply a specific stash
git stash apply stash@{n}
# Apply and remove the most recent stash
git stash pop
# Remove a stash
git stash drop stash@{n}
# Clear all stashes
git stash clear
```
## Fixing Mistakes
```bash
# Amend the last commit message
git commit --amend -m "New commit message"
# Add forgotten files to the last commit
git add <forgotten-files>
git commit --amend --no-edit
# Undo staging of files
git reset <file>
# Discard changes in working directory
git checkout -- <file>
git restore <file> # In newer Git versions
```
## Advanced Techniques
```bash
# Interactive rebase to edit, squash, or reorder commits
git rebase -i HEAD~n # Where n is the number of commits to go back
# Cherry-pick specific commits from another branch
git cherry-pick <commit-hash>
# Cleanup unnecessary files
git clean -n # Dry run - shows what would be deleted
git clean -f # Actually delete the files
# Temporarily save changes from a dirty working directory
git worktree add <path> <branch>
```
## Safety Tips
1. **Always create backups** before performing destructive operations
2. **Use `--dry-run`** when available to preview command effects
3. **Avoid force push** on shared branches (especially main/master)
4. Set up **aliases** for complex commands you use frequently
5. Configure Git to **require confirmation** for potentially harmful actions
Remember that Git preserves history in the `.git` directory, so most "destructive" commands can be undone, but it's better to be cautious.

View File

@ -0,0 +1,193 @@
## Technical Documentation: Parsing TIA Portal `_XRef.xml` Files for Call Tree Generation
**Version:** 1.0 **Date:** 2025-05-05
### 1. Introduction
This document describes the structure and interpretation of the XML files (`*_XRef.xml`) generated by the TIA Portal Openness `export_cross_references` function (available via libraries like `siemens_tia_scripting`). The primary goal is to enable software developers to programmatically parse these files to extract block call relationships and build a comprehensive call tree for a PLC program.
The `_XRef.xml` file contains detailed information about all objects referenced _by_ a specific source object (e.g., an OB, FB, or FC). By processing these files for all relevant blocks, a complete picture of the program's call structure can be assembled.
### 2. File Format Overview
The `_XRef.xml` file is a standard XML document. Its high-level structure typically looks like this:
XML
```xml
<?xml version="1.0" encoding="utf-8"?>
<CrossReferences xmlns:i="..." xmlns="...">
<Sources>
<SourceObject> <Name>...</Name>
<Address>...</Address>
<Device>...</Device>
<Path>...</Path>
<TypeName>...</TypeName>
<UnderlyingObject>...</UnderlyingObject>
<Children />
<References> <ReferenceObject> <Name>...</Name>
<Address>...</Address>
<Device>...</Device>
<Path>...</Path>
<TypeName>...</TypeName> <UnderlyingObject>...</UnderlyingObject>
<Locations> <Location>
<Access>...</Access> <Address>...</Address>
<Name>...</Name>
<ReferenceLocation>...</ReferenceLocation> <ReferenceType>Uses</ReferenceType>
</Location>
</Locations>
</ReferenceObject>
</References>
</SourceObject>
</Sources>
</CrossReferences>
```
### 3. Key XML Elements for Call Tree Construction
To build a call tree, you need to identify the _caller_ and the _callee_ for each block call. The following XML elements are essential:
1. **`<SourceObject>`:** Represents the block performing the calls (the **caller**).
- **`<Name>`:** The symbolic name of the caller block (e.g., `_CYCL_EXC`).
- **`<Address>`:** The absolute address (e.g., `%OB1`).
- **`<TypeName>`:** The type of the caller block (e.g., `LAD-Organization block`).
2. **`<ReferenceObject>`:** Represents an object being referenced by the `SourceObject`. This _could_ be the **callee**.
- **`<Name>`:** The symbolic name of the referenced object (e.g., `BlenderCtrl__Main`, `Co2_Counters_DB`).
- **`<Address>`:** The absolute address (e.g., `%FC2000`, `%DB1021`).
- **`<TypeName>`:** The type of the referenced object (e.g., `LAD-Function`, `Instance DB of Co2_Counters [FB1020]`). This is vital for identifying FCs and FBs (via their instance DBs).
3. **`<Location>`:** Specifies exactly how and where the `ReferenceObject` is used within the `SourceObject`.
- **`<Access>`:** **This is the most critical element for call trees.** Look for the value `Call`. This indicates a direct Function Call (FC). An access type of `InstanceDB` indicates the usage of an instance DB, which implies a Function Block (FB) call is occurring.
- **`<ReferenceLocation>`:** Provides human-readable context about where the reference occurs within the caller's code (e.g., `@_CYCL_EXC ▶ NW3 (Blender CTRL)`). Useful for debugging or visualization.
### 4. Data Extraction Strategy for Call Tree
A program parsing these files should follow these steps for each `_XRef.xml` file:
1. **Parse XML:** Load the `_XRef.xml` file using a suitable XML parsing library (e.g., Python's `xml.etree.ElementTree` or `lxml`).
2. **Identify Caller:** Navigate to the `<SourceObject>` element and extract its `<Name>`. This is the caller block for all references within this file.
3. **Iterate References:** Loop through each `<ReferenceObject>` within the `<References>` section of the `<SourceObject>`.
4. **Iterate Locations:** For each `<ReferenceObject>`, loop through its `<Location>` elements.
5. **Filter for Calls:** Check the text content of the `<Access>` tag within each `<Location>`.
- **If `Access` is `Call`:**
- The `<Name>` of the current `<ReferenceObject>` is the **callee** (an FC).
- Record the relationship: `Caller Name` -> `Callee Name (FC)`.
- **If `Access` is `InstanceDB`:**
- This signifies an FB call is happening using this instance DB.
- The `<Name>` of the current `<ReferenceObject>` is the Instance DB name (e.g., `Co2_Counters_DB`).
- To find the actual FB being called, examine the `<TypeName>` of this `ReferenceObject`. It usually contains the FB name/number (e.g., `Instance DB of Co2_Counters [FB1020]`). Extract the FB name (`Co2_Counters`) or number (`FB1020`). This is the **callee**.
- Record the relationship: `Caller Name` -> `Callee Name (FB)`.
6. **Store Relationships:** Store the identified caller-callee pairs in a suitable data structure.
### 5. Building the Call Tree Data Structure
After parsing one or more `_XRef.xml` files, the extracted relationships can be stored. Common approaches include:
- **Dictionary (Adjacency List):** A dictionary where keys are caller names and values are lists of callee names.
Python
```python
call_tree = {
'_CYCL_EXC': ['BlenderCtrl__Main', 'MessageScroll', 'ITC_MainRoutine', 'Co2_Counters', 'ProcedureProdBrixRecovery', 'Key Read & Write', 'GNS_PLCdia_MainRoutine'],
'BlenderCtrl__Main': ['SomeOtherBlock', ...],
# ... other callers
}
```
- **Graph Representation:** Using libraries like `networkx` in Python to create a directed graph where blocks are nodes and calls are edges. This allows for more complex analysis (e.g., finding paths, cycles).
- **Custom Objects:** Define `Block` and `Call` classes for a more object-oriented representation.
### 6. Handling Multiple Files
A single `_XRef.xml` file only details the references _from_ one `SourceObject`. To build a complete call tree for the entire program or PLC:
1. **Export References:** Use the Openness script to call `export_cross_references` for _all_ relevant OBs, FBs, and FCs in the project.
2. **Process All Files:** Run the parsing logic described above on each generated `_XRef.xml` file.
3. **Aggregate Results:** Combine the caller-callee relationships extracted from all files into a single data structure (e.g., merge dictionaries or add nodes/edges to the graph).
### 7. Example (Conceptual Python using `xml.etree.ElementTree`)
Python
```python
import xml.etree.ElementTree as ET
import re # For extracting FB name from TypeName
def parse_xref_for_calls(xml_file_path):
"""Parses a _XRef.xml file and extracts call relationships."""
calls = {} # {caller: [callee1, callee2, ...]}
try:
tree = ET.parse(xml_file_path)
root = tree.getroot()
# Namespace handling might be needed depending on the xmlns
ns = {'ns0': 'TestNamespace1'} # Adjust namespace if different in your file
for source_object in root.findall('.//ns0:SourceObject', ns):
caller_name = source_object.findtext('ns0:Name', default='UnknownCaller', namespaces=ns)
if caller_name not in calls:
calls[caller_name] = []
for ref_object in source_object.findall('.//ns0:ReferenceObject', ns):
ref_name = ref_object.findtext('ns0:Name', default='UnknownRef', namespaces=ns)
ref_type_name = ref_object.findtext('ns0:TypeName', default='', namespaces=ns)
for location in ref_object.findall('.//ns0:Location', ns):
access_type = location.findtext('ns0:Access', default='', namespaces=ns)
if access_type == 'Call':
# Direct FC call
if ref_name not in calls[caller_name]:
calls[caller_name].append(ref_name)
elif access_type == 'InstanceDB':
# FB call via Instance DB
# Extract FB name/number from TypeName (e.g., "Instance DB of BlockName [FB123]")
match = re.search(r'Instance DB of (.*?) \[([A-Za-z]+[0-9]+)\]', ref_type_name)
callee_fb_name = 'UnknownFB'
if match:
# Prefer symbolic name if available, else use number
callee_fb_name = match.group(1) if match.group(1) else match.group(2)
elif 'Instance DB of' in ref_type_name: # Fallback if regex fails
callee_fb_name = ref_type_name.split('Instance DB of ')[-1].strip()
if callee_fb_name not in calls[caller_name]:
calls[caller_name].append(callee_fb_name)
except ET.ParseError as e:
print(f"Error parsing XML file {xml_file_path}: {e}")
except FileNotFoundError:
print(f"Error: File not found {xml_file_path}")
# Clean up entries with no calls
calls = {k: v for k, v in calls.items() if v}
return calls
# --- Aggregation Example ---
# all_calls = {}
# for xref_file in list_of_all_xref_files:
# file_calls = parse_xref_for_calls(xref_file)
# for caller, callees in file_calls.items():
# if caller not in all_calls:
# all_calls[caller] = []
# for callee in callees:
# if callee not in all_calls[caller]:
# all_calls[caller].append(callee)
# print(all_calls)
```
_Note: Namespace handling (`ns=...`) in ElementTree might need adjustment based on the exact default namespace declared in your XML files._
### 8. Considerations
- **Function Block Calls:** Remember that FB calls are identified indirectly via the `InstanceDB` access type and parsing the `<TypeName>` of the `ReferenceObject`.
- **System Blocks (SFC/SFB):** Calls to system functions/blocks should appear similarly to FC/FB calls and can be included in the tree. Their `<TypeName>` might indicate they are system blocks.
- **TIA Portal Versions:** While the basic structure is consistent, minor variations in tags or namespaces might exist between different TIA Portal versions. Always test with exports from your specific version.
- **Data References:** This documentation focuses on the call tree. The XML also contains `Read`, `Write`, `RW` access types, which can be parsed similarly to build a full cross-reference map for tags and data blocks.
### 9. Conclusion
The `_XRef.xml` files provide a detailed, machine-readable description of block references within a TIA Portal project. By parsing the XML structure, focusing on the `<SourceObject>`, `<ReferenceObject>`, and specifically the `<Access>` tag within `<Location>`, developers can reliably extract block call information and construct program call trees for analysis, documentation, or visualization purposes. Remember to aggregate data from multiple files for a complete program overview.

View File

@ -0,0 +1,23 @@
***
```python
# --- Configuration ---
TIA_PORTAL_VERSION = "18.0"  # Target TIA Portal version (e.g., "18.0")
CROSS_REF_SUBFOLDER = "cross_ref"  # Subfolder name within working_directory
# Filter for cross-references. Based on documentation:
# 1: 'AllObjects', 2: 'ObjectsWithReferences', 3: 'ObjectsWithoutReferences', 4: 'UnusedObjects'
# Using 1 to export all. 0 might also work as a default in some API versions.
CROSS_REF_FILTER = 1
# --- TIA Scripting Import Handling ---
# (Same import handling as x1.py)
if os.getenv("TIA_SCRIPTING"):
    sys.path.append(os.getenv("TIA_SCRIPTING"))
else:
    pass
try:
    import siemens_tia_scripting as ts
```

View File

@ -0,0 +1,427 @@
#analogIA #sae452 #mixer
# Modulo Elettronico Analogico SIMATIC ET 200S 2AI I 4WIRE ST
Preso dalle schede AI su il SAE452: ==6ES7 134-4GB11-0AB0==
Manuale: [et200s\_2ai\_i\_4wire\_st\_manual\_en-US.pdf](https://cache.industry.siemens.com/dl/files/991/25545991/att_70599/v1/et200s_2ai_i_4wire_st_manual_en-US.pdf)
## Guida alla Configurazione e Programmazione per Misure 4-20 mA
## 1. Range di Misurazione per Corrente: 4-20 mA
La seguente tabella contiene i valori analogici digitalizzati per il range di misurazione del modulo di ingresso analogico. Poiché la rappresentazione binaria dei valori analogici è sempre la stessa, questa tabella confronta i range di misurazione con le unità.
### Tabella 4-3: Formato SIMATIC S7: Range di misurazione 4-20 mA
|Range di misurazione 4-20 mA|Unità| |Range|
|---|---|---|---|
||Decimale|Esadecimale||
|> 22,8142|32767|7FFFH|Overflow|
|22,8142 : 20,0005|32511 : 27649|7EFFH : 6C01H|Range di sovraccarico|
|20,0000 16,0000 : 4,0000|27648 20736 : 0|6C00H 5100H : 0H|Range nominale|
|3,9995 : 1,1852|-1 : -4864|FFFFH : ED00H|Range di sottoccarico|
|< 1,1852|-32768|8000H|Underflow|
| Assegnazione parametri | Valori misurati | | Descrizione |
| -------------------------------------------------------------------------------------------- | --------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| Decimale | Esadecimale | | |
| • Diagnostica "Rottura cavo" abilitata | 32767 | 7FFFH | • Messaggio diagnostico "Circuito aperto" |
| • Diagnostica "Rottura cavo" disabilitata<br>• Diagnostica "Overflow/underflow" abilitata | -32767 | 8000H | • Valore misurato dopo aver lasciato il range di sottoccarico<br>• Messaggio diagnostico "Valore limite inferiore superato verso il basso" |
| • Diagnostica "Rottura cavo" disabilitata<br>• Diagnostica "Overflow/underflow" disabilitata | -32767 | 8000H | • Valore misurato dopo aver lasciato il range di sottoccarico |
## 2. Conversione da Brix a Corrente 4-20 mA
Nel tuo caso specifico, desideri convertire valori Brix dove:
- 60 Brix corrisponde a 20 mA (valore massimo)
- 0 Brix corrisponde a 4 mA (valore minimo)
```
Brix = ((Corrente (mA) - 4) / 16) * 60
```
## 3. Parametri di Diagnostica
### Parametri per il modulo di ingresso analogico 2 AI I 4WIRE ST
| Parametro | Valori |
| --------------------------------------------------------------------- | ------------- |
| Diagnostica di gruppo (errore assegnazione parametri, errore interno) | Abilitato |
| Diagnostica: Overflow/underflow | Abilitato |
| Diagnostica: Rottura cavo* | Abilitato |
| Smoothing (Smorzamento) | Nessuno |
| Tipo/range di misurazione | WIRE: 4-20 mA |
![[Pasted image 20250507112955.png]]
### Spiegazione dei Parametri di Diagnostica:
1. **Diagnostica di gruppo**: Quando abilitata, il modulo segnala errori generali come errori di parametrizzazione o errori interni del modulo. Attiva il LED SF (errore) e genera un messaggio diagnostico.
2. **Diagnostica Overflow/underflow**: Quando abilitata, il modulo genera messaggi diagnostici quando il valore di ingresso supera (overflow) o scende sotto (underflow) i limiti del range di misurazione. Questi sono:
- Overflow: > 22,8142 mA
- Underflow: < 1,1852 mA
3. **Diagnostica Rottura cavo**: Quando abilitata, il modulo rileva una interruzione del circuito se la corrente scende sotto 1,185 mA. Questa opzione è disponibile solo nel range di misurazione 4-20 mA.
## 4. Comportamento del Modulo in Caso di Errore
### Valori misurati in caso di rottura del cavo in relazione alla diagnostica abilitata:
_Limiti del range di misurazione per il rilevamento di rottura del cavo e underflow: A 1,185 mA_
## 5. Programmazione SCL per Gestire i Diversi Stati
Ecco un esempio di come gestire i diversi stati in programmazione SCL per un PLC S7-300:
```pascal
// FB100 - Gestione Misurazione Brix con diagnostica
// Configurazione hardware richiesta:
// - Group diagnostics: Abilitato
// - Diagnostic overflow/underflow: Abilitato
// - Wire break: Abilitato
FUNCTION_BLOCK "FB_MisurazioneBrix"
TITLE = 'Gestione sensore Brix con diagnostica'
AUTHOR : Sysadmin
FAMILY : Process
VAR_INPUT
i_IW_Analog : WORD; // Indirizzo dell'ingresso analogico (PEW)
i_EnableDiagnostic : BOOL := TRUE; // Abilita la lettura dei messaggi diagnostici
i_Reset : BOOL; // Reset allarmi
END_VAR
VAR_OUTPUT
o_ValoreBrix : REAL; // Valore Brix convertito (0-60)
o_CorrienteMa : REAL; // Valore corrente in mA (per diagnostica)
o_StatoSensore : INT; // 0=OK, 1=Overflow, 2=Underflow, 3=Wire Break, 4=Errore ADAM (2mA)
o_QualitaBuona : BOOL; // TRUE se la misura è affidabile
o_DiagInfo : STRING; // Informazioni diagnostiche in formato testo
END_VAR
VAR
// Definizione delle costanti
OVERFLOW_VALUE : INT := 32767; // 7FFFH - Valore di overflow
UNDERFLOW_VALUE : INT := -32768; // 8000H - Valore di underflow
WIRE_BREAK_VALUE : INT := 32767; // 7FFFH - Con diagnostica wire break abilitata
MAX_NORMAL : INT := 27648; // 6C00H - 20mA (valore massimo nel range nominale)
MIN_NORMAL : INT := 0; // 0000H - 4mA (valore minimo nel range nominale)
// Variabili interne
ValoreAnalogicoInt : INT; // Valore analogico convertito in INT
ErroreRilevato : BOOL; // Flag per errore rilevato
TimerRitardo : TON; // Timer per filtrare falsi allarmi
RitardoErrore : TIME := T#2S; // Ritardo di conferma errore (2 secondi)
MemoriaStato : INT; // Memoria dell'ultimo stato valido
// Variabili per la diagnostica di sistema
DiagRequest : BOOL; // Richiesta di lettura diagnostica
DiagBusy : BOOL; // Blocco diagnostica occupato
DiagDone : BOOL; // Lettura diagnostica completata
DiagError : BOOL; // Errore durante la lettura diagnostica
DiagStatus : WORD; // Stato della diagnostica
DiagBuffer : ARRAY[0..31] OF BYTE; // Buffer per i dati diagnostici
// Variabili per rilevazione errore ADAM (circa 2mA)
ADAM_ERROR_LOW : INT := -3600; // Limite inferiore per rilevare errore ADAM (~1.8mA)
ADAM_ERROR_HIGH : INT := -3200; // Limite superiore per rilevare errore ADAM (~2.2mA)
// Dati temporanei
TempBrix : REAL; // Valore Brix temporaneo per calcoli
FirstScan : BOOL := TRUE; // Flag per primo ciclo
END_VAR
VAR_TEMP
TempValue : INT; // Valore temporaneo per calcoli
TempReal : REAL; // Valore temporaneo per calcoli in virgola mobile
StatusTemp : INT; // Stato temporaneo per logica degli stati
END_VAR
BEGIN
// Inizializzazione delle variabili al primo ciclo
IF FirstScan THEN
FirstScan := FALSE;
o_StatoSensore := 0;
o_DiagInfo := 'Inizializzazione sistema';
MemoriaStato := 0;
END_IF;
// Converti il valore WORD in INT per elaborazione
ValoreAnalogicoInt := WORD_TO_INT(i_IW_Analog);
// Logica di stato iniziale - determina lo stato del sensore
StatusTemp := 0; // Stato predefinito: OK
ErroreRilevato := FALSE;
// Verifica delle diverse condizioni di errore
CASE ValoreAnalogicoInt OF
OVERFLOW_VALUE: // 32767 (7FFFH)
// Può indicare overflow o wire break se la diagnostica di rottura cavo è abilitata
IF i_EnableDiagnostic THEN
// Dobbiamo leggere le informazioni diagnostiche per distinguere tra overflow e wire break
DiagRequest := TRUE;
StatusTemp := 1; // Assumiamo inizialmente Overflow
o_DiagInfo := 'Overflow rilevato o Wire Break?';
ELSE
StatusTemp := 1; // Overflow (senza diagnostica non possiamo distinguere)
o_DiagInfo := 'Overflow rilevato';
END_IF;
ErroreRilevato := TRUE;
UNDERFLOW_VALUE: // -32768 (8000H)
StatusTemp := 2; // Underflow
o_DiagInfo := 'Underflow rilevato - Valore troppo basso';
ErroreRilevato := TRUE;
ELSE
// Verifica se il valore è nell'intervallo che indica errore ADAM (circa 2mA)
IF ValoreAnalogicoInt >= ADAM_ERROR_LOW AND ValoreAnalogicoInt <= ADAM_ERROR_HIGH THEN
StatusTemp := 4; // Errore ADAM (2mA)
o_DiagInfo := 'Errore rilevato dal sensore ADAM (2mA) - Problema misuratore Brix';
ErroreRilevato := TRUE;
ELSIF ValoreAnalogicoInt < MIN_NORMAL AND ValoreAnalogicoInt > UNDERFLOW_VALUE THEN
// Siamo in underrange ma non ancora in underflow completo
o_DiagInfo := 'Valore in underrange (< 4mA)';
// Non consideriamo questo necessariamente un errore, solo una nota
ELSIF ValoreAnalogicoInt > MAX_NORMAL AND ValoreAnalogicoInt < OVERFLOW_VALUE THEN
// Siamo in overrange ma non ancora in overflow completo
o_DiagInfo := 'Valore in overrange (> 20mA)';
// Non consideriamo questo necessariamente un errore, solo una nota
ELSE
// Valore nell'intervallo normale
StatusTemp := 0; // OK
o_DiagInfo := 'Misura OK';
END_IF;
END_CASE;
// Filtro temporale per gli errori (evita falsi allarmi)
IF ErroreRilevato THEN
// Avvia il timer se è stato rilevato un errore
TimerRitardo(IN := TRUE, PT := RitardoErrore);
// Imposta lo stato di errore solo se il timer è scaduto
IF TimerRitardo.Q THEN
o_StatoSensore := StatusTemp;
END_IF;
ELSE
// Resetta il timer se non ci sono errori
TimerRitardo(IN := FALSE);
o_StatoSensore := StatusTemp;
END_IF;
// Reset degli allarmi se richiesto
IF i_Reset THEN
o_StatoSensore := 0;
o_DiagInfo := 'Stato resettato dall operatore';
TimerRitardo(IN := FALSE);
END_IF;
// Calcolo del valore in mA indipendentemente dallo stato
// Formula: mA = 4 + (ValoreAnalogicoInt / 27648) * 16
IF ValoreAnalogicoInt <= MAX_NORMAL AND ValoreAnalogicoInt >= UNDERFLOW_VALUE THEN
// Conversione normale per valori validi o in underrange
TempReal := INT_TO_REAL(ValoreAnalogicoInt);
o_CorrienteMa := 4.0 + (TempReal / INT_TO_REAL(MAX_NORMAL)) * 16.0;
// Un valore sotto lo zero corrisponde a meno di 4mA
IF o_CorrienteMa < 0.0 THEN
o_CorrienteMa := 0.0; // Limitato a 0mA minimo (per evitare valori negativi)
END_IF;
ELSIF ValoreAnalogicoInt = OVERFLOW_VALUE THEN
o_CorrienteMa := 22.81; // Valore di overflow
ELSIF ValoreAnalogicoInt = UNDERFLOW_VALUE THEN
o_CorrienteMa := 0.0; // Valore di underflow
END_IF;
// Conversione da corrente a Brix
// Formula: Brix = ((mA - 4) / 16) * 60
IF o_StatoSensore = 0 THEN
// Calcolo normale solo se non ci sono errori
IF o_CorrienteMa >= 4.0 THEN
TempBrix := ((o_CorrienteMa - 4.0) / 16.0) * 60.0;
// Limitazione del valore Brix tra 0 e 60
IF TempBrix < 0.0 THEN
o_ValoreBrix := 0.0;
ELSIF TempBrix > 60.0 THEN
o_ValoreBrix := 60.0;
ELSE
o_ValoreBrix := TempBrix;
END_IF;
ELSE
// Sotto 4mA, impostiamo Brix a 0
o_ValoreBrix := 0.0;
END_IF;
ELSE
// In caso di errore, manteniamo l'ultimo valore valido o impostiamo un valore specifico
CASE o_StatoSensore OF
1: // Overflow
o_ValoreBrix := 60.0; // Impostiamo al valore massimo
2: // Underflow
o_ValoreBrix := 0.0; // Impostiamo al valore minimo
3: // Wire Break
o_ValoreBrix := -1.0; // Valore speciale per Wire Break
4: // Errore ADAM
o_ValoreBrix := -2.0; // Valore speciale per Errore ADAM
END_CASE;
END_IF;
// Imposta la qualità della misura
o_QualitaBuona := (o_StatoSensore = 0);
// Gestione lettura diagnostica di sistema (se abilitata)
IF i_EnableDiagnostic AND DiagRequest THEN
// Strutture dati necessarie per SFC51
VAR_TEMP
DiagHeader : STRUCT // Struttura dell'header SZL
LENTHDR : WORD; // Lunghezza dell'header SZL in byte
N_DR : WORD; // Numero di record dati
END_STRUCT;
DiagResult : INT; // Risultato della chiamata SFC51
DiagLen : WORD; // Lunghezza dei dati ricevuti
DiagCount : INT; // Contatore per l'analisi dei dati
DiagFound : BOOL; // Flag per errore trovato
DiagSlot : BYTE; // Slot del modulo diagnosticato
DiagType : BYTE; // Tipo di errore diagnostico
DiagAddr : WORD; // Indirizzo del modulo
TempAddr : WORD; // Indirizzo temporaneo per calcoli
DiagModuleStartAddr : WORD; // Indirizzo di inizio del modulo
END_VAR
// Leggi lo stato diagnostico del sistema utilizzando SFC51
// Lettura delle informazioni diagnostiche del modulo
DiagResult := SFC51(
REQ := TRUE, // Richiesta di lettura
SZL_ID := W#16#00B1, // ID per informazioni diagnostiche (diagnostica slave DP)
INDEX := W#16#0000, // Tutti gli slave
RET_VAL := DiagStatus, // Codice di ritorno
BUSY := DiagBusy, // Operazione in corso
SZL_HEADER := DiagHeader, // Header SZL
DR := DiagBuffer // Buffer per i dati diagnostici
);
// Se l'operazione è completata, analizziamo i risultati
IF NOT DiagBusy THEN
DiagRequest := FALSE; // Reset della richiesta
IF DiagStatus = W#16#0000 THEN
DiagDone := TRUE; // Lettura completata con successo
DiagFound := FALSE; // Reset flag errore trovato
// Calcola l'indirizzo del modulo analogico
// Nota: questo è un esempio, devi adattarlo al tuo hardware
// Supponiamo che l'indirizzo dell'ingresso analogico sia PIW256
DiagModuleStartAddr := W#16#0100; // 256 in esadecimale
// Analizza i dati diagnostici ricevuti per trovare errori specifici
FOR DiagCount := 0 TO INT_TO_INT(DiagHeader.N_DR)-1 DO
// Ogni record di diagnostica ha un formato specifico
// Estrai lo slot e l'indirizzo del modulo per verificare che sia quello giusto
DiagSlot := DiagBuffer[DiagCount*4]; // Slot in byte 0 del record
TempAddr := WORD_TO_WORD(SHL(IN:=BYTE_TO_WORD(DiagBuffer[DiagCount*4+2]), N:=8));
TempAddr := TempAddr OR BYTE_TO_WORD(DiagBuffer[DiagCount*4+3]);
DiagAddr := TempAddr; // Indirizzo del modulo
// Verifica se questo è il nostro modulo analogico
IF DiagAddr = DiagModuleStartAddr THEN
// Leggi il tipo di errore (byte 1 del record)
DiagType := DiagBuffer[DiagCount*4+1];
// Analizza il tipo di errore
CASE DiagType OF
B#16#06: // 6D = 00110: Wire break
o_StatoSensore := 3; // Wire break
o_DiagInfo := 'Wire Break rilevato tramite diagnostica';
DiagFound := TRUE;
B#16#07: // 7D = 00111: Upper limit exceeded
o_StatoSensore := 1; // Overflow
o_DiagInfo := 'Overflow rilevato tramite diagnostica';
DiagFound := TRUE;
B#16#08: // 8D = 01000: Lower limit undershot
o_StatoSensore := 2; // Underflow
o_DiagInfo := 'Underflow rilevato tramite diagnostica';
DiagFound := TRUE;
B#16#09: // 9D = 01001: Error (modulo interno)
o_StatoSensore := 5; // Errore interno modulo
o_DiagInfo := 'Errore interno del modulo rilevato';
DiagFound := TRUE;
B#16#10: // 16D = 10000: Errore parametrizzazione
o_StatoSensore := 6; // Errore configurazione
o_DiagInfo := 'Errore configurazione modulo';
DiagFound := TRUE;
END_CASE;
// Se abbiamo trovato un errore, usciamo dal ciclo
IF DiagFound THEN
EXIT;
END_IF;
END_IF;
END_FOR;
// Se non troviamo errori diagnostici ma il valore è 32767, è probabilmente un overflow
IF NOT DiagFound AND ValoreAnalogicoInt = OVERFLOW_VALUE THEN
o_StatoSensore := 1; // Overflow
o_DiagInfo := 'Overflow rilevato (nessun messaggio diagnostico specifico)';
END_IF;
ELSE
// Errore nella lettura diagnostica
DiagError := TRUE;
o_DiagInfo := CONCAT(IN1:='Errore SFC51: ', IN2:=WORD_TO_STRING(DiagStatus));
END_IF;
END_IF;
END_IF;
END_IF;
END_FUNCTION_BLOCK
// Chiamata al blocco funzionale di misurazione Brix
// Sostituire "PIW256" con l'indirizzo effettivo dell'ingresso analogico
CALL "FB_MisurazioneBrix", "DB_MisurazioneBrix" (
i_IW_Analog := PIW256, // Indirizzo ingresso analogico (da adattare)
i_EnableDiagnostic := TRUE,
i_Reset := "Reset_Allarmi" // Connetti a un ingresso digitale o a una variabile HMI
);
// Qui puoi aggiungere ulteriore logica per gestire i valori e gli stati
// Ad esempio, trasferire i valori a DB per visualizzazione HMI, attivare allarmi, ecc.
```
## 6. Caso Specifico: ADAM/Maselli che Genera 0-20mA
Per gestire questa situazione:
1. **Configurazione del modulo**: Configura il modulo analogico SIMATIC per il range 4-20mA
2. **Gestione dei valori sotto 4mA**: Quando il valore scende sotto 4mA (che in formato S7 sarebbe sotto 0 in decimale), il modulo lo interpreta come underrange.
3. **Rilevamento dell'errore a 2mA**: Il valore di 2mA corrisponde approssimativamente a -3456 in formato decimale S7 per il range 4-20mA.
### Senza utilizare la SFC51:
***
```pascal
// Determinazione dello stato del sensore basata solo sul valore PEW
IF ValoreAnalogicoInt = OVERFLOW_VALUE THEN // 32767
o_StatoSensore := 7; // Codice generico per "Overflow o Wire Break"
o_DiagInfo := 'Rilevato Overflow o Wire Break';
ELSIF ValoreAnalogicoInt = UNDERFLOW_VALUE THEN // -32768
o_StatoSensore := 2; // Underflow
o_DiagInfo := 'Underflow rilevato';
ELSIF ValoreAnalogicoInt >= ADAM_ERROR_LOW AND ValoreAnalogicoInt <= ADAM_ERROR_HIGH THEN
o_StatoSensore := 4; // Errore ADAM (2mA)
o_DiagInfo := 'Errore ADAM rilevato (2mA)';
ELSE
o_StatoSensore := 0; // OK
o_DiagInfo := 'Misura OK';
END_IF;
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -36,3 +36,9 @@ Then:
.\winutil.ps1
```
### Last use of Tweaks:
***
![[Pasted image 20250505132440.png]]

View File

@ -0,0 +1,501 @@
[live.sysinternals.com - /](https://live.sysinternals.com/)
[GitHub - Sysinternals/sysinternals: Content for sysinternals.com](https://github.com/Sysinternals/sysinternals)
Process Monitor: [Procmon64.exe](file:///D:%5CInstalad%5CSysInternals%20Suite%20Microsoft%5CProcmon64.exe)
- Figuring out where on disk/registry GUI based settings are saved
* Something fails to run/install that really should work with vague message
Process Explorer: [procexp64.exe](file:///D:%5CInstalad%5CSysInternals%20Suite%20Microsoft%5Cprocexp64.exe)
- Malware hunting or strange processes exploration
AutoRuns:[Autoruns64.exe](file:///D:%5CInstalad%5CSysInternals%20Suite%20Microsoft%5CAutoruns64.exe)
- Malware hunting
ProcDump: [procdump64.exe](file:///D:%5CInstalad%5CSysInternals%20Suite%20Microsoft%5Cprocdump64.exe)
- When all else fails, do a memory dump and load it in windbg.
ZoomIt:[ZoomIt64.exe](file:///D:%5CInstalad%5CSysInternals%20Suite%20Microsoft%5CZoomIt64.exe)
- For zooming on on my screen when explaining stuff (not just presentations)
AccessEnum:[AccessEnum.exe](file:///D:%5CInstalad%5CSysInternals%20Suite%20Microsoft%5CAccessEnum.exe)
- Viewing, troubleshooting or reporting on shared folder permissions.
PSPing:
- Could test open TCP ports, replaced by Test-NetConnection
Handle:
- For showing the process that has a lock or handle on a file
AccessChk - AccessChk is a command-line tool for viewing the effective permissions on files, registry keys, services, processes, kernel objects, and more.
AccessEnum - This simple yet powerful security tool shows you who has what access to directories, files and Registry keys on your systems. Use it to find holes in your permissions.
AdExplorer - Active Directory Explorer is an advanced Active Directory (AD) viewer and editor.
AdInsight - An LDAP (Light-weight Directory Access Protocol) real-time monitoring tool aimed at troubleshooting Active Directory client applications.
AdRestore - Undelete Server 2003 Active Directory objects.
Autologon - Bypass password screen during logon.
Autoruns - See what programs are configured to startup automatically when your system boots and you login. Autoruns also shows you the full list of Registry and file locations where applications can configure auto-start settings.
BgInfo - This fully-configurable program automatically generates desktop backgrounds that include important information about the system including IP addresses, computer name, network adapters, and more.
CacheSet - CacheSet is a program that allows you to control the Cache Manager's working set size using functions provided by NT. It's compatible with all versions of NT.
ClockRes - View the resolution of the system clock, which is also the maximum timer resolution.
Contig - Wish you could quickly defragment your frequently used files? Use Contig to optimize individual files, or to create new files that are contiguous.
Coreinfo - Coreinfo is a new command-line utility that shows you the mapping between logical processors and the physical processor, NUMA node, and socket on which they reside, as well as the caches assigned to each logical processor.
Ctrl2cap - This is a kernel-mode driver that demonstrates keyboard input filtering just above the keyboard class driver in order to turn caps-locks into control keys. Filtering at this level allows conversion and hiding of keys before NT even "sees" them. Ctrl2cap also shows how to use NtDisplayString() to print messages to the initialization blue-screen.
DebugView - Another first from Sysinternals: This program intercepts calls made to DbgPrint by device drivers and OutputDebugString made by Win32 programs. It allows for viewing and recording of debug session output on your local machine or across the Internet without an active debugger.
Desktops - This new utility enables you to create up to four virtual desktops and to use a tray interface or hotkeys to preview whats on each desktop and easily switch between them.
Disk2vhd - Disk2vhd simplifies the migration of physical systems into virtual machines (p2v).
DiskExt - Display volume disk-mappings.
Diskmon - This utility captures all hard disk activity or acts like a software disk activity light in your system tray.
DiskView - Graphical disk sector utility.
Disk Usage (DU) - View disk usage by directory.
EFSDump - View information for encrypted files.
Handle - This handy command-line utility will show you what files are open by which processes, and much more.
Hex2dec - Convert hex numbers to decimal and vice versa.
Junction - Create Win2K NTFS symbolic links.
LDMDump - Dump the contents of the Logical Disk Manager's on-disk database, which describes the partitioning of Windows 2000 Dynamic disks.
ListDLLs - List all the DLLs that are currently loaded, including where they are loaded and their version numbers. Version 2.0 prints the full path names of loaded modules.
LiveKd - Use Microsoft kernel debuggers to examine a live system.
LoadOrder - See the order in which devices are loaded on your WinNT/2K system.
LogonSessions - List the active logon sessions on a system.
MoveFile - Allows you to schedule move and delete commands for the next reboot.
NTFSInfo - Use NTFSInfo to see detailed information about NTFS volumes, including the size and location of the Master File Table (MFT) and MFT-zone, as well as the sizes of the NTFS meta-data files.
PageDefrag - Defragment your paging files and Registry hives.
PendMoves - Enumerate the list of file rename and delete commands that will be executed the next boot.
PipeList - Displays the named pipes on your system, including the number of maximum instances and active instances for each pipe.
PortMon- Monitor serial and parallel port activity with this advanced monitoring tool. It knows about all standard serial and parallel IOCTLs and even shows you a portion of the data being sent and received. Version 3.x has powerful new UI enhancements and advanced filtering capabilities.
ProcDump - This new command-line utility is aimed at capturing process dumps of otherwise difficult to isolate and reproduce CPU spikes. It also serves as a general process dump creation utility and can also monitor and generate process dumps when a process has a hung window or unhandled exception.
Process Explorer - Find out what files, registry keys and other objects processes have open, which DLLs they have loaded, and more. This uniquely powerful utility will even show you who owns each process.
Process Monitor - Monitor file system, Registry, process, thread and DLL activity in real-time.
ProcFeatures - This applet reports processor and Windows support for Physical Address Extensions and No Execute buffer overflow protection.
PsExec - Execute processes on remote systems.
PsFile - See what files are opened remotely.
PsGetSid - Displays the SID of a computer or a user.
PsInfo - Obtain information about a system.
PsKill - Terminate local or remote processes.
PsList - Show information about processes and threads.
PsLoggedOn - Show users logged on to a system.
PsLogList - Dump event log records.
PsPasswd - Changes account passwords.
PsService - View and control services.
PsShutdown - Shuts down and optionally reboots a computer.
PsSuspend - Suspend and resume processes.
RAMMap - An advanced physical memory usage analysis utility that presents usage information in different ways on its several different tabs.
RegDelNull - Scan for and delete Registry keys that contain embedded null-characters that are otherwise undeleteable by standard Registry-editing tools.
RegJump - Jump to the registry path you specify in Regedit.
RootkitRevealer - Scan your system for rootkit-based malware.
SDelete - Securely overwrite your sensitive files and cleanse your free space of previously deleted files using this DoD-compliant secure delete program.
ShareEnum - Scan file shares on your network and view their security settings to close security holes.
ShellRunas - Launch programs as a different user via a convenient shell context-menu entry.
Sigcheck - Dump file version information and verify that images on your system are digitally signed.
Streams - Reveal NTFS alternate streams.
Strings - Search for ANSI and UNICODE strings in binaryimages.
Sync - Flush cached data to disk.
TCPView - Active socket command-line viewer.
VMMap - VMMap is a process virtual and physical memory analysis utility.
VolumeId - Set Volume ID of FAT or NTFS drives.
Whois - See who owns an Internet address.
WinObj - The ultimate Object Manager namespace viewer is here.
ZoomIt - Presentation utility for zooming and drawing on the screen.
# Sysinternals Tools Reference Guide
Microsoft Sysinternals provides a suite of advanced system utilities and technical information. This reference guide covers key tools, their primary functions, and common use cases.
## Process Analysis Tools
### Process Monitor
**Purpose**: Real-time file system, Registry, and process/thread activity monitoring.
**Key Features**:
- Captures detailed events in real-time
- Advanced filtering system
- Boot time logging
- Process tree visualization
**Common Use Cases**:
- Troubleshooting application installation failures
- Finding where configuration settings are stored on disk/registry
- Identifying file access failures
- Detecting unauthorized system modifications
- Debugging application performance issues
**Basic Usage**:
- Use filters (Ctrl+L) to reduce noise
- Set inclusion filters before capturing
- Use the process tree view to understand relationships
- Save logs for offline analysis
### Process Explorer
**Purpose**: Enhanced task manager replacement that shows detailed information about running processes.
**Key Features**:
- Process hierarchy tree view
- Detailed properties for each process
- DLL and handle usage tracking
- GPU, disk and network activity monitoring
- Verification against VirusTotal
**Common Use Cases**:
- Malware hunting and identification
- Strange process exploration and investigation
- Finding memory/handle leaks
- Troubleshooting high resource usage
- Determining process dependencies
**Basic Usage**:
- Hover over processes for tooltip information
- Right-click for detailed properties
- Use Find (Ctrl+F) to locate specific handles or DLLs
- Set different highlighting colors for easier visual identification
### ProcDump
**Purpose**: Command-line utility for creating process memory dumps based on various criteria.
**Key Features**:
- CPU threshold-based dumps
- Exception-based triggering
- Memory commit threshold triggers
- Scheduled dumping options
- Multiple dump modes (mini, full, etc.)
**Common Use Cases**:
- Capturing crash dumps for debugging
- Creating memory dumps for analysis in WinDbg
- Performance troubleshooting
- Analyzing memory leaks
- Debugging hanging applications
**Basic Usage**:
```
procdump -ma <process_name_or_PID> <output_filename>
procdump -c 80 -s 5 <process_name_or_PID> # CPU spike trigger
```
## System Configuration Tools
### AutoRuns
**Purpose**: Shows what programs are configured to run during system bootup or login.
**Key Features**:
- Comprehensive startup locations coverage
- Integration with VirusTotal
- Hide signed Microsoft entries option
- Compare with previous scan results
- Command-line version available (autorunsc)
**Common Use Cases**:
- Malware hunting and persistence detection
- System performance optimization
- Troubleshooting slow startup
- Security auditing
- Removing unwanted startup programs
**Basic Usage**:
- Use "Verify Code Signatures" option to identify unsigned code
- Enable VirusTotal submission for suspicious files
- Filter by entry type using the tabs (Everything, Logon, etc.)
- Use "Compare" feature to detect recent changes
### AccessEnum
**Purpose**: Security utility that shows who has access to directories, files, and Registry keys.
**Key Features**:
- Maps effective permissions for users/groups
- Scans file systems and Registry
- Shows permissions inheritance
- Identifies potential security issues
**Common Use Cases**:
- Viewing and reporting shared folder permissions
- Security auditing
- Troubleshooting access denied errors
- Identifying over-permissive settings
- Documenting permission structures
**Basic Usage**:
- Select the starting directory or Registry key
- Click "Scan" to analyze permissions
- Sort results by permission type
- Export to CSV for reporting
## Networking Tools
### PSPing
**Purpose**: Ping-like utility that measures network performance.
**Key Features**:
- TCP/IP latency measurement
- TCP port testing
- ICMP echo testing
- Bandwidth measurement
- Detailed statistics
**Common Use Cases**:
- Testing connectivity to specific TCP ports
- Measuring network latency
- Performance benchmarking
- Diagnosing network issues
- Alternative to PowerShell's Test-NetConnection
**Basic Usage**:
```
psping -n 100 www.example.com # ICMP ping
psping -4 -tcp 192.168.1.1:80 # TCP ping
psping -b -l 8k 192.168.1.1:445 # Bandwidth test
```
### PSExec
**Purpose**: Execute processes remotely on Windows systems.
**Key Features**:
- Run commands on remote systems
- Interactive or background mode
- Run as different user
- Copy programs to remote systems for execution
- Can run GUI applications remotely
**Common Use Cases**:
- Remote administration
- Running commands on multiple computers
- Executing programs with different credentials
- Running programs interactively on remote systems
- Automating tasks across networks
**Basic Usage**:
```
psexec \\remote_computer -u domain\user -p password cmd.exe
psexec \\remote_computer -s regedit.exe # Run as SYSTEM
```
**Note**: Many PSExec functions are now available through PowerShell's Invoke-Command.
## Debugging & Diagnostic Tools
### Handle
**Purpose**: Displays handles opened by processes and the specific files/objects they have open.
**Key Features**:
- Shows open handles for all processes
- Filters by process, handle type, or object name
- Can close handles (with -c option)
- Command-line operation
**Common Use Cases**:
- Finding which process has a file locked
- Troubleshooting "file in use" issues
- Identifying resource leaks
- Debugging application issues
- Investigating file access problems
**Basic Usage**:
```
handle # List all handles
handle -p explorer # Handles opened by explorer.exe
handle "C:\temp" # Find processes with handles to this path
```
### ZoomIt
**Purpose**: Screen zoom and annotation tool for technical presentations.
**Key Features**:
- Zoom in on any part of the screen
- Drawing tools for live annotations
- Break timer function
- Configurable keyboard shortcuts
- Presentation mode
**Common Use Cases**:
- Highlighting details during presentations
- Explaining technical concepts visually
- Drawing attention to specific screen elements
- Annotating screenshots in real-time
- Making small text readable for audiences
**Basic Usage**:
- Default zoom shortcut: Ctrl+1
- Drawing mode: Ctrl+2
- Type mode: Ctrl+3
- Press ESC to exit any mode
## Additional Useful Tools
### Disk2vhd
**Purpose**: Creates VHD (Virtual Hard Disk) versions of physical disks.
**Key Features**:
- Creates VHD/VHDX while system is running
- Volume Shadow Copy (VSS) snapshot technology
- Can include/exclude specific volumes
- Compatible with Hyper-V
**Common Use Cases**:
- Physical-to-virtual (P2V) migrations
- System backup
- Test environment creation
- Troubleshooting in a virtual environment
### TCPView
**Purpose**: Detailed listing of all TCP and UDP connections.
**Key Features**:
- Real-time connection monitoring
- Process-to-connection mapping
- Endpoint resolution (DNS lookups)
- Connection state tracking
**Common Use Cases**:
- Identifying unexpected network connections
- Monitoring application network activity
- Troubleshooting network issues
- Security monitoring
### BGInfo
**Purpose**: Displays system information on the desktop background.
**Key Features**:
- Customizable information display
- Script/command output integration
- Multiple configuration support
- Remote deployment options
**Common Use Cases**:
- Server identification in data centers
- Displaying critical system information
- Quick access to system specs
- Support environment identification
### Sysmon
**Purpose**: System monitoring service that records system activity to Windows Event Log.
**Key Features**:
- Process creation monitoring
- Network connection logging
- Driver/image loading detection
- WMI event monitoring
- Advanced filtering via XML configuration
**Common Use Cases**:
- Security monitoring and threat hunting
- Intrusion detection
- Forensic investigation
- Compliance monitoring
- Malware behavior analysis
## Resources
- Official Sysinternals Website: https://docs.microsoft.com/en-us/sysinternals/
- Sysinternals Live: \live.sysinternals.com\tools\
- Windows Internals Books (by Mark Russinovich)
- Sysinternals Forums: https://techcommunity.microsoft.com/t5/sysinternals/bd-p/Sysinternals

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

View File

@ -1,5 +1,5 @@
28-02-2025 - Corrado Burani - Sitronic srl - [[cronologia#R: Modifica Trasporti ad aria kosme portogallo |R-Modifica-Trasporti-ad-aria-kosme-portogallo]]
28-02-2025 - Corrado Burani - Sitronic srl - [[03-VM/30 - 9.3941- Kosme - Portogallo (Modifica + Linea)/Emails/cronologia#R: Modifica Trasporti ad aria kosme portogallo|R-Modifica-Trasporti-ad-aria-kosme-portogallo]]
### Condizioni della linea :
In marcia

View File

@ -1,6 +1,6 @@
# Índice de Mensajes
- 28-02-2025 - Corrado Burani - Sitronic srl - [[cronologia#R: Modifica Trasporti ad aria kosme portogallo |R-Modifica-Trasporti-ad-aria-kosme-portogallo]]
- 28-02-2025 - Corrado Burani - Sitronic srl - [[03-VM/30 - 9.3941- Kosme - Portogallo (Modifica + Linea)/Emails/cronologia#R: Modifica Trasporti ad aria kosme portogallo|R-Modifica-Trasporti-ad-aria-kosme-portogallo]]
---

View File

@ -1,6 +1,6 @@
# Índice de Mensajes
- 11-02-2025 - Bhavik Patel - [[cronologia#RE: [EXT] Week 8 Trial of Auto Changeover - 02.11.2025|RE-EXT-Week-8-Trial-of-Auto-Changeover---02112025]]
- 11-02-2025 - Bhavik Patel - [[03-VM/40 - 93040 - HENKEL - NEXT + 1 Problem/Trial/cronologia#RE: [EXT] Week 8 Trial of Auto Changeover - 02.11.2025|RE-EXT-Week-8-Trial-of-Auto-Changeover---02112025]]
---

View File

@ -1,28 +1,28 @@
# Índice de Mensajes
- 10-02-2025 - Osswald Ulrich (ASG) - [[cronologia#AW: *EXT* RE: *EXT* Next + 1 - HENKEL - ALPLA - AUTEFA|AW-EXT-RE-EXT-Next-1---HENKEL---ALPLA---AUTEFA]]
- 04-02-2025 - Ureda Sudheesh (ASG-Extern) - [[cronologia#Re: *EXT* Next + 1 - HENKEL - ALPLA - AUTEFA|Re-EXT-Next-1---HENKEL---ALPLA---AUTEFA]]
- 04-02-2025 - Maximilian Rossi - Vetromeccanica S.r.l. - [[cronologia#I: R: I: [EXT] R: Vetro Conveyor 9.3674|I-R-I-EXT-R-Vetro-Conveyor-93674]]
- 04-02-2025 - Miguel Angel Vera - Vetromeccanica S.r.l. - [[cronologia#RE: OPC-UA interface Vetro - Bowling Green 2 9.3040-3074|RE-OPC-UA-interface-Vetro---Bowling-Green-2-93040-3074]]
- 04-02-2025 - Maximilian Rossi - Vetromeccanica S.r.l. - [[cronologia#I: IDH_BTL|I-IDH_BTL]]
- 04-02-2025 - Maximilian Rossi - Vetromeccanica S.r.l. - [[cronologia#I: OPC-UA interface Vetro - Bowling Green 2 9.3040-3074|I-OPC-UA-interface-Vetro---Bowling-Green-2-93040-3074]]
- 04-02-2025 - Maximilian Rossi - Vetromeccanica S.r.l. - [[cronologia#I: Alpla BOW2 - Line emptying button 6168|I-Alpla-BOW2---Line-emptying-button-6168]]
- 04-02-2025 - Maximilian Rossi - Vetromeccanica S.r.l. - [[cronologia#I: 9.3040-3074 ALPLA BG open points|I-93040-3074-ALPLA-BG-open-points]]
- 04-02-2025 - Maximilian Rossi - Vetromeccanica S.r.l. - [[cronologia#I: 9.3061-TLO26-L42 automatic change over test|I-93061-TLO26-L42-automatic-change-over-test]]
- 04-02-2025 - Maximilian Rossi - Vetromeccanica S.r.l. - [[cronologia#R: [EXT] RE: Vetro/ALPLA information verification 9.3060-3067|R-EXT-RE-VetroALPLA-information-verification-93060-3067]]
- 04-02-2025 - Lenin Vera - [[cronologia#RE: [EXT] RE: Vetro/ALPLA information verification|RE-EXT-RE-VetroALPLA-information-verification]]
- 03-02-2025 - Shannon.Johnson - [[cronologia#RE: Automatic changeover trial|RE-Automatic-changeover-trial]]
- 03-02-2025 - Miguel Angel Vera - Vetromeccanica S.r.l. - [[cronologia#NEXT2 - Data - ALPLA information verification|NEXT2---Data---ALPLA-information-verification]]
- 18-12-2024 - Miguel Angel Vera - [[cronologia#RV: RE: [EXT] RE: Vetro/ALPLA information verification|RV-RE-EXT-RE-VetroALPLA-information-verification]]
- 04-01-2024 - Maximilian Rossi - Vetromeccanica S.r.l. - [[cronologia#I: 9.3061-TLO26-L42 automatic change over test|I-93061-TLO26-L42-automatic-change-over-test]]
- 04-01-2024 - Maximilian Rossi - Vetromeccanica S.r.l. - [[cronologia#I: Alpla BOW: Batch handling 9.3040-3074 ALPLA BG |I-Alpla-BOW-Batch-handling-93040-3074-ALPLA-BG]]
- 04-01-2024 - Maximilian Rossi - Vetromeccanica S.r.l. - [[cronologia#I: Alpla BOW: Batch Handling Issue for TG10 & TG20|I-Alpla-BOW-Batch-Handling-Issue-for-TG10-TG20]]
- 04-01-2024 - Maximilian Rossi - Vetromeccanica S.r.l. - [[cronologia#I: Bottle counters / Batch handling |I-Bottle-counters-Batch-handling]]
- 04-01-2024 - Maximilian Rossi - Vetromeccanica S.r.l. - [[cronologia#I: OPC-UA interface Vetro - Bowling Green 2|I-OPC-UA-interface-Vetro---Bowling-Green-2]]
- 29-10-2020 - Maximilian Rossi - Vetromeccanica S.r.l. - [[cronologia#R: 9.3040-3074 ALPLA data exchange with HENKEL - line commisioning|R-93040-3074-ALPLA-data-exchange-with-HENKEL---line-commisioning]]
- 28-10-2020 - Sam.Colley@alpla.com - [[cronologia#FW: Post Operations Meeting Logistics Update - 10/28/2020|FW-Post-Operations-Meeting-Logistics-Update---10282020]]
- 21-05-2020 - Maximilian Rossi - Vetromeccanica S.r.l. - [[cronologia#R: Alpla - Vetro SKU via OPC 9.3040-3074|R-Alpla---Vetro-SKU-via-OPC-93040-3074]]
- 24-02-2020 - Osswald Ulrich (ASG) (Ulrich.Osswald@autefa.com) - [[cronologia#Alpla BG: updated telegram description|Alpla-BG-updated-telegram-description]]
- 10-02-2025 - Osswald Ulrich (ASG) - [[03-VM/40 - 93040 - HENKEL - NEXT + 1 Problem/cronologia#AW: *EXT* RE: *EXT* Next + 1 - HENKEL - ALPLA - AUTEFA|AW-EXT-RE-EXT-Next-1---HENKEL---ALPLA---AUTEFA]]
- 04-02-2025 - Ureda Sudheesh (ASG-Extern) - [[03-VM/40 - 93040 - HENKEL - NEXT + 1 Problem/cronologia#Re: *EXT* Next + 1 - HENKEL - ALPLA - AUTEFA|Re-EXT-Next-1---HENKEL---ALPLA---AUTEFA]]
- 04-02-2025 - Maximilian Rossi - Vetromeccanica S.r.l. - [[03-VM/40 - 93040 - HENKEL - NEXT + 1 Problem/cronologia#I: R: I: [EXT] R: Vetro Conveyor 9.3674|I-R-I-EXT-R-Vetro-Conveyor-93674]]
- 04-02-2025 - Miguel Angel Vera - Vetromeccanica S.r.l. - [[03-VM/40 - 93040 - HENKEL - NEXT + 1 Problem/cronologia#RE: OPC-UA interface Vetro - Bowling Green 2 9.3040-3074|RE-OPC-UA-interface-Vetro---Bowling-Green-2-93040-3074]]
- 04-02-2025 - Maximilian Rossi - Vetromeccanica S.r.l. - [[03-VM/40 - 93040 - HENKEL - NEXT + 1 Problem/cronologia#I: IDH_BTL|I-IDH_BTL]]
- 04-02-2025 - Maximilian Rossi - Vetromeccanica S.r.l. - [[03-VM/40 - 93040 - HENKEL - NEXT + 1 Problem/cronologia#I: OPC-UA interface Vetro - Bowling Green 2 9.3040-3074|I-OPC-UA-interface-Vetro---Bowling-Green-2-93040-3074]]
- 04-02-2025 - Maximilian Rossi - Vetromeccanica S.r.l. - [[03-VM/40 - 93040 - HENKEL - NEXT + 1 Problem/cronologia#I: Alpla BOW2 - Line emptying button 6168|I-Alpla-BOW2---Line-emptying-button-6168]]
- 04-02-2025 - Maximilian Rossi - Vetromeccanica S.r.l. - [[03-VM/40 - 93040 - HENKEL - NEXT + 1 Problem/cronologia#I: 9.3040-3074 ALPLA BG open points|I-93040-3074-ALPLA-BG-open-points]]
- 04-02-2025 - Maximilian Rossi - Vetromeccanica S.r.l. - [[03-VM/40 - 93040 - HENKEL - NEXT + 1 Problem/cronologia#I: 9.3061-TLO26-L42 automatic change over test|I-93061-TLO26-L42-automatic-change-over-test]]
- 04-02-2025 - Maximilian Rossi - Vetromeccanica S.r.l. - [[03-VM/40 - 93040 - HENKEL - NEXT + 1 Problem/cronologia#R: [EXT] RE: Vetro/ALPLA information verification 9.3060-3067|R-EXT-RE-VetroALPLA-information-verification-93060-3067]]
- 04-02-2025 - Lenin Vera - [[03-VM/40 - 93040 - HENKEL - NEXT + 1 Problem/cronologia#RE: [EXT] RE: Vetro/ALPLA information verification|RE-EXT-RE-VetroALPLA-information-verification]]
- 03-02-2025 - Shannon.Johnson - [[03-VM/40 - 93040 - HENKEL - NEXT + 1 Problem/cronologia#RE: Automatic changeover trial|RE-Automatic-changeover-trial]]
- 03-02-2025 - Miguel Angel Vera - Vetromeccanica S.r.l. - [[03-VM/40 - 93040 - HENKEL - NEXT + 1 Problem/cronologia#NEXT2 - Data - ALPLA information verification|NEXT2---Data---ALPLA-information-verification]]
- 18-12-2024 - Miguel Angel Vera - [[03-VM/40 - 93040 - HENKEL - NEXT + 1 Problem/cronologia#RV: RE: [EXT] RE: Vetro/ALPLA information verification|RV-RE-EXT-RE-VetroALPLA-information-verification]]
- 04-01-2024 - Maximilian Rossi - Vetromeccanica S.r.l. - [[03-VM/40 - 93040 - HENKEL - NEXT + 1 Problem/cronologia#I: 9.3061-TLO26-L42 automatic change over test|I-93061-TLO26-L42-automatic-change-over-test]]
- 04-01-2024 - Maximilian Rossi - Vetromeccanica S.r.l. - [[03-VM/40 - 93040 - HENKEL - NEXT + 1 Problem/cronologia#I: Alpla BOW: Batch handling 9.3040-3074 ALPLA BG|I-Alpla-BOW-Batch-handling-93040-3074-ALPLA-BG]]
- 04-01-2024 - Maximilian Rossi - Vetromeccanica S.r.l. - [[03-VM/40 - 93040 - HENKEL - NEXT + 1 Problem/cronologia#I: Alpla BOW: Batch Handling Issue for TG10 & TG20|I-Alpla-BOW-Batch-Handling-Issue-for-TG10-TG20]]
- 04-01-2024 - Maximilian Rossi - Vetromeccanica S.r.l. - [[03-VM/40 - 93040 - HENKEL - NEXT + 1 Problem/cronologia#I: Bottle counters / Batch handling|I-Bottle-counters-Batch-handling]]
- 04-01-2024 - Maximilian Rossi - Vetromeccanica S.r.l. - [[03-VM/40 - 93040 - HENKEL - NEXT + 1 Problem/cronologia#I: OPC-UA interface Vetro - Bowling Green 2|I-OPC-UA-interface-Vetro---Bowling-Green-2]]
- 29-10-2020 - Maximilian Rossi - Vetromeccanica S.r.l. - [[03-VM/40 - 93040 - HENKEL - NEXT + 1 Problem/cronologia#R: 9.3040-3074 ALPLA data exchange with HENKEL - line commisioning|R-93040-3074-ALPLA-data-exchange-with-HENKEL---line-commisioning]]
- 28-10-2020 - Sam.Colley@alpla.com - [[03-VM/40 - 93040 - HENKEL - NEXT + 1 Problem/cronologia#FW: Post Operations Meeting Logistics Update - 10/28/2020|FW-Post-Operations-Meeting-Logistics-Update---10282020]]
- 21-05-2020 - Maximilian Rossi - Vetromeccanica S.r.l. - [[03-VM/40 - 93040 - HENKEL - NEXT + 1 Problem/cronologia#R: Alpla - Vetro SKU via OPC 9.3040-3074|R-Alpla---Vetro-SKU-via-OPC-93040-3074]]
- 24-02-2020 - Osswald Ulrich (ASG) (Ulrich.Osswald@autefa.com) - [[03-VM/40 - 93040 - HENKEL - NEXT + 1 Problem/cronologia#Alpla BG: updated telegram description|Alpla-BG-updated-telegram-description]]
---

View File

@ -172,3 +172,4 @@ T %DBW6
IsOkOut : NOP 0
```
![[Pasted image 20250507111418.png]]

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

View File

@ -0,0 +1,686 @@
# Índice de Mensajes
- 29-04-2025 - Passera, Alessandro - [[E5.007727 - Evo On - SFSRFH300172 + SFSRFH300109 - ANDIA LACTEOS#I: E5.007727 : Evo On - SFSRFH300172 + SFSRFH300109 - ANDIA LACTEOS|I-E5007727-Evo-On---SFSRFH300172-SFSRFH300109---ANDIA-LACTEOS]]
---
# Resumen del hilo de emails
***
Este hilo de emails trata sobre un proyecto de actualización de software llamado "Evo On" para dos máquinas (SFSRFH300172 y SFSRFH300109) en ANDIA LACTEOS. Los emails siguen el progreso del proyecto desde su inicio hasta la entrega final del software.
El proyecto comenzó como respuesta a una reclamación importante del cliente ANDIA LACTEOS. José Marques, Project Manager de ECA, explica que este proyecto es crucial para mejorar la imagen de Sidel ante el cliente, ya que se está ofreciendo como solución a una reclamación.
Inicialmente hubo problemas con la orden de compra interna, ya que se utilizó un código EQPT (equipo) cuando en realidad solo se trataba de una modificación de software. Michele Brianti solicitó cambiar los códigos EQPT por códigos SOFT y eliminar el embalaje y transporte, ya que no habría envío físico de equipos.
La fecha de entrega inicial estimada era para octubre de 2025 (semana 42), pero José Marques solicitó adelantarla significativamente, ya que tenía técnicos en el sitio en mayo de 2025. El equipo de Parma, liderado por Michele Brianti, confirmó que podrían entregar el software para el 5 de mayo de 2025.
En abril, José Marques confirmó que un técnico llamado Romuald sería quien instalaría el software y que las máquinas sopladoras también estarían involucradas en esta actualización de Evo On. También se mencionó que habría un Cloud Connector que sería desarrollado por el departamento técnico de soplado.
El 29 de abril de 2025, Mattia Gorreri confirma que ha completado el software para ambas máquinas y lo ha cargado en SharePoint. Ha colocado el software original en las carpetas "OLD" y el software actualizado en las carpetas "NEW" junto con los archivos FDM correspondientes.
Alessandro Passera explica en el email más reciente cómo usar correctamente las carpetas en SharePoint para el software:
- Carpeta "0_Back-up": Para insertar el software de partida (antigua carpeta OLD)
- Carpeta "1_Released_for_TEST": Software de fin de desarrollo e inicio de TEST
- Carpeta "2_Released_for_INSTALLATION": Software final después de las pruebas (antigua carpeta NEW)
- Carpeta "3_INSTALLED": Software de fin de puesta en marcha También menciona la importancia de crear un archivo de texto vacío llamado "Rilasciato" en la carpeta 2 para iniciar notificaciones automáticas.
En general, el proyecto consiste en una actualización de software "Evo On" para dos máquinas llenadoras en ANDIA LACTEOS, que se realizó como respuesta a un reclamo del cliente, y el software ya está finalizado y listo para ser instalado por los técnicos de campo.
***
+ 0392f50874b2a000b30f8e09bd2f1359
### I: E5.007727 : Evo On - SFSRFH300172 + SFSRFH300109 - ANDIA LACTEOS
- 29-04-2025
Ciao ragazzi vi giro la mail sotto alla quale scusate mi sono dimenticato di inserirvi.
In pratica è una mini spiegazione di come compilare le cartelle del software in share point, giusto per sapere dove mettere le varie
cose.
Altro passo importante è copiare il file txt con nome definito e sempre uguale nella cartella 2 così da far partire gli avvertimenti
che il software è finito : il file di testo in questione sarà vuoto e serve solo il nome Rilasciato così che parte la mail automatica relativa
In generale comunque se riuscite e non vi incasina chi appoggia nel proprio cloud il materiale dellordine vi chiedo di mantenerlo .
Ciao
Alessandro PASSERA
Tel: +39 0521 999 319
Mob: +39 3459439668
Fax : +39 0521 999511
www.sidel.com
General
Brianti, Michele <Michele.Brianti@sidel.com>
Spina, Fabio [EXTERNAL] <fabio.spina.external@sidel.com>; Zanantoni, Luca [EXTERNAL] <luca.zanantoni.external@sidel.com>; l.bonardi <l.bonardi@bierreautomazioni.com>;
p.bellini <p.bellini@bierreautomazioni.com>
Giusto per chiarimento, nella cartella preparata in share point esiste già la posizione del software di partenza.
In particolare le cartelle sono quelle di seguito :
Quindi :
0_Back-up
à cartella in cui inserire il software di partenza su cui inserire le modifiche
(sarebbe la vecchia cartella OLD) ;
1_Released_for_TEST
à è il software di fine sviluppo e di inizio TEST ;
2_Released_for_INSTALLATION
à è il software di fine Test che è quello che serve al tecnico per lavviamento
(è la vecchia cartella NEW) ;
3_INSTALLED
à sarebbe il software di fine avviamento e vediamo torneranno (in generale
comunque non si sostituisce allarchiviazione in Sap che comunque è in carico al product support di zona);
Tutto questo solo per chiarimento visto che siamo allinizio di utilizzo share point per il software.
Ciao
Alessandro PASSERA
Tel: +39 0521 999 319
Mob: +39 3459439668
Fax : +39 0521 999511
www.sidel.com
General
Brianti, Michele <Michele.Brianti@sidel.com>
Perfetto e mi sembra di poter dire di vedere tutto.
Grazie mille Mattia e ottimo lavoro!!
Alessandro PASSERA
Tel: +39 0521 999 319
Mob: +39 3459439668
Fax : +39 0521 999511
www.sidel.com
Brianti, Michele <Michele.Brianti@sidel.com>
Ho caricato il tutto.
SRFH172
Nella cartella OLD troviamo il sw di partenza
Nella cartella new il sw finale con relativa fdm
SRFH109
nella cartella old troviamo il sw di partenza.
Nella cartella new troviamo il sw finale con relativa fdm.
Fatemi sapere se riuscite a visualizzare tutto correttamente e se è arrivata la notifica.
Rimango a disposizione.
Grazie.
Mattia Gorreri
Services Engineering
Tel: +39 3516191383
General
Gorreri, Mattia [EXTERNAL] <260921@sidel.com>
Direi che è dobbligo.
Mattia dovrebbe essere in grado di caricare file nelle cartelle corrette.
@Gorreri,
Mattia [EXTERNAL] puoi cortesemente provare a copiare i file nelle cartelle qui sotto?
Documents
Software directory
Aseptic
RFH172
E5.007727
2_Released_for_INSTALLATION
Documents
Software directory
Aseptic
RFH109
E5.007727
2_Released_for_INSTALLATION
Appena fatto, in ognuna delle 2 cartelle, salva anche il file allegato (non lo modificare salvalo e basta - serve per far partire mail automatica
al PM Supply)
grazie
Claudio
Claudio POMO
Mob: +39 335 1270265
P
Help save paper - do you need to print this email?
Antes de imprimir este correo, piensa si es necesario.
EL MEDIO AMBIENTE ES COSA DE TODOS.
General
Bocci, Stefano <Stefano.Bocci@sidel.com>
***
Subject: R: E5.007727 : Evo On - SFSRFH300172 + SFSRFH300109 - ANDIA LACTEOS
Si potrebbe caricare il sw in sharepoint?
Le cartelle erano state create per queste macchine/ordine.
Stefania Sacchi - External -
Sidel Group
Service Engineering Parma
Sidel Spa, Via la Spezia 241/A
43126 Parma, ITALY
Tel: +39 0521 9991
www.sidel.com
General
ts.asepticECA <ts.asepticECA@sidel.com>; Bocci, Stefano <Stefano.Bocci@sidel.com>
Ciao Michele questa mattina parlando con Mattia che ho inserito in copia mi ha confermato che il software di entrambe le macchine è terminato.
Chiedo a Mattia di copiarlo nella cartella O&U dedicata e di farci sapere così da poter avvertire la zona e condividere con i tecnici
il software per limminente installazione.
In copia inserisco anche il supporto tecnico asettico zona eca così che magari è informato e credo sia il caso di tenerlo nel loop così
che posso in caso di necessità seguire linstallazione.
Ciao
Alessandro PASSERA
Tel: +39 0521 999 319
Mob: +39 3459439668
Fax : +39 0521 999511
www.sidel.com
General
Ciao Ale,
come siamo messi con la consegna dei SW ?
General
Perraut, Romuald <Romuald.Perraut@sidel.com>
Yes, Michele, I confirmed.
Romuald in copy will be the one doing it.
Cordialement / Best regards / Atentamente / Sinceramente,
José Marques
Services Project Manager ECA
Sidel Group
Sidel Blowing & Services
CS 60627, 76059 Le Havre Cedex
Avenue de la Patrouille de France, France
Tel: +33 6 80 41 86 37
www.sidel.com
blog.sidel.com
General
De : Brianti, Michele <Michele.Brianti@sidel.com>
Envoyé : mercredi 16 avril 2025 10:28
À : Marques, Jose <Jose.Marques@sidel.com>
Cc : Guerra, Riccardo <Riccardo.Guerra@sidel.com>; Gorreri, Mattia [EXTERNAL] <260921@sidel.com>; Passera, Alessandro <Alessandro.Passera@sidel.com>
Objet : R: E5.007727 : Evo On 174168 INTERNAL PO4501841001 - H5.013847 - SO 726300 - ANDIA LACTEOS _ 174168 A.1.1
Ciao Jose,
please, can you confirm that the cloud connector will be programmed by blower technical dept ?
Thanks
Michele
General
Ok perfect and thanks.
So also the software of Cloud connector will be developed by blower?
Sorry for all the questions but we are at the beginning of the management of the Evo on and we would like to be sure and
avoid any misunderstanding.
Thanks and best regards
Alessandro PASSERA
Tel: +39 0521 999 319
Mob: +39 3459439668
Fax : +39 0521 999511
www.sidel.com
General
Ciao Michele,
Yes exactely,
All material will be provided for both blowers.
On filler side, we need only soft.
Cordialement / Best regards / Atentamente / Sinceramente,
José Marques
Services Project Manager ECA
Sidel Group
Sidel Blowing & Services
CS 60627, 76059 Le Havre Cedex
Avenue de la Patrouille de France, France
Tel: +33 6 80 41 86 37
www.sidel.com
blog.sidel.com
General
De : Brianti, Michele <Michele.Brianti@sidel.com>
Envoyé : mardi 15 avril 2025 09:17
À : Marques, Jose <Jose.Marques@sidel.com>
Cc : Passera, Alessandro <Alessandro.Passera@sidel.com>
Objet : R: E5.007727 : Evo On 174168 INTERNAL PO4501841001 - H5.013847 - SO 726300 - ANDIA LACTEOS _ 174168 A.1.1
Ciao Jose,
can you confirm that also the Blower is involved in this EVO ON update ?
The cloud connector will be supplied from Blower ?
Thanks for your comment.
Ciao
Michele
General
Oh this is just wonderful, thank you so much Michele.
Adding in the loop Alessandro, to thank him also.
It will be much appreciated guys.
Cordialement / Best regards / Atentamente / Sinceramente,
José Marques
Services Project Manager ECA
Sidel Group
Sidel Blowing & Services
CS 60627, 76059 Le Havre Cedex
Avenue de la Patrouille de France, France
Tel: +33 6 80 41 86 37
www.sidel.com
blog.sidel.com
General
De : Brianti, Michele <Michele.Brianti@sidel.com>
Envoyé : vendredi 11 avril 2025 09:46
À : Marques, Jose <Jose.Marques@sidel.com>
Cc : Signorini, Sara <Sara.Signorini@sidel.com>
Objet : R: E5.007727 : Evo On 174168 INTERNAL PO4501841001 - H5.013847 - SO 726300 - ANDIA LACTEOS _ 174168 A.1.1
Ciao Jose,
we confirm the software modification within May 05 as requested.
Ciao
Michele
General
Ciao Josè,
I escalated, let's see if there are any possibilities to postpone other projects in order to anticipate Andia Lacteos.
I let you know.
Ciao
Michele
Ciao Michele
I need to explain you
This project was offered to customer as he sent a very big claim to Sidel.
We have several other projects in progress with this customer
We will install some of them in may. This includes updating the 2 fillers.
I would like to take this opportunity to include in the update of the fillers the modifications for the evo on.
I know this is not the standard flow
But we need to reduce as much as possible the cost of this “free” project, as it is at Sidel charge.
I will write a message to explain it to Alessandro Passera, hoping he can help in this way.
Tell me if you need more information
And once again thanks for your help as usual Michele
Cordialement / Best regards,
José Marques
Global Product Support Blowing Automation Expert
Equipment Portfolio and Innovation
Sidel Group
Sidel Services SAS
CS 60627, 76059 Le Havre Cedex
Avenue de la Patrouille de France, France
Tel: +33 2 32 85 87 13
www.sidel.com
blog.sidel.com
Envoyé à partir de Outlook pour iOS
General
Objet : E5.007727 : Evo On 174168 INTERNAL PO4501841001 - H5.013847 - SO 726300 - ANDIA LACTEOS _ 174168 A.1.1
Ciao Jose,
We have a big problem to prepare the SW for May 05.
Do you need the SW modification for May 05 for both machines ?
Please, let me know.
SFSRFH300172 + SFSRFH300109
Ciao
Michele Brianti
Project Manager Supply Line Solution
Sidel Group
Sidel SpA
Via La Spezia 241/A, 43124 Parma, Italy
Tel.: +39 0521 999310
Mob: +39 342 6701920
www.sidel.com
General
Trepin, Catherine <Catherine.Trepin@sidel.com>; Marques, Jose <Jose.Marques@sidel.com>; LineConversion <LineConversion@sidel.com>;
Gilles, Nicolas <Nicolas.Gilles@sidel.com>
Dear Michele
The interco PO has been updated (with help of Catherine !).
Then, you can proceed with the project, knowing we would like to receive the software for W19 (because we have FSE on site at this date).
Thank you,
Gérald PORET
Lead Project Manager Services Execution
Mob : +33 6 13 72 53 94
General
De : Brianti, Michele <Michele.Brianti@sidel.com>
Envoyé : vendredi 4 avril 2025 10:13
À : Gilles, Nicolas <Nicolas.Gilles@sidel.com>
Cc : Poret, Gerald <gerald.poret@sidel.com>; Avenel, Stéphanie <Stephanie.Avenel@sidel.com>; Rodrigues, Cynthia <Cynthia.Rodrigues@sidel.com>;
Cristofari, Silvina <Silvina.Cristofari@sidel.com>; Trepin, Catherine <Catherine.Trepin@sidel.com>; Marques, Jose <Jose.Marques@sidel.com>;
LineConversion <LineConversion@sidel.com>
Objet : R: ASSIGN ORDER 174168 INTERNAL PO4501841001 - H5.013847 - SO 726300 - ANDIA LACTEOS _ 174168 A.1.1
Thank you Nicolas,
we waiting PO update in order to start with the project.
Ciao
Michele Brianti
Project Manager Supply Line Solution
Sidel Group
Sidel SpA
Via La Spezia 241/A, 43124 Parma, Italy
Tel.: +39 0521 999310
Mob: +39 342 6701920
www.sidel.com
General
Cristofari, Silvina <Silvina.Cristofari@sidel.com>; Brianti, Michele <Michele.Brianti@sidel.com>; Trepin, Catherine <Catherine.Trepin@sidel.com>
Hello to all,
The solution is to modify the interco PO using a SOFT code instead of an EQPT.
We had a discussion with Catherine and Eric Huault last week on the topic and its confirmed this is the way to proceed.
KR, Nicolas.
General
Rodrigues, Cynthia <Cynthia.Rodrigues@sidel.com>; Cristofari, Silvina <Silvina.Cristofari@sidel.com>; Brianti, Michele <Michele.Brianti@sidel.com>;
Trepin, Catherine <Catherine.Trepin@sidel.com>
***
Subject: RE: ASSIGN ORDER 174168 INTERNAL PO4501841001 - H5.013847 - SO 726300 - ANDIA LACTEOS _ 174168 A.1.1
Salut Sara,
If no better solution, you can load the new softs on a USB stick and ship it.
Are you ok with that?
Cordialement / Best regards / Atentamente / Sinceramente,
José Marques
Services Project Manager ECA
Sidel Group
Sidel Blowing & Services
CS 60627, 76059 Le Havre Cedex
Avenue de la Patrouille de France, France
Tel: +33 6 80 41 86 37
www.sidel.com
blog.sidel.com
General
De : LineConversion <LineConversion@sidel.com>
Envoyé : jeudi 3 avril 2025 20:15
À : Marques, Jose <Jose.Marques@sidel.com>
Cc : Gilles, Nicolas <Nicolas.Gilles@sidel.com>; Poret, Gerald <gerald.poret@sidel.com>; Avenel, Stéphanie <Stephanie.Avenel@sidel.com>;
Rodrigues, Cynthia <Cynthia.Rodrigues@sidel.com>; Cristofari, Silvina <Silvina.Cristofari@sidel.com>; Brianti, Michele <Michele.Brianti@sidel.com>;
Trepin, Catherine <Catherine.Trepin@sidel.com>; Marques, Jose <Jose.Marques@sidel.com>
Objet : Re: ASSIGN ORDER 174168 INTERNAL PO4501841001 - H5.013847 - SO 726300 - ANDIA LACTEOS _ 174168 A.1.1
Ciao Jose
This is a problem Since we cannot managed a project without material using an EQPT code.
It never happened to be blocked on project because of that.
I dont know how to proceed and who can support
Sara
Inviato da
Outlook per iOS
General
Rodrigues, Cynthia <Cynthia.Rodrigues@sidel.com>; Cristofari, Silvina <Silvina.Cristofari@sidel.com>; Brianti, Michele <Michele.Brianti@sidel.com>;
Trepin, Catherine <Catherine.Trepin@sidel.com>; Marques, Jose <Jose.Marques@sidel.com>
Hello Sara,
Catherine already answered to Michele.
“As for this project here will be also material delivered to the customer for this project, the main SO is in tax classification 1.
As supplier POs have to be aligned on same tax classification, we use EQPT to align them”
You can see in attachment the original email form Finance Tax controler
Huault, Eric. We cannot go beyond Sidel Rules.
Thanks for your understanding.
Cordialement / Best regards / Atentamente / Sinceramente,
José Marques
Services Project Manager ECA
Sidel Group
Sidel Blowing & Services
CS 60627, 76059 Le Havre Cedex
Avenue de la Patrouille de France, France
Tel: +33 6 80 41 86 37
www.sidel.com
blog.sidel.com
General
De : LineConversion <LineConversion@sidel.com>
Envoyé : mercredi 2 avril 2025 16:44
À : Marques, Jose <Jose.Marques@sidel.com>
Cc : Gilles, Nicolas <Nicolas.Gilles@sidel.com>; Poret, Gerald <gerald.poret@sidel.com>; Avenel, Stéphanie <Stephanie.Avenel@sidel.com>;
Rodrigues, Cynthia <Cynthia.Rodrigues@sidel.com>; Cristofari, Silvina <Silvina.Cristofari@sidel.com>; Brianti, Michele <Michele.Brianti@sidel.com>;
Trepin, Catherine <Catherine.Trepin@sidel.com>
Objet : Re: ASSIGN ORDER 174168 INTERNAL PO4501841001 - H5.013847 - SO 726300 - ANDIA LACTEOS _ 174168 A.1.1
Dear Jose
As already raised, project cannot be launch until we will receive the amended PO with the replacement of the EQPT code with SOFT one.
Thanks to provide within tomorrow the PO updated.
Ill review with technical dept the planning date to check if there the possibility to improve the planned date.
Kind regards
Sara
Inviato da
Outlook per iOS
General
Da: Marques, Jose <Jose.Marques@sidel.com>
Inviato: mercoledì, aprile 2, 2025 9:21 AM
Rodrigues, Cynthia <Cynthia.Rodrigues@sidel.com>; Cristofari, Silvina <Silvina.Cristofari@sidel.com>; Brianti, Michele <Michele.Brianti@sidel.com>;
Trepin, Catherine <Catherine.Trepin@sidel.com>
Oggetto: RE: ASSIGN ORDER 174168 INTERNAL PO4501841001 - H5.013847 - SO 726300 - ANDIA LACTEOS _ 174168 A.1.1
Bonjour Sara,
I come back to you with this project, which from Parma side includes only soft update.
There is a large mismatch between the original proposal 12 weeks (=W25) , and the Estimated FCA W42.
ESTIMATED PDD FCA PARMA: 14/10/2025
DUE TO AUTOMATION WORKLOAD AND TO BE CONFIRMED AFTER PROJECT LAUNCHING
This project is following a big claim from customer. So we need to commit on a good level of services to improve Sidel image quality.
I am also installing in the coming weeks 4 other projects customer purchased. We need to be perfect
😊
So I kindly ask you to review the delivery date. I cannot announce October to the customer, which is very interested by this Evo on option.
Cordialement / Best regards / Atentamente / Sinceramente,
José Marques
Services Project Manager ECA
Sidel Group
Sidel Blowing & Services
CS 60627, 76059 Le Havre Cedex
Avenue de la Patrouille de France, France
Tel: +33 6 80 41 86 37
www.sidel.com
blog.sidel.com
General
De : Brianti, Michele <Michele.Brianti@sidel.com>
Envoyé : mercredi 26 mars 2025 12:02
À : Trepin, Catherine <Catherine.Trepin@sidel.com>
Cc : Marques, Jose <Jose.Marques@sidel.com>; Gilles, Nicolas <Nicolas.Gilles@sidel.com>; Poret, Gerald <gerald.poret@sidel.com>;
Avenel, Stéphanie <Stephanie.Avenel@sidel.com>; Rodrigues, Cynthia <Cynthia.Rodrigues@sidel.com>; Cristofari, Silvina <Silvina.Cristofari@sidel.com>;
LineConversion <LineConversion@sidel.com>
Objet : R: ASSIGN ORDER 174168 INTERNAL PO4501841001 - H5.013847 - SO 726300 - ANDIA LACTEOS _ 174168 A.1.1
Dear Catherine,
this O&U include only software modification so please change the EQPT codes with SOFT codes and delete packing and transport.
Waiting PO updated.
Thanks
Best Regards
Michele Brianti
Project Manager Supply Line Solution
Sidel Group
Sidel SpA
Via La Spezia 241/A, 43124 Parma, Italy
Tel.: +39 0521 999310
Mob: +39 342 6701920
www.sidel.com
General
Da: LineConversion <LineConversion@sidel.com>
Inviato: lunedì 24 marzo 2025 19:43
Poret, Gerald <gerald.poret@sidel.com>; Avenel, Stéphanie <Stephanie.Avenel@sidel.com>;
Rodrigues, Cynthia <Cynthia.Rodrigues@sidel.com>; Cristofari, Silvina <Silvina.Cristofari@sidel.com>;
Brianti, Michele <Michele.Brianti@sidel.com>
Oggetto: ASSIGN ORDER 174168 INTERNAL PO4501841001 - H5.013847 - SO 726300 - ANDIA LACTEOS _ 174168 A.1.1
Dear Catherine
Project : LI_MEDIUM
Status of the project : TO BE LAUNCHED
Scope of Supply: EVO-ON PERFORMANCE
Machine involved: SFSRFH300172 SFSRFH300109
Assigned PMS: MICHELE BRIANTI
ZRD: 10/06/2025
ESTIMATED PDD FCA PARMA: 14/10/2025 DUE TO AUTOMATION WORKLOAD AND TO BE CONFIRMED AFTER PROJECT LAUNCHING
You are kindly asked to supply the missing data project MANDATORY required for order launching:
1. SOFTWARE BACKUP
ATTENTION: QUOTATION IS ONLY FOR 1 MACHINE BUT IT HAS BEEN CONFIRMED SCOPE AND PRICE BY RICCARDO GUERRA, SEE EMAIL ATTACHED
NOTE: THANKS TO INFORM US ABOUT THE PLANNED INSTALLATION DATE OF THE PROJECT IN SUBJECT AS SOON AS IT WILL BE PLANNED
IMPORTANT:
DUE TO THE ACTUAL WORKLOAD AND RAW MATERIALS SHORTAGE, MAINLY IMPACTING ELECTRICAL COMPONENTS, THE WEEKS
INDICATED IN THE OFFER AND PDD ARE AT RISK.
NEED TO PLAN THE BOM AVAILABILITY DATE, THEN BASED ON SUPPLIERS CONFIRMATIONS WE WILL ADJUST THE TARGET IF NEEDED.
FOR THE TIME BEING CONSIDER THE ABOVE PLANNING.
IT IS MANDATORY TO HAVE THE INFO REQUESTED IN THE ABOVE POINTS AS SOON AS POSSIBLE.
I remain at your disposal for any further details
Kind regards
sara
Sara Signorini
Project Management Supply Manager
Line Solution Projects
Sidel Group
Sidel SpA
Via La Spezia 241/A
43124 Parma - Italy
Tel.: +39 0521 999 761
General
Da: Trepin, Catherine
Inviato: martedì 18 marzo 2025 10:44
Oggetto: INTERNAL PO4501841001 - H5.013847 - SO 726300 - ANDIA LACTEOS _ 174168 A.1.1
Dears,
Please find herewith enclosed internal PO 4501841001
Jose Marques in copy of this email is the PM in charge of this project
Thanks to assign a PM and confirm delivery LT
Remaining at your disposal,
Have a nice day,
Cordialement Best Regards
Mit freundlichen Grüßen
Catherine TREPIN
CUSTOMER MANAGEMENT ECA
Services Project Management -
Sidel
Cell PHONE : +33 (0) 614 167 994
www.sidel.com
SAFE AT WORK SAFELY HOME"
Your safety is our number one priority at Sidel.
General
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution
of the material in this e-mail is strictly forbidden.
---

View File

@ -154,38 +154,38 @@
### Digital Inputs (E - DI_)
***
|Dirección PLC|Tag SIDEL Mixer|Tipo Dato|Descripción PLC|Descripción SIDEL Mixer|Observaciones|
|---|---|---|---|---|---|
|E5.0|DI_MaxTempAlarm|Bool|MAX TEMPERATURE ALARM|Electrical Cabinet High Temperature|Coincidencia directa|
|E5.1|DI_AuxVoltage_On|Bool|AUXILIARY CIRC. ON|Electrical Panel Restored|Función similar|
|E5.2|DI_Emergency_Pressed|Bool|EMERGENCY EMERGENZA|Electrical Panel Emergency Button|Coincidencia directa|
|E5.3|DI_UPSBatteryReady|Bool|BUFFER BATTERY READY|UPS Battery ready|Función similar|
|E5.4|DI_UPSAlarm|Bool|UPS ALARM|UPS Alarm|Coincidencia exacta|
|E5.5|DI_UPSsupply|Bool|BATTERY POWER SUPPLY|UPS supply OK|Función similar|
|E10.0|DI_PPN301_Ovrld|Bool|P1 WATER PUMP OVERLOAD SWITCH|PPN301 - Deaireator Pump Overload|Según equivalencia P1=301|
|E10.1|DI_PPP302_Ovrld|Bool|SYRUP PUMP OVERLOAD|PPP302 - Syrup Pump Overload|Según equivalencia P2=302|
|E10.2|DI_PPM303_Ovrld|Bool|OVERPRESSURE PUMP THERMIC SWITCH|PPM303 - Product Pump Overload|Según equivalencia P3=303|
|E10.3|DI_PPM306_Ovrld|Bool|RECIRCULATION PUMP OVERLOAD|PPM306 - Recirculating Pump Overload|Según equivalencia P6=306|
|E11.0|DI_PPN301_Contactor|Bool|P1 WATER PUMP FAULT / Feedback|PPN301 - Deaireator Pump Feedback|Corresponde a señal K (feedback)|
|E11.1|DI_PPP302_Contactor|Bool|SYRUP PUMP FAULT / Feedback|PPP302 - Syrup Pump Feedback|Corresponde a señal K (feedback)|
|E11.3|DI_PPM306_Contactor|Bool|PRODUCT RECYCLE PUMP|PPM306 - Recirculating Pump Feedback|Corresponde a señal K (feedback)|
|E12.0|DI_PPN301_SoftStOvr|Bool|SOFTSTART RUNNING|PPN301 - Deaireator Pump Softstarter Ready|Función similar|
|E12.4|DI_Air_InletPress_OK|Bool|AIR PRESSURE|Air Pressure Switch|Función similar|
|E12.5|DI_LSN301L|Bool|DEARETOR 1 MINIMUM LEVELPROBE|LSN301_L - Deaireator Tank Minimun Level|Coincidencia directa|
|E12.6|DI_LSM302L|Bool|STORE TANK MIN LEVELPROBE|LSM302_L - Product Tank Minimun Level|Coincidencia directa|
|E60.0|DI_CIP_CIP_Enable|Bool|CIP MODE|From CIP Enable|Función similar|
|E60.1|DI_CIP_CIP_Rinse|Bool|RINSE MODE|From CIP Running|Función similar|
|E60.2|DI_CIP_Drain|Bool|CIP DRAINAGE REQUEST|From CIP Drain|Coincidencia directa|
|E60.3|DI_CIP_CleaningCompleted|Bool|CIP COMPLETED|CIP - Cip Cleaning Completed|Coincidencia directa|
|E68.0|DI_SyrRoom_Pump_Ready|Bool|SYRUPS ROOM PUMP RUN|Syrup Room - Pump ready|Función similar|
|E68.1|DI_SyrRoom_WatPumpReady|Bool|WATER PUMP SYRUP ROOM|From Syrup Room - Water Pump Ready|Coincidencia directa|
|E102.2|DI_AVM346_Open|Bool|AVM346 OPEN|AVM346 - Feedback ON|Coincidencia exacta|
|E102.3|DI_AVM362_Open|Bool|AVM362 OPEN|AVM362 - Feedback ON|Coincidencia exacta|
|E112.2|DI_AVM346_Close|Bool|AVM346 CLOSED|AVM346 - Feedback OFF|Coincidencia exacta|
|E112.3|DI_AVM362_Close|Bool|AVM362 CHIUSA|AVM362 - Feedback OFF|Coincidencia exacta|
|E112.4|DI_RMM301_Closed|Bool|CLOSED VALVE RMM301|RMM301 - Feedback OFF (VM1WATER)|Coincidencia exacta|
|E112.5|DI_RMP302_Closed|Bool|CLOSED VALVE RMP302|RMP302 - Feedback OFF (VM2 SYRUP)|Coincidencia exacta|
|E112.6|DI_RMM303_Closed|Bool|CLOSED VALVE RMM303|RMM303 - Feedback OFF (VM3 CO2)|Coincidencia exacta|
| Dirección PLC | Tag SIDEL Mixer | Tipo Dato | Descripción PLC | Descripción SIDEL Mixer | Observaciones |
| ------------- | ------------------------ | --------- | -------------------------------- | ------------------------------------------ | -------------------------------- |
| E5.0 | DI_MaxTempAlarm | Bool | MAX TEMPERATURE ALARM | Electrical Cabinet High Temperature | Coincidencia directa |
| E5.1 | DI_AuxVoltage_On | Bool | AUXILIARY CIRC. ON | Electrical Panel Restored | Función similar |
| E5.2 | DI_Emergency_Pressed | Bool | EMERGENCY EMERGENZA | Electrical Panel Emergency Button | Coincidencia directa |
| E5.3 | DI_UPSBatteryReady | Bool | BUFFER BATTERY READY | UPS Battery ready | Función similar |
| E5.4 | DI_UPSAlarm | Bool | UPS ALARM | UPS Alarm | Coincidencia exacta |
| E5.5 | DI_UPSsupply | Bool | BATTERY POWER SUPPLY | UPS supply OK | Función similar |
| E10.0 | DI_PPN301_Ovrld | Bool | P1 WATER PUMP OVERLOAD SWITCH | PPN301 - Deaireator Pump Overload | Según equivalencia P1=301 |
| E10.1 | DI_PPP302_Ovrld | Bool | SYRUP PUMP OVERLOAD | PPP302 - Syrup Pump Overload | Según equivalencia P2=302 |
| E10.2 | DI_PPM303_Ovrld | Bool | OVERPRESSURE PUMP THERMIC SWITCH | PPM303 - Product Pump Overload | Según equivalencia P3=303 |
| E10.3 | DI_PPM306_Ovrld | Bool | RECIRCULATION PUMP OVERLOAD | PPM306 - Recirculating Pump Overload | Según equivalencia P6=306 |
| E11.0 | DI_PPN301_Contactor | Bool | P1 WATER PUMP FAULT / Feedback | PPN301 - Deaireator Pump Feedback | Corresponde a señal K (feedback) |
| E11.1 | DI_PPP302_Contactor | Bool | SYRUP PUMP FAULT / Feedback | PPP302 - Syrup Pump Feedback | Corresponde a señal K (feedback) |
| E11.3 | DI_PPM306_Contactor | Bool | PRODUCT RECYCLE PUMP | PPM306 - Recirculating Pump Feedback | Corresponde a señal K (feedback) |
| E12.0 | DI_PPN301_SoftStOvr | Bool | SOFTSTART RUNNING | PPN301 - Deaireator Pump Softstarter Ready | Función similar |
| E12.4 | DI_Air_InletPress_OK | Bool | AIR PRESSURE | Air Pressure Switch | Función similar |
| E12.5 | DI_LSN301L | Bool | DEARETOR 1 MINIMUM LEVELPROBE | LSN301_L - Deaireator Tank Minimun Level | Coincidencia directa |
| E12.6 | DI_LSM302L | Bool | STORE TANK MIN LEVELPROBE | LSM302_L - Product Tank Minimun Level | Coincidencia directa |
| E60.0 | DI_CIP_CIP_Enable | Bool | CIP MODE | From CIP Enable | Función similar |
| E60.1 | DI_CIP_CIP_Rinse | Bool | RINSE MODE | From CIP Running | Función similar |
| E60.2 | DI_CIP_Drain | Bool | CIP DRAINAGE REQUEST | From CIP Drain | Coincidencia directa |
| E60.3 | DI_CIP_CleaningCompleted | Bool | CIP COMPLETED | CIP - Cip Cleaning Completed | Coincidencia directa |
| E68.0 | DI_SyrRoom_Pump_Ready | Bool | SYRUPS ROOM PUMP RUN | Syrup Room - Pump ready | Función similar |
| E68.1 | DI_SyrRoom_WatPumpReady | Bool | WATER PUMP SYRUP ROOM | From Syrup Room - Water Pump Ready | Coincidencia directa |
| E102.2 | DI_AVM346_Open | Bool | AVM346 OPEN | AVM346 - Feedback ON | Coincidencia exacta |
| E102.3 | DI_AVM362_Open | Bool | AVM362 OPEN | AVM362 - Feedback ON | Coincidencia exacta |
| E112.2 | DI_AVM346_Close | Bool | AVM346 CLOSED | AVM346 - Feedback OFF | Coincidencia exacta |
| E112.3 | DI_AVM362_Close | Bool | AVM362 CHIUSA | AVM362 - Feedback OFF | Coincidencia exacta |
| E112.4 | DI_RMM301_Closed | Bool | CLOSED VALVE RMM301 | RMM301 - Feedback OFF (VM1WATER) | Coincidencia exacta |
| E112.5 | DI_RMP302_Closed | Bool | CLOSED VALVE RMP302 | RMP302 - Feedback OFF (VM2 SYRUP) | Coincidencia exacta |
| E112.6 | DI_RMM303_Closed | Bool | CLOSED VALVE RMM303 | RMM303 - Feedback OFF (VM3 CO2) | Coincidencia exacta |
### Analog Inputs (IW - P_AI_)
***

View File

@ -21,8 +21,8 @@
| I3.5 | DI_UPSAlarm | ALLARME UPS UPS ALARM | UPS Alarm | Alta |
| I3.6 | DI_UPSsupply | ALIMENTAZIONE DA BATTERIE BATTERY POWER SUPPLY | UPS supply OK | Alta |
| I3.7 | DI_UPSBatteryReady | BATTERIA TAMPONE PRONTA BUFFER BATTERY READY | UPS Battery ready | Alta |
| I4.3 | DI_Emergency_Pressed | ALARM ENABLING ABILITAZIONE ALLARME | Electrical Panel Emergency Button | Media |
| I4.4 | DI_Log_Sidel | ABILITAZIONEALLARME ALARMENABLING | Log son usuario Sidel | Baja |
| I4.3 | | ALARM ENABLING | | |
| I4.4 | | ABILITAZIONE ALLARME | | |
| I5.0 | DI_SyrRoom_SyrPump_Running | POMPA SALA SCIROPPI INMARCIA SYRUPS ROOM PUMP RUN | From Syrup Room - Syrup Pump Running | Alta |
| I7.1 | DI_Air_InletPress_OK | AIR PRESSURE GAUGE PRESSOSTATO ARIA | Air Pressure Switch | Alta |
| I7.2 | DI_HVP301_Sensor | SENSORE VALVOLA SCARICO SCIROPPC SYRUP DISCHARGE VALVE SENSOR | GCP301 - Manual Syrup Valve Closed (NO) | Alta |

View File

@ -0,0 +1,176 @@
# Project Hardware & IO Summary (Tree View v26)
Identified 1 PLC(s).
## PLC: PLC
- **Type Name:** `CPU 1516F-3 PN/DP`
- **Order Number:** `6ES7 516-3FP03-0AB0`
- **Firmware:** `V3.0`
- **Networks:**
- ### ETHERNET_1 (Ethernet/Profinet)
- PLC Address on this Net: `10.1.33.11`
- **Devices on Network:**
- #### PLC (via E1 @ `10.1.33.11`)
- Address (on net): `10.1.33.11`
- Type Name: `CPU 1516F-3 PN/DP`
- Order No: `6ES7 516-3FP03-0AB0`
- Parent Structure: `Telaio di montaggio_0`
- *No IO Addresses found in modules under parent 'Telaio di montaggio_0' (ID: 87dfb601-a291-499a-9408-ed5b9093c796).*
- ### PROFIBUS_1 (Profibus)
- PLC Address on this Net: `1`
- **Devices on Network:**
- #### PLC (via P1 @ `1`)
- Address (on net): `1`
- Type Name: `CPU 1516F-3 PN/DP`
- Order No: `6ES7 516-3FP03-0AB0`
- Parent Structure: `Telaio di montaggio_0`
- *No IO Addresses found in modules under parent 'Telaio di montaggio_0' (ID: 87dfb601-a291-499a-9408-ed5b9093c796).*
- #### 045U1 (via PB1 @ `8`)
- Address (on net): `8`
- Parent Structure: `Rack_0`
- **IO Addresses (Aggregated from Structure):**
- **From Module:** PPO Type 8 Module consistent PCD_1 (Pos: N/A)
- `EW 1640..1659` (Len=160 bits)
- `AW 1640..1659` (Len=160 bits)
- #### IM151_280A0 (via PB1 @ `10`)
- Address (on net): `10`
- Type Name: `IM 155-6 DP HF`
- Order No: `6ES7 155-6BU01-0CN0`
- Parent Structure: `Telaio di montaggio_0`
- **IO Addresses (Aggregated from Structure):**
- **From Module:** 300A0 (Pos: N/A)
- `EW 0..0` (Len=8 bits)
- **From Module:** 301A0 (Pos: N/A)
- `EW 1..1` (Len=8 bits)
- **From Module:** 302A0 (Pos: N/A)
- `EW 2..2` (Len=8 bits)
- **From Module:** 303A0 (Pos: N/A)
- `EW 3..3` (Len=8 bits)
- **From Module:** 304A0 (Pos: N/A)
- `EW 4..4` (Len=8 bits)
- **From Module:** 305A0 (Pos: N/A)
- `EW 5..5` (Len=8 bits)
- **From Module:** 306A0 (Pos: N/A)
- `EW 6..6` (Len=8 bits)
- **From Module:** 307A0 (Pos: N/A)
- `EW 7..7` (Len=8 bits)
- **From Module:** 320A0 (Pos: N/A)
- `AW 0..0` (Len=8 bits)
- **From Module:** 321A0 (Pos: N/A)
- `AW 1..1` (Len=8 bits)
- **From Module:** 322A0 (Pos: N/A)
- `AW 2..2` (Len=8 bits)
- **From Module:** 323A0 (Pos: N/A)
- `AW 3..3` (Len=8 bits)
- **From Module:** 324A0 (Pos: N/A)
- `AW 4..4` (Len=8 bits)
- **From Module:** 325A0 (Pos: N/A)
- `AW 5..5` (Len=8 bits)
- **From Module:** 326A0 (Pos: N/A)
- `AW 6..6` (Len=8 bits)
- **From Module:** 327A0 (Pos: N/A)
- `AW 7..7` (Len=8 bits)
- **From Module:** 340A1 (Pos: N/A)
- `EW 100..103` (Len=32 bits)
- **From Module:** 341A1 (Pos: N/A)
- `EW 104..107` (Len=32 bits)
- **From Module:** 342A1 (Pos: N/A)
- `EW 108..111` (Len=32 bits)
- **From Module:** 343A1 (Pos: N/A)
- `EW 112..115` (Len=32 bits)
- **From Module:** 344A1 (Pos: N/A)
- `EW 116..119` (Len=32 bits)
- **From Module:** 350A1 (Pos: N/A)
- `AW 100..103` (Len=32 bits)
- **From Module:** 351A1 (Pos: N/A)
- `AW 104..107` (Len=32 bits)
- **From Module:** 352A1 (Pos: N/A)
- `AW 108..111` (Len=32 bits)
- **From Module:** 353A1 (Pos: N/A)
- `AW 112..115` (Len=32 bits)
- **From Module:** 354A1 (Pos: N/A)
- `AW 116..119` (Len=32 bits)
- **From Module:** 355A1 (Pos: N/A)
- `AW 120..123` (Len=32 bits)
- #### Festo_283E1 (via PB1 @ `12`)
- Address (on net): `12`
- Parent Structure: `Telaio di montaggio_0`
- **IO Addresses (Aggregated from Structure):**
- **From Module:** CPX-FB13: DP-Slave [Status]_1 (Pos: N/A)
- `EW 501..501` (Len=8 bits)
- **From Module:** MPA1S: VMPA1-FB-EMS-8 [8DO]_1 (Pos: N/A)
- `AW 16..16` (Len=8 bits)
- **From Module:** MPA1S: VMPA1-FB-EMS-8 [8DO]_2 (Pos: N/A)
- `AW 17..17` (Len=8 bits)
- **From Module:** MPA1S: VMPA1-FB-EMS-8 [8DO]_3 (Pos: N/A)
- `AW 18..18` (Len=8 bits)
- **From Module:** MPA1S: VMPA1-FB-EMS-8 [8DO]_4 (Pos: N/A)
- `AW 19..19` (Len=8 bits)
- **From Module:** MPA1S: VMPA1-FB-EMS-8 [8DO]_5 (Pos: N/A)
- `AW 20..20` (Len=8 bits)
- #### Water_Volumetric_251U1 (via PB1 @ `20`)
- Address (on net): `20`
- Parent Structure: `Telaio di montaggio_0`
- **IO Addresses (Aggregated from Structure):**
- **From Module:** Totalizer Value / Control (Pos: N/A)
- `EW 3100..3104` (Len=40 bits)
- `AW 3100..3100` (Len=8 bits)
- **From Module:** Volume Flow (Pos: N/A)
- `EW 3080..3084` (Len=40 bits)
- #### Syrup_Mass_252U1 (via PB1 @ `21`)
- Address (on net): `21`
- Parent Structure: `Telaio di montaggio_0`
- **IO Addresses (Aggregated from Structure):**
- **From Module:** Concentration (Pos: N/A)
- `EW 2050..2054` (Len=40 bits)
- **From Module:** Density (Pos: N/A)
- `EW 2045..2049` (Len=40 bits)
- **From Module:** Mass Flow (Pos: N/A)
- `EW 2030..2034` (Len=40 bits)
- **From Module:** Temperature (Pos: N/A)
- `EW 2055..2059` (Len=40 bits)
- **From Module:** Totalizer Value / Control (Pos: N/A)
- `EW 2070..2074` (Len=40 bits)
- `AW 2070..2070` (Len=8 bits)
- #### CO2_Mass_253U1 (via PB1 @ `22`)
- Address (on net): `22`
- Parent Structure: `Telaio di montaggio_0`
- **IO Addresses (Aggregated from Structure):**
- **From Module:** Density (Pos: N/A)
- `EW 3215..3219` (Len=40 bits)
- **From Module:** Mass Flow (Pos: N/A)
- `EW 3200..3204` (Len=40 bits)
- **From Module:** Temperature (Pos: N/A)
- `EW 3225..3229` (Len=40 bits)
- **From Module:** Totalizer Value / Control (Pos: N/A)
- `EW 3240..3244` (Len=40 bits)
- `AW 3240..3240` (Len=8 bits)
- #### Anton Paar_120U1 (via PB1 @ `40`)
- Address (on net): `40`
- Parent Structure: `Rack_0`
- **IO Addresses (Aggregated from Structure):**
- **From Module:** IN128 mPDS5>PLC_4_1 (Pos: N/A)
- `EW 15000..15031` (Len=256 bits)
- **From Module:** IN128 mPDS5>PLC_4_2 (Pos: N/A)
- `EW 15032..15063` (Len=256 bits)
- **From Module:** IN128 mPDS5>PLC_4_3 (Pos: N/A)
- `EW 15064..15095` (Len=256 bits)
- **From Module:** IN128 mPDS5>PLC_4_4 (Pos: N/A)
- `EW 15096..15127` (Len=256 bits)
- **From Module:** OUT128 PLC>mPDS5_4_1 (Pos: N/A)
- `AW 15000..15031` (Len=256 bits)
- **From Module:** OUT128 PLC>mPDS5_4_2 (Pos: N/A)
- `AW 15032..15063` (Len=256 bits)
- **From Module:** OUT128 PLC>mPDS5_4_3 (Pos: N/A)
- `AW 15064..15095` (Len=256 bits)
- **From Module:** OUT128 PLC>mPDS5_4_4 (Pos: N/A)
- `AW 15096..15127` (Len=256 bits)

View File

@ -0,0 +1,25 @@
# UDT: AnalogInstrument
## Members
| Name | Datatype | Start Value | Comment |
|---|---|---|---|
| `Spare00` | `Bool` | `` | |
| `Spare01` | `Bool` | `` | |
| `Wait` | `Bool` | `` | |
| `Alarm` | `Bool` | `` | |
| `Mask` | `Bool` | `` | |
| `_LessThanSP` | `Bool` | `` | |
| `_GreaterThanSP` | `Bool` | `` | |
| `Config` | `Bool` | `` | |
| `Spare10` | `Bool` | `` | |
| `Spare11` | `Bool` | `` | |
| `Spare12` | `Bool` | `` | |
| `_AckAlarm` | `Bool` | `` | |
| `PV` | `Real` | `` | |
| `SP` | `Real` | `` | |
| `Offset` | `Real` | `` | |
| `Zero` | `Real` | `` | |
| `Span` | `Real` | `` | |
| `PVFiltered` | `Real` | `` | |

View File

@ -0,0 +1,124 @@
```pascal
// Block Type: FC
// Block Number: 1804
// Original Network Languages: LAD
FUNCTION "Baialage" : Void
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR_TEMP
mLatchONS : Bool;
mBalaiage_Req : Bool;
BalaiageFlowErrorABS : Real;
mAuxReal : Real;
END_VAR
#_1M_30S : Bool; // Auto-generated temporary
BEGIN
// Network 1: Qualifier (Original Language: LAD)
"Procedure_Variables"."Balaiage"."Qualifier" := "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Balaiage" AND "gBlenderProdMode" AND "gBlenderRinseMode" AND "Blender_Variables_Pers"."gCarboStillRecipe" AND "gIN_VoltageOk";
// Network 2: Request (Original Language: LAD)
// Edge Logic handled by Coil 29
"mBaialageReqONS" := "HMI_Variables_Cmd"."Commands_From_HMI"."CMD_BaialageReq" OR "Procedure_Variables"."Blender_Run"."Request"; // P_TRIG("HMI_Variables_Cmd"."Commands_From_HMI"."CMD_BaialageReq" OR "Procedure_Variables"."Blender_Run"."Request") - Mem: "mBaialageReqONS"
"Procedure_Variables"."Balaiage"."Request" := ("HMI_Variables_Cmd"."Commands_From_HMI"."CMD_BaialageReq" AND NOT "mBaialageReqONS") OR ("Procedure_Variables"."Blender_Run"."Request" AND NOT "mBaialageReqONS");
"mBaialageReqONS" := "HMI_Variables_Cmd"."Commands_From_HMI"."CMD_BaialageReq" OR "Procedure_Variables"."Blender_Run"."Request"; // P_TRIG("HMI_Variables_Cmd"."Commands_From_HMI"."CMD_BaialageReq" OR "Procedure_Variables"."Blender_Run"."Request") - Mem: "mBaialageReqONS"
// Network 3: Reset (Original Language: LAD)
"Procedure_Variables"."Balaiage"."Reset" := "Procedure_Variables"."Balaiage"."Qualifier" OR ("Procedure_Variables"."Balaiage"."Latch" AND "gEmergencyPressed");
// Network 4: Done Reset (Original Language: LAD)
IF "Procedure_Variables"."Balaiage"."Reset" THEN
"Procedure_Variables"."Balaiage"."Done" := FALSE;
END_IF;
// Network 5: Request (Original Language: LAD)
// Edge Logic handled by Coil 28
"mBaialage_Request" := "Procedure_Variables"."Balaiage"."Reset" AND "HMI_Variables_Cmd"."Commands_From_HMI"."CMD_BaialageReq"; // P_TRIG("Procedure_Variables"."Balaiage"."Reset" AND "HMI_Variables_Cmd"."Commands_From_HMI"."CMD_BaialageReq") - Mem: "mBaialage_Request"
"mBalaiage_Req" := "Procedure_Variables"."Balaiage"."Reset" AND "HMI_Variables_Cmd"."Commands_From_HMI"."CMD_BaialageReq" AND NOT "mBaialage_Request";
"mBaialage_Request" := "Procedure_Variables"."Balaiage"."Reset" AND "HMI_Variables_Cmd"."Commands_From_HMI"."CMD_BaialageReq"; // P_TRIG("Procedure_Variables"."Balaiage"."Reset" AND "HMI_Variables_Cmd"."Commands_From_HMI"."CMD_BaialageReq") - Mem: "mBaialage_Request"
// Network 6: Wait (Original Language: LAD)
"Procedure_Variables"."Balaiage"."Wait" := "AUX FALSE";
// Network 7: Latch (Original Language: LAD)
"Procedure_Variables"."Balaiage"."Latch" := ("Procedure_Variables"."Balaiage"."Request" AND "Procedure_Variables"."Balaiage"."Done" AND "Procedure_Variables"."Balaiage"."Reset" AND "FirstScan") OR ("Procedure_Variables"."Balaiage"."Done" AND "Procedure_Variables"."Balaiage"."Reset" AND "mBalaiage_Req" AND "FirstScan");
// Network 8: Latch ONS (Original Language: LAD)
// Edge Logic handled by Coil 26
"M19074" := "Procedure_Variables"."Balaiage"."Latch"; // P_TRIG("Procedure_Variables"."Balaiage"."Latch") - Mem: "M19074"
"mLatchONS" := "Procedure_Variables"."Balaiage"."Latch" AND NOT "M19074";
"M19074" := "Procedure_Variables"."Balaiage"."Latch"; // P_TRIG("Procedure_Variables"."Balaiage"."Latch") - Mem: "M19074"
// Network 9: Product Tank Pressure Running (Original Language: LAD)
"Procedure_Variables"."Balaiage"."Running" := "Procedure_Variables"."Balaiage"."Wait" AND "Procedure_Variables"."Balaiage"."Latch";
"HMI_Variables_Status"."Procedures"."BalaiageRun" := "Procedure_Variables"."Balaiage"."Latch";
// Network 10: Product Tank Pressure Running (Original Language: LAD)
IF "Procedure_Variables"."Balaiage"."Running" THEN
"gSP_AVM321" := TRUE;
END_IF;
IF "Procedure_Variables"."Balaiage"."Running" THEN
"gSP_AVM397" := TRUE;
END_IF;
// Network 11: PrdTankPressFault (Original Language: LAD)
"mBaialage_Fault"(IN := "Procedure_Variables"."Balaiage"."Running" AND "Procedure_Variables"."TM301_Drain"."Latch" AND "gBalaiageTankFlowOK" AND "gBlenderRinseMode", PT := S5T#1M_30S); // TODO: Declarar "mBaialage_Fault" : TON;
"gBalaiage_Fault" := "mBaialage_Fault".Q;
// Network 12: Aux (Original Language: LAD)
IF "gBalaiage_MaxFlow" THEN
"mAuxReal" := "Filler_Head_Variables"."Filler_Speed" * "HMI_Blender_Parameters"."Actual_Recipe_Parameters"."_BottleSize";
END_IF;
IF "gBalaiage_MaxFlow" THEN
"mAuxReal" := "mAuxReal" * 0.000999;
END_IF;
IF "gBalaiage_MaxFlow" THEN
"mAuxReal" := "mAuxReal" * 1.1;
END_IF;
IF "HMI_Instrument"."FTM305"."PVFiltered" >= 5.0 THEN
"mAuxReal" := "HMI_Instrument"."FTM305"."PVFiltered";
END_IF;
// Network 13: Tank Flow Ok (Original Language: LAD)
// PrdTankPressError = Press_SP - Press_PV
"Blender_Variables"."gBalaiageFlowError" := "mAuxReal" - "HMI_Instrument"."FTM305"."PVFiltered";
// Network 14: CO2MainValveDelay (Original Language: LAD)
// Network 14 did not produce printable SCL code.
// Network 15: Done (Original Language: LAD)
// PBox SymPy processed, logic in consumer
"mBalaiageDoneONS" := "gBlenderCIPMode"; // P_TRIG("gBlenderCIPMode") - Mem: "mBalaiageDoneONS"
"Procedure_Variables"."Balaiage"."Done" := "Procedure_Variables"."Balaiage"."Done" OR ("gBlenderCIPMode" AND NOT "mBalaiageDoneONS");
END_FUNCTION
```

View File

@ -0,0 +1,468 @@
```pascal
// Block Type: FC
// Block Name (Original): BlendFill StartUp_Seq
// Block Number: 1814
// Original Network Languages: LAD, STL
FUNCTION "BlendFill_StartUp_Seq" : Void
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR_INOUT
mStep : Int;
mTimer : Int;
mTransition : Bool;
mFillerProdLoadedInit : Real;
mFillerProdLoading : Real;
mFillerLoadAgain : Bool;
mFillerLoadAfterDrain : Bool;
END_VAR
VAR_TEMP
mAuxCalc : Real;
mTimeSP : Int;
mLoad1_End : Bool;
mNextStep : Int;
__PlcmigTempFillBits_10B0 : Array[0..7] of Bool;
END_VAR
BEGIN
// Network 1: STEP CONTROL (Original Language: STL)
// --- BEGIN STL Network 1 ---
L "mStep"
JL LEND
JU ST00
JU ST01
JU ST02
JU ST03
JU ST04
JU ST05
JU ST06
JU ST07
LEND: JU FULL
FULL: L 0
T "mStep"
JU END
// --- END STL Network 1 ---
// Network 2: STEP 00 (Original Language: LAD)
// Step 0: Wait Buffer Tank Pressurization
// With QCO The Filler use an indipendent CO2 valve then the step has been
// bypassed
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_FastChangeOverEnabled" THEN
"mNextStep" := 4;
END_IF;
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_FastChangeOverEnabled" THEN
"mTimeSP" := 0;
END_IF;
IF NOT "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_FastChangeOverEnabled" THEN
"mNextStep" := 1;
END_IF;
IF NOT "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_FastChangeOverEnabled" THEN
"mTimeSP" := 6;
END_IF;
// Network 3: End Blend Reset (Original Language: LAD)
IF "AUX FALSE" THEN
"Procedure_Variables"."BlendFill_StartUp"."EnBlend" := FALSE;
END_IF;
// Network 4: STEP 00 (Original Language: STL)
// --- BEGIN STL Network 4 ---
A_BRACK
A "gEqPressOk"
A "gEqPressSelected"
O
A "gBlenderTankPress_Ok"
AN "gEqPressSelected"
ON "gBlendFiStillWaterByPass"
O "HMI_Blender_Parameters".Processor_Options.Blender_OPT._FastChangeOverEnabled
BRACKET
= "__PlcmigTempFillBits_10B0"[0]
BLD 103
A_BRACK
O "gIN_LinePressCO2Ok"
O "HMI_Blender_Parameters".Processor_Options.Blender_OPT._FastChangeOverEnabled
BRACKET
= "__PlcmigTempFillBits_10B0"[1]
BLD 103
A "Procedure_Variables".BlendFill_StartUp.Wait
= "__PlcmigTempFillBits_10B0"[2]
BLD 103
A CLK_0.5S
= "__PlcmigTempFillBits_10B0"[3]
BLD 103
CALL "_StepMove"
A _Statusword_?
JC END
// --- END STL Network 4 ---
// Network 5: STEP 01 (Original Language: LAD)
// Step 1: Wait from Filler Enable TO Open EV46 - CO2 Valve -
// With QCO The Filler use an indipendent CO2 valve then the step has been
// bypassed
IF "AUX TRUE" THEN
"Procedure_Variables"."BlendFill_StartUp"."EnBlend" := FALSE;
END_IF;
// Network 6: STEP 01 (Original Language: STL)
// --- BEGIN STL Network 6 ---
A "gIN_Filler_AVM346_En"
= "__PlcmigTempFillBits_10B0"[0]
BLD 103
A "AUX TRUE"
= "__PlcmigTempFillBits_10B0"[1]
BLD 103
A "Procedure_Variables".BlendFill_StartUp.Wait
= "__PlcmigTempFillBits_10B0"[2]
BLD 103
A CLK_0.5S
= "__PlcmigTempFillBits_10B0"[3]
BLD 103
CALL "_StepMove"
A _Statusword_?
JC END
// --- END STL Network 6 ---
// Network 7: STEP 02 (Original Language: LAD)
// Step 2: Filler Pipe Flushing
// With QCO The Filler use an indipendent CO2 valve then the step has been
// bypassed
IF "AUX TRUE" THEN
"Procedure_Variables"."BlendFill_StartUp"."EnBlend" := FALSE;
END_IF;
// Network 8: MIX - Procedure auxiliary variable (Original Language: LAD)
IF "gIN_Filler_AVM346_En" THEN
"gSP_AVM346" := TRUE;
END_IF;
// Network 9: STEP 02 (Original Language: STL)
// --- BEGIN STL Network 9 ---
A "gIN_FillerEndFlushing"
= "__PlcmigTempFillBits_10B0"[0]
BLD 103
A "AUX TRUE"
= "__PlcmigTempFillBits_10B0"[1]
BLD 103
A "Procedure_Variables".BlendFill_StartUp.Wait
= "__PlcmigTempFillBits_10B0"[2]
BLD 103
A CLK_0.5S
= "__PlcmigTempFillBits_10B0"[3]
BLD 103
CALL "_StepMove"
A _Statusword_?
JC END
// --- END STL Network 9 ---
// Network 10: STEP 03 (Original Language: LAD)
// Step 3: BlendFill Pressurization AT Equilibrium Pressure
// With QCO The Filler use an indipendent CO2 valve then the step has been
// bypassed
IF "AUX TRUE" THEN
"Procedure_Variables"."BlendFill_StartUp"."EnBlend" := FALSE;
END_IF;
// Network 11: STEP 03 (Original Language: LAD)
IF "gIN_Filler_AVM346_En" THEN
"gSP_AVM346" := TRUE;
END_IF;
// Network 12: STEP 03 (Original Language: STL)
// --- BEGIN STL Network 12 ---
A_BRACK
A "gEqPressOk"
A "gEqPressSelected"
O
A "gBlenderTankPress_Ok"
AN "gEqPressSelected"
ON "gBlendFiStillWaterByPass"
BRACKET
= "__PlcmigTempFillBits_10B0"[0]
BLD 103
A "AUX TRUE"
= "__PlcmigTempFillBits_10B0"[1]
BLD 103
A "Procedure_Variables".BlendFill_StartUp.Wait
= "__PlcmigTempFillBits_10B0"[2]
BLD 103
A CLK_0.5S
= "__PlcmigTempFillBits_10B0"[3]
BLD 103
CALL "_StepMove"
A _Statusword_?
JC END
// --- END STL Network 12 ---
// Network 13: STEP 04 (Original Language: LAD)
// Step 4: Wait First Production Completed - OLD -
// NEW : Wait Product Tank Stop Level
"Procedure_Variables"."BlendFill_StartUp"."EnBlend" := "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_FastChangeOverEnabled";
// Network 14: STEP 04 (Original Language: LAD)
IF "gIN_Filler_AVM346_En" THEN
"gSP_AVM346" := TRUE;
END_IF;
// Network 15: STEP 03 (Original Language: LAD)
IF "gPrdTank_Empty" THEN
"gSP_AVM313" := TRUE;
END_IF;
IF "gPrdTank_Empty" AND "Procedure_Variables"."BlendFill_StartUp"."Wait" THEN
"Filler_Head_Variables"."Head_PID_Manual_Value" := "HMI_Blender_Parameters"."ProcessSetup"."_StartUpPPM303Freq";
END_IF;
IF ("HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_FastChangeOverEnabled" AND "gWaitLevToHold_TankPress" AND "gPrdTank_Empty" AND "Procedure_Variables"."BlendFill_StartUp"."Wait") OR ("HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_FastChangeOverEnabled" AND "gBlenderLevelTarget" AND "gPrdTank_Empty" AND "Procedure_Variables"."BlendFill_StartUp"."Wait" AND "gBlenderStopLevel") OR ("HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_FastChangeOverEnabled" AND "gBlenderLevelTarget" AND "gPrdTank_Empty" AND "Procedure_Variables"."BlendFill_StartUp"."Wait" AND "Procedure_Variables"."First_Production"."Latch") OR ("HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_FastChangeOverEnabled" AND "gPrdTank_Empty" AND "Procedure_Variables"."BlendFill_StartUp"."Wait" AND "gBlenderStopLevel" AND "Procedure_Variables"."First_Production"."Done") OR ("HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_FastChangeOverEnabled" AND "gPrdTank_Empty" AND "Procedure_Variables"."BlendFill_StartUp"."Wait" AND "Procedure_Variables"."First_Production"."Latch" AND "Procedure_Variables"."First_Production"."Done") THEN
"gSP_PID_Head_Manual" := TRUE;
END_IF;
// Network 16: STEP 04 (Original Language: LAD)
"mFillerProdLoadedInit" := "System_RunOut_Variables"."TankProductAvailable";
// Network 17: STEP 04 (Original Language: STL)
// --- BEGIN STL Network 17 ---
A "AUX TRUE"
= "__PlcmigTempFillBits_10B0"[0]
BLD 103
A_BRACK
A_BRACK
A "gBlenderStopLevel"
A "Procedure_Variables".First_Production.Latch
O
A "Procedure_Variables".First_Production.Done
A "gBlenderLevelTarget"
BRACKET
AN "HMI_Blender_Parameters".Processor_Options.Blender_OPT._FastChangeOverEnabled
O
A "gWaitLevToHold_TankPress"
A "gIN_Filler_AVM362_En"
BRACKET
= "__PlcmigTempFillBits_10B0"[1]
BLD 103
A "Procedure_Variables".BlendFill_StartUp.Wait
= "__PlcmigTempFillBits_10B0"[2]
BLD 103
A CLK_0.5S
= "__PlcmigTempFillBits_10B0"[3]
BLD 103
CALL "_StepMove"
A _Statusword_?
JC END
// --- END STL Network 17 ---
// Network 18: STEP 05 (Original Language: LAD)
// Step 5: Start TO Load Product TO Filler without P3
IF "AUX FALSE" THEN
"gSP_FillerProdLoad" := TRUE;
END_IF;
IF "mFillerLoadAfterDrain" AND "AUX FALSE" THEN
"Procedure_Variables"."BlendFill_StartUp"."EnBlend" := TRUE;
END_IF;
// Network 19: STEP 05 (Original Language: LAD)
IF "gIN_Filler_AVM346_En" THEN
"gSP_AVM346" := TRUE;
END_IF;
// Network 20: STEP 05 (Original Language: LAD)
IF "gIN_Filler_AVM362_En" THEN
"gSP_AVM362" := TRUE;
END_IF;
// Network 21: STEP 05 (Original Language: LAD)
IF NOT "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_FastChangeOverEnabled" OR NOT "mFillerLoadAfterDrain" OR NOT "mFillerLoadAgain" THEN
"mAuxCalc" := "HMI_Blender_Parameters"."ProcessSetup"."_FillerProdPipeMass" * 1.0;
END_IF;
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_FastChangeOverEnabled" AND "mFillerLoadAfterDrain" AND "mFillerLoadAgain" THEN
"mAuxCalc" := 1.0;
END_IF;
// Network 22: STEP 05 (Original Language: LAD)
"mFillerProdLoading" := "mFillerProdLoadedInit" - "System_RunOut_Variables"."TankProductAvailable";
// Network 23: STEP 05 (Original Language: STL)
// --- BEGIN STL Network 23 ---
A_BRACK
O "gWorkshopTest"
O "HMI_Device".AVM346.Out
BRACKET
A_BRACK
A "HMI_Device".AVM362.Out
O
A "HMI_Device".AVM363.Out
BRACKET
= "__PlcmigTempFillBits_10B0"[0]
BLD 103
A_BRACK
A_BRACK
ON "HMI_Blender_Parameters".Processor_Options.Blender_OPT._FastChangeOverEnabled
O "mFillerLoadAfterDrain"
BRACKET
A_BRACK
L "mFillerProdLoading"
L "mAuxCalc"
GT_R
BRACKET
O
AN "mFillerLoadAfterDrain"
A "gBlenderLevelTarget"
O "gIN_FillerEndTankFilling"
O "mFillerFirstLoadTimeOut"
BRACKET
A "gBlenderTankPress_Ok"
= "__PlcmigTempFillBits_10B0"[1]
BLD 103
A "Procedure_Variables".BlendFill_StartUp.Wait
= "__PlcmigTempFillBits_10B0"[2]
BLD 103
A CLK_0.5S
= "__PlcmigTempFillBits_10B0"[3]
BLD 103
CALL "_StepMove"
A _Statusword_?
JC END
// --- END STL Network 23 ---
// Network 24: STEP 06 (Original Language: LAD)
// Step 6: LOAD 2 with PPM303 Pump in regulation 2/3 m, wait End
// Tank Filling from Filler
IF "AUX FALSE" THEN
"gSP_FillerProdLoad" := TRUE;
END_IF;
IF "AUX FALSE" THEN
"Interlocking_Variables"."MIXER_FILLER_SEND"."PROD_Prod_Load_2" := TRUE;
END_IF;
"Procedure_Variables"."BlendFill_StartUp"."EnBlend" := "AUX FALSE" AND "Procedure_Variables"."First_Production"."Done";
IF "AUX FALSE" AND "Procedure_Variables"."BlendFill_StartUp"."Wait" THEN
"Filler_Head_Variables"."Head_PID_Manual_Value" := "HMI_PID"."PPM303"."FfOut";
END_IF;
IF "AUX FALSE" AND "Procedure_Variables"."BlendFill_StartUp"."Wait" THEN
"gSP_PID_Head_Manual" := TRUE;
END_IF;
// Network 25: STEP 06 (Original Language: LAD)
// mPPM303RampSlewMax = mPPM303RampEndFreq / (Time to end ramp in sec)
"mPPM303RampSlewMax" := "HMI_PID"."PPM303"."FfOut" / 10.0;
// Network 26: STEP 06 (Original Language: LAD)
"mPPM303StartUpRamp"(i_Cycle := "Time_50ms", i_InValue := "HMI_PID"."PPM303"."FfOut", i_SlewMax := "mPPM303RampSlewMax", out := "Filler_Head_Variables"."Head_PID_Manual_Value");
// Network 27: STEP 06 (Original Language: LAD)
IF "gIN_Filler_AVM346_En" THEN
"gSP_AVM346" := TRUE;
END_IF;
// Network 28: STEP 06 (Original Language: LAD)
IF "gIN_Filler_AVM362_En" THEN
"gSP_AVM362" := TRUE;
END_IF;
// Network 29: STEP 06 (Original Language: STL)
// --- BEGIN STL Network 29 ---
A "gIN_FillerEndTankFilling"
= "__PlcmigTempFillBits_10B0"[0]
BLD 103
A "AUX TRUE"
= "__PlcmigTempFillBits_10B0"[1]
BLD 103
A "Procedure_Variables".BlendFill_StartUp.Wait
= "__PlcmigTempFillBits_10B0"[2]
BLD 103
A CLK_0.5S
= "__PlcmigTempFillBits_10B0"[3]
BLD 103
CALL "_StepMove"
A _Statusword_?
JC END
// --- END STL Network 29 ---
// Network 30: STEP 07 (Original Language: LAD)
IF "AUX FALSE" THEN
"mFillerLoadAgain" := FALSE;
END_IF;
IF "AUX FALSE" THEN
"mFillerLoadAfterDrain" := FALSE;
END_IF;
IF "AUX FALSE" THEN
"Procedure_Variables"."BlendFill_StartUp"."EnBlend" := FALSE;
END_IF;
IF "AUX FALSE" THEN
"Interlocking_Variables"."MIXER_FILLER_SEND"."PROD_Prod_Load_2" := FALSE;
END_IF;
IF "AUX FALSE" THEN
"Procedure_Variables"."BlendFill_StartUp"."Done" := TRUE;
END_IF;
// Network 31: SEQUENCER END (Original Language: STL)
// --- BEGIN STL Network 31 ---
END: NOP_0
// --- END STL Network 31 ---
END_FUNCTION
```

View File

@ -0,0 +1,75 @@
```pascal
// Block Type: FC
// Block Name (Original): BlenderCtrl_All Auto
// Block Number: 2036
// Original Network Languages: STL
FUNCTION "BlenderCtrl_All_Auto" : Void
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR_TEMP
Dim_HMI_Device : Int;
PDim_HMI_Device : DWord;
Dim_HMI_PID : Int;
PDim_HMI_PID : DWord;
END_VAR
BEGIN
// Network 1: Devices (Original Language: STL)
// DEVICE
// --- BEGIN STL Network 1 ---
AUF "HMI_Device"
L_DBLG
T "Dim_HMI_Device"
L P#0.0
L "Dim_HMI_Device"
SLD 3
ADD_D
T "PDim_HMI_Device"
L P#0.0
LAR1_ACCU1
M100: SET
S DBX[AR1,P#0.0]
R DBX[AR1,P#0.1]
ADDAR1 P#2.0
TAR1_ACCU1
L "PDim_HMI_Device"
LT_D
JC M100
// --- END STL Network 1 ---
// Network 2: PID (Original Language: STL)
// --- BEGIN STL Network 2 ---
AUF "HMI_PID"
L_DBLG
T "Dim_HMI_PID"
L P#0.0
L "Dim_HMI_PID"
SLD 3
ADD_D
T "PDim_HMI_PID"
L P#0.0
LAR1_ACCU1
M101: SET
R DBX[AR1,P#2.0]
R DBX[AR1,P#3.0]
L 0.0
T DBD[AR1,P#28.0]
ADDAR1 P#76.0
TAR1_ACCU1
L "PDim_HMI_PID"
LT_D
JC M101
// --- END STL Network 2 ---
END_FUNCTION
```

View File

@ -0,0 +1,18 @@
```pascal
// Block Type: FC
// Block Number: 2013
// Original Network Languages: LAD
FUNCTION "BlenderCtrl_CIPModeInit" : Void
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
BEGIN
// Network 1: PID Integral Value Reset (Original Language: LAD)
BlenderPID_PIDResInteg();
END_FUNCTION
```

View File

@ -0,0 +1,29 @@
```pascal
FUNCTION "BlenderCtrl_InitErrors" : Void
{ S7_Optimized_Access := 'FALSE' }
AUTHOR : 'Author'
FAMILY : TASK2
NAME : 'Name'
VERSION : 1.0
BEGIN
IF NOT "Blender_Variables_Pers".gWaterRecipe THEN
"Blender_Variables".gBlendError := "HMI_Blender_Parameters".ProcessSetup._StartUpBrixExtraWater ;
ELSE
"Blender_Variables".gBlendError := 0 ;
END_IF;
IF "Blender_Variables_Pers".gCarboStillRecipe THEN
"Blender_Variables".gCarboCO2Error := "HMI_Blender_Parameters".ProcessSetup._StartUpCO2ExtraWater * "HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Vols * "HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Fact ;
ELSE
"Blender_Variables".gCarboCO2Error := 0 ;
END_IF;
END_FUNCTION
```

View File

@ -0,0 +1,108 @@
```pascal
FUNCTION "BlenderCtrl_MFM Command" : Void
{ S7_Optimized_Access := 'FALSE' }
AUTHOR : 'Author'
FAMILY : TASK2
NAME : 'Name'
VERSION : 1.0
VAR_INPUT
mResetWaterTot : Bool;
mResetSyrupTot : Bool;
mResetCO2Tot : Bool;
mResetProductTot : Bool;
END_VAR
VAR_TEMP
mWaterVFMCtrl : Int;
mSyrupMFMCtrl : Int;
mCO2MFMCtrl : Int;
mProductMFMCtrl : Int;
END_VAR
BEGIN
IF #mResetWaterTot THEN
#mWaterVFMCtrl := 1 ;
ELSE
#mWaterVFMCtrl := 0 ;
END_IF;
IF #mResetSyrupTot THEN
#mSyrupMFMCtrl := 1 ;
ELSE
#mSyrupMFMCtrl := 0 ;
END_IF;
IF #mResetCO2Tot THEN
#mCO2MFMCtrl := 1 ;
ELSE
#mCO2MFMCtrl := 0 ;
END_IF;
IF #mResetProductTot THEN
#mProductMFMCtrl := 1 ;
ELSE
#mProductMFMCtrl := 0 ;
END_IF;
CASE #mWaterVFMCtrl OF
1: "P_FTN301_Tot_Ctrl" := 01; // Reset Totalizer
2: "P_FTN301_Tot_Ctrl" := 02 ; // Preset Totalizer
ELSE:
"P_FTN301_Tot_Ctrl" := 00;
END_CASE;
IF "gSyrupRoomEn" THEN
CASE #mSyrupMFMCtrl OF
1: "P_FTP302_Tot_Ctrl" := 01; (* Reset Totalizer 1*)
2: "P_FTP302_Tot_Ctrl" := 02; (* Reset Totalizer 2*)
3: "P_FTP302_Tot_Ctrl" := 03; (* Reset Totalizer 1 & 2*)
4: "P_FTP302_Tot_Ctrl" := 04; (* Zeropoint Adjust *)
5: "P_FTP302_Tot_Ctrl" := 05; (* Positive Zero Return *)
6: "P_FTP302_Tot_Ctrl" := 06; (* Negative Zero Return *)
ELSE:
"P_FTP302_Tot_Ctrl" := 00;
END_CASE;
END_IF;
CASE #mCO2MFMCtrl OF
1: "P_FTM303_Tot_Ctrl" := 01; (* Reset Totalizer 1*)
2: "P_FTM303_Tot_Ctrl" := 02; (* Reset Totalizer 2 *)
3: "P_FTM303_Tot_Ctrl" := 03; (* Reset Totalizer 1 & 2*)
4: "P_FTM303_Tot_Ctrl" := 04; (* Zeropoint Adjust *)
5: "P_FTM303_Tot_Ctrl" := 05; (* Positive Zero Return *)
6: "P_FTM303_Tot_Ctrl" := 06; (* Negative Zero Return *)
ELSE:
"P_FTM303_Tot_Ctrl" := 00;
END_CASE;
(*CASE mProductMFMCtrl OF
1: gProductTotCtrl_Node17 := 01; (* Reset Totalizer 1*)
2: gProductTotCtrl_Node17 := 02 ; (* Preset Totalizer1 *)
ELSE
gProductTotCtrl_Node17 := 00;
END_CASE;*)
END_FUNCTION
```

View File

@ -0,0 +1,88 @@
```pascal
// Block Type: FC
// Block Number: 2037
// Original Network Languages: STL
FUNCTION "BlenderCtrl_ManualActive" : Void
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR_TEMP
Dim_HMI_Device : Int;
PDim_HMI_Device : DWord;
Dim_HMI_PID : Int;
PDim_HMI_PID : DWord;
END_VAR
BEGIN
// Network 1: Set manual active (Original Language: STL)
// DEVICE
// --- BEGIN STL Network 1 ---
SET
R "HMI_Alarms".gH_Message[3]
// --- END STL Network 1 ---
// Network 2: (Original Language: STL)
// --- BEGIN STL Network 2 ---
AUF "HMI_Device"
L_DBLG
T "Dim_HMI_Device"
L P#0.0
L "Dim_HMI_Device"
SLD 3
ADD_D
T "PDim_HMI_Device"
L P#0.0
LAR1_ACCU1
M100: NOP_0
AUF "HMI_Device"
A DBX[AR1,P#0.7]
AN DBX[AR1,P#0.0]
S "HMI_Alarms".gH_Message[3]
ADDAR1 P#2.0
TAR1_ACCU1
L "PDim_HMI_Device"
LT_D
JC M100
// --- END STL Network 2 ---
// Network 3: (Original Language: STL)
// --- BEGIN STL Network 3 ---
AUF "HMI_PID"
L_DBLG
T "Dim_HMI_PID"
L P#0.0
L "Dim_HMI_PID"
SLD 3
ADD_D
T "PDim_HMI_PID"
L P#0.0
LAR1_ACCU1
M101: NOP_0
AUF "HMI_PID"
A DBX[AR1,P#0.7]
A_BRACK
A DBX[AR1,P#2.0]
O DBX[AR1,P#3.0]
BRACKET
S "HMI_Alarms".gH_Message[3]
ADDAR1 P#76.0
TAR1_ACCU1
L "PDim_HMI_PID"
LT_D
JC M101
// --- END STL Network 3 ---
END_FUNCTION
```

View File

@ -0,0 +1,26 @@
```pascal
// Block Type: FC
// Block Number: 2012
// Original Network Languages: LAD
FUNCTION "BlenderCtrl_ProdModeInit" : Void
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
BEGIN
// Network 1: PID Reset Integral (Original Language: LAD)
BlenderPID_PIDResInteg();
// Network 2: Ctrl Init Errors (Original Language: LAD)
BlenderCtrl_InitErrors();
// Network 3: RunOut Counter (Original Language: LAD)
"HMI_Variables_Status"."Analog_Values"."TP301RunOutCount" := 0.0;
END_FUNCTION
```

View File

@ -0,0 +1,149 @@
```pascal
// Block Type: FC
// Block Number: 2014
// Original Network Languages: STL
// Block Comment:
// TASK2
FUNCTION "BlenderCtrl_ResetSPWord" : Void
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
BEGIN
// Network 1: MIX - Procedure auxiliary variable (Original Language: STL)
// --- BEGIN STL Network 1 ---
CLR
= "gSP_RVN301"
= "gSP_RVN302"
CLR
= "gSP_RVN301_1"
= "gSP_RVN302_1"
CLR
= "gSP_RVP303"
= "gSP_EV04"
CLR
= "gSP_AVM311"
= "gSP_AVM312"
= "gSP_AVM313"
= "gSP_AVM315"
= "gSP_AVM317"
= "gSP_AVM317_1"
= "gSP_AVM321"
= "gSP_AVM322"
= "gSP_AVM323"
= "gSP_AVM326"
= "gSP_AVM327"
= "gSP_AVM328"
= "gSP_AVM329"
= "gSP_AVM330"
= "gSP_AVM339"
= "gSP_AVM340"
= "gSP_AVM341"
= "gSP_AVM342"
= "gSP_AVM345"
= "gSP_AVM346"
= "gSP_AVM362"
= "gSP_AVM363"
= "gSP_AVM366"
= "gSP_AVM367"
= "gSP_AVM368"
= "gSP_AVM369"
= "gSP_AVM353"
= "gSP_AVM371"
= "gSP_AVM372"
= "gSP_AVM380"
= "gSP_AVM381"
= "gSP_AVM385"
= "gSP_AVM386"
= "gSP_AVM388"
= "gSP_AVM389"
= "gSP_AVM391"
= "gSP_AVM396"
= "gSP_AVM397"
CLR
= "gSP_AVN314"
= "gSP_AVN318"
= "gSP_AVN325"
= "gSP_AVN327"
= "gSP_AVN328"
= "gSP_AVN329"
= "gSP_AVN340"
= "gSP_AVN348"
= "gSP_AVN349"
= "gSP_AVN373"
= "gSP_AVN374"
= "gSP_AVN377"
= "gSP_AVN378"
CLR
= "gSP_AVP316"
= "gSP_AVP316_1"
= "gSP_AVP324"
= "gSP_AVP344"
= "gSP_AVP361"
= "gSP_AVP363"
= "gSP_AVP364"
= "gSP_AVP365"
= "gSP_AVP389"
= "gSP_AVP390"
CLR
= "gSP_AVS331"
= "gSP_AVS332"
= "gSP_AVS333"
= "gSP_AVS334"
= "gSP_AVS335"
= "gSP_AVS336"
= "gSP_AVS337"
= "gSP_AVS338"
CLR
= "gSP_EV52"
= "gSP_EV53"
= "gSP_EV54"
= "gSP_AVM353"
= "gSP_EV56"
= "gSP_EV57"
= "gSP_EV58"
= "gSP_EV75"
= "gSP_EV76"
= "gSP_EV77"
= "gSP_EV78"
= "gSP_EV79"
= "gSP_EV83"
CLR
= "gSP_PPN301"
= "gSP_PPP302"
= "gSP_PPM303"
= "gSP_PPN304"
= "gSP_PPN305"
= "gSP_SyrRoomPump"
CLR
= "gSP_BldTankPress_En"
= "gSP_CarboPipe_En"
= "gSP_LimitCO2PressValve"
= "gSP_CIP_Temp_En"
= "gSP_CIP_CO2_Inj"
= "gSP_CIPRunning"
= "gSP_CIPDrainRequest"
= "gSP_CIPHotPhase"
= "gSP_CIPChangeSanitize"
= "gSP_PID_Head_Manual"
= "gSP_PID_Head_Enable"
= "gSP_FillerProdLoad"
= "gSP_FillerProdSend"
// --- END STL Network 1 ---
END_FUNCTION
```

View File

@ -0,0 +1,245 @@
```pascal
// Block Type: FC
// Block Number: 2034
// Original Network Languages: STL
FUNCTION "BlenderCtrl_UpdatePWord" : Void
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
BEGIN
// Network 1: MIX - Procedure auxiliary variable (Original Language: STL)
// --- BEGIN STL Network 1 ---
A "gSP_RVN301"
= "gP_RVN301"
A "gSP_RVN302"
= "gP_RVN302"
A "gSP_RVN301_1"
= "gP_RVN301_1"
A "gSP_RVN302_1"
= "gP_RVN302_1"
A "gSP_RVP303"
= "gP_RVP303"
A "gSP_EV04"
= "gP_EV04"
A "gSP_AVM311"
= "gP_AVM311"
A "gSP_AVM312"
= "gP_AVM312"
A "gSP_AVM313"
= "gP_AVM313"
A "gSP_AVM315"
= "gP_AVM315"
A "gSP_AVM317"
= "gP_AVM317"
A "gSP_AVM317_1"
= "gP_AVM317_1"
A "gSP_AVM321"
= "gP_AVM321"
A "gSP_AVM322"
= "gP_AVM322"
A "gSP_AVM323"
= "gP_AVM323"
A "gSP_AVM326"
= "gP_AVM326"
A "gSP_AVM327"
= "gP_AVM327"
A "gSP_AVM328"
= "gP_AVM328"
A "gSP_AVM329"
= "gP_AVM329"
A "gSP_AVM330"
= "gP_AVM330"
A "gSP_AVM339"
= "gP_AVM339"
A "gSP_AVM340"
= "gP_AVM340"
A "gSP_AVM341"
= "gP_AVM341"
A "gSP_AVM342"
= "gP_AVM342"
A "gSP_AVM345"
= "gP_AVM345"
A "gSP_AVM346"
= "gP_AVM346"
A "gSP_AVM362"
= "gP_AVM362"
A "gSP_AVM363"
= "gP_AVM363"
A "gSP_AVM366"
= "gP_AVM366"
A "gSP_AVM367"
= "gP_AVM367"
A "gSP_AVM368"
= "gP_AVM368"
A "gSP_AVM369"
= "gP_AVM369"
A "gSP_AVM371"
= "gP_AVM371"
A "gSP_AVM372"
= "gP_AVM372"
A "gSP_AVM380"
= "gP_AVM380"
A "gSP_AVM381"
= "gP_AVM381"
A "gSP_AVM385"
= "gP_AVM385"
A "gSP_AVM386"
= "gP_AVM386"
A "gSP_AVM388"
= "gP_AVM388"
A "gSP_AVM389"
= "gP_AVM389"
A "gSP_AVM391"
= "gP_AVM391"
A "gSP_AVM396"
= "gP_AVM396"
A "gSP_AVM397"
= "gP_AVM397"
A "gSP_AVN314"
= "gP_AVN314"
A "gSP_AVN318"
= "gP_AVN318"
A "gSP_AVN325"
= "gP_AVN325"
A "gSP_AVN327"
= "gP_AVN327"
A "gSP_AVN328"
= "gP_AVN328"
A "gSP_AVN329"
= "gP_AVN329"
A "gSP_AVN339"
= "gP_AVN339"
A "gSP_AVN340"
= "gP_AVN340"
A "gSP_AVN348"
= "gP_AVN348"
A "gSP_AVN349"
= "gP_AVN349"
A "gSP_AVN373"
= "gP_AVN373"
A "gSP_AVN374"
= "gP_AVN374"
A "gSP_AVN377"
= "gP_AVN377"
A "gSP_AVN378"
= "gP_AVN378"
A "gSP_AVP316"
= "gP_AVP316"
A "gSP_AVP316_1"
= "gP_AVP316_1"
A "gSP_AVP324"
= "gP_AVP324"
A "gSP_AVP344"
= "gP_AVP344"
A "gSP_AVP361"
= "gP_AVP361"
A "gSP_AVP363"
= "gP_AVP363"
A "gSP_AVP364"
= "gP_AVP364"
A "gSP_AVP365"
= "gP_AVP365"
A "gSP_AVS331"
= "gP_AVS331"
A "gSP_AVS332"
= "gP_AVS332"
A "gSP_AVS333"
= "gP_AVS333"
A "gSP_AVS334"
= "gP_AVS334"
A "gSP_AVS335"
= "gP_AVS335"
A "gSP_AVS336"
= "gP_AVS336"
A "gSP_AVS337"
= "gP_AVS337"
A "gSP_AVS338"
= "gP_AVS338"
A "gSP_EV52"
= "gP_EV52"
A "gSP_EV53"
= "gP_EV53"
A "gSP_EV54"
= "gP_EV54"
A "gSP_AVM353"
= "gP_AVM353"
A "gSP_EV56"
= "gP_EV56"
A "gSP_EV57"
= "gP_EV57"
A "gSP_EV58"
= "gP_EV58"
A "gSP_EV75"
= "gP_EV75"
A "gSP_EV76"
= "gP_EV76"
A "gSP_EV77"
= "gP_EV77"
A "gSP_EV78"
= "gP_EV78"
A "gSP_EV79"
= "gP_EV79"
A "gSP_EV83"
= "gP_EV83"
A "gSP_AVP389"
= "gP_AVP389"
A "gSP_AVP390"
= "gP_AVP390"
A "gSP_PPN301"
= "gP_PPN301"
A "gSP_PPP302"
= "gP_PPP302"
A "gSP_PPM303"
= "gP_PPM303"
A "gSP_PPN304"
= "gP_PPN304"
A "gSP_PPN305"
= "gP_PPN305"
A "gSP_SyrRoomPump"
= "gP_SyrRoomPump"
A "gSP_BldTankPress_En"
= "gP_BldTankPress_En"
A "gSP_CarboPipe_En"
= "gP_CarboPipe_En"
A "gSP_LimitCO2PressValve"
= "gP_LimitCO2PressValve"
A "gSP_CIP_Temp_En"
= "gP_CIP_Temp_En"
A "gSP_CIP_CO2_Inj"
= "gP_CIP_CO2_Inj"
A "gSP_CIPRunning"
= "gP_CIPRunning"
A "gSP_CIPDrainRequest"
= "gP_CIPDrainRequest"
A "gSP_CIPHotPhase"
= "gP_CIPHotPhase"
A "gSP_CIPChangeSanitize"
= "gP_CIPChangeSanitize"
A "gSP_PID_Head_Manual"
= "gP_PID_Head_Manual"
A "gSP_PID_Head_Enable"
= "gP_PID_Head_Enable"
A "gSP_FillerProdLoad"
= "gP_FillerProdLoad"
A "gSP_FillerProdSend"
= "gP_FillerProdSend"
// --- END STL Network 1 ---
END_FUNCTION
```

View File

@ -0,0 +1,389 @@
```pascal
// Block Type: FC
// Block Number: 2000
// Original Network Languages: LAD
FUNCTION "BlenderCtrl__Main" : Void
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR_TEMP
All_Auto_RETVAL : Int;
Reset_SP_Word_RETVAL : Int;
mResetWaterTot : Bool;
mResetSyrupTot : Bool;
mResetCO2Tot : Bool;
mResetProductTot : Bool;
Block_Move_Err : Int;
END_VAR
#_1S : Bool; // Auto-generated temporary
#_2S : Bool; // Auto-generated temporary
BEGIN
// Network 1: Clock Generation (Original Language: LAD)
Clock_Signal();
// Network 2: Machine Init (Original Language: LAD)
BlenderCtrl_MachineInit();
// Network 3: Filler Head (Original Language: LAD)
IF "AUX FALSE" THEN
"Block_Move_Err" := BLKMOV(SRCBLK := "HMI_PID"."PPM303", DSTBLK => "Filler_Head_Variables"."FillerHead"); // ADVERTENCIA: BLKMOV usado directamente, probablemente no compile!
END_IF;
// Network 4: Emergency Pressed (Original Language: LAD)
// Edge Logic handled by Coil 26
"M19000" := "gIN_VoltageOk"; // N_TRIG("gIN_VoltageOk") - Mem: "M19000"
"gEmergencyPressed" := "M19000" AND NOT "gIN_VoltageOk";
"M19000" := "gIN_VoltageOk"; // N_TRIG("gIN_VoltageOk") - Mem: "M19000"
// Network 5: Air and CO2 pressure ok and auxiliary ok (Original Language: LAD)
"gBlenderSuppliesOk" := ("gIN_VoltageOk" AND "gIN_LinePressCO2Ok" AND "HMI_Digital"."_PAL_S11"."Filtered") OR ("gIN_VoltageOk" AND "gIN_LinePressCO2Ok" AND "Disable_Bit") OR ("gIN_VoltageOk" AND "gWorkshopTest" AND "gWorkshop_Co2_Presence" AND "gWorkshop_CIP_Signals" AND "HMI_Digital"."_PAL_S11"."Filtered") OR ("gIN_VoltageOk" AND "gWorkshopTest" AND "gWorkshop_Co2_Presence" AND "gWorkshop_CIP_Signals" AND "Disable_Bit");
// Network 6: Blender State Num (Original Language: LAD)
"HMI_Variables_Status"."Procedures"."BlenderStateNum" := 0;
// Network 7: Delay Power On (Original Language: LAD)
"mDelayPowerOnTmr"(IN := "FirstScan", PT := S5T#2S); // TODO: Declarar "mDelayPowerOnTmr" : TP;
// Network 8: Production Mode (Original Language: LAD)
"gBlenderProdMode" := "HMI_Variables_Status"."System"."Blender_Prod_CIP";
// Network 9: CIp Mode (Original Language: LAD)
"gBlenderCIPMode" := "HMI_Variables_Status"."System"."Blender_Prod_CIP";
IF "HMI_Variables_Status"."System"."Blender_Prod_CIP" THEN
"HMI_Variables_Status"."Procedures"."BlenderStateNum" := 19;
END_IF;
// Network 10: Error Faults (Original Language: LAD)
IF "AUX FALSE" THEN
"HMI_Variables_Status"."Meters"."QTM3012_PRD_Fault" := FALSE;
END_IF;
IF "AUX FALSE" THEN
"gmPDS2000_Error_Fault" := FALSE;
END_IF;
IF "AUX FALSE" THEN
"HMI_Variables_Status"."Meters"."QTM3012_PRD_Run" := FALSE;
END_IF;
IF "AUX FALSE" THEN
"gNoFreezeProductMeter" := FALSE;
END_IF;
// Network 11: Filler Bottle Count Used to push Product (Original Language: LAD)
"System_RunOut_Variables"."ProdPipeRunOutFillerBott" := "System_RunOut_Variables"."ProdPipeRunOutWaterCount";
// Network 12: Water Bypass Enable (Original Language: LAD)
"gStillWaterByPassEn" := ("HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_StillWaterByPass" AND "Blender_Variables_Pers"."gWaterRecipe" AND "Blender_Variables_Pers"."gCarboStillRecipe") OR ("HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_ByPassDeair" AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Deaireation" AND "Blender_Variables_Pers"."gWaterRecipe" AND "Blender_Variables_Pers"."gCarboStillRecipe");
// Network 13: Still Water Bypass (Original Language: LAD)
"gBlendFiStillWaterByPass" := "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_StillWaterByPass" AND "Blender_Variables_Pers"."gWaterRecipe" AND "Blender_Variables_Pers"."gCarboStillRecipe" AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_BlendFillSystem";
// Network 14: Manual Syrup Drain Valve Open - Operator Alarm (Original Language: LAD)
"gHVP301_Open" := ("gSyrupRoomEn" AND "gIN_HVP301_Aux" AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_FastChangeOverEnabled" AND "Procedure_Variables"."FTP302Line_Preparation"."Done" AND "Procedure_Variables"."Syr_RunOut"."Done") OR ("gSyrupRoomEn" AND "gIN_HVP301_Aux" AND "gBlenderCIPMode" AND "gIN_CIP_CIPRunning" AND "Procedure_Variables"."Blender_Run"."Running");
// Network 15: Manual Syrup Drain Valve Open - Operator Alarm (Original Language: LAD)
"mHVM302_Dly"(IN := "gIN_HVM302_Aux", PT := S5T#1S); // TODO: Declarar "mHVM302_Dly" : TON;
"gHVM302_Open" := "mHVM302_Dly".Q;
// Network 16: Maselli Control (Original Language: LAD)
IF Eq("HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_MeterType", 6) THEN
Maselli_PA_Control();
END_IF;
// Network 17: mPDS Control (Original Language: LAD)
IF Eq("HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_MeterType", 5) THEN
mPDS_PA_Control();
END_IF;
// Network 18: mPDS Syrup Control (Original Language: LAD)
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_SyrBrixMeter" THEN
mPDS_SYR_PA_Control();
END_IF;
// Network 19: Co2 Analog Input (Original Language: LAD)
// GetProdBrixCO2_FromAnalogIn
// CALL "GetProdBrixCO2_FromAn"
// NOP 0
IF Eq("HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_MeterType", 3) THEN
GetProdBrixCO2_Anal_Inpt();
END_IF;
// Network 20: Quality (Original Language: LAD)
ProductQuality();
// Network 21: Input Data (Original Language: LAD)
"Input_Data"();
// Network 22: Sel Brix Source Check (Original Language: LAD)
SelCheckBrixSource();
// Network 23: Check Water Cooling System Temperature (Original Language: LAD)
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_InverterRecirPumpPPM306" THEN
CTRLCoolingSystem();
END_IF;
// Network 24: Tank Level (Original Language: LAD)
TankLevel();
// Network 25: Production ONS (Original Language: LAD)
// PBox SymPy processed, logic in consumer
"M19001" := "gBlenderProdMode"; // P_TRIG("gBlenderProdMode") - Mem: "M19001"
"gProductionONS" := "gBlenderProdMode" AND "mDelayPowerOnTmr" AND NOT "M19001";
// Network 26: Blender Prod Mode Init (Original Language: LAD)
IF ("gProductionONS" AND "Blender_Variables_Pers"."gBlenderStarted") OR ("Procedure_Variables"."Blender_Rinse"."ONS_Done" AND "Blender_Variables_Pers"."gBlenderStarted") THEN
BlenderCtrl_ProdModeInit();
END_IF;
// Network 27: Rinse ONS (Original Language: LAD)
// PBox SymPy processed, logic in consumer
"M19002" := "HMI_Variables_Status"."System"."Blender_Prod_CIP"; // P_TRIG("HMI_Variables_Status"."System"."Blender_Prod_CIP") - Mem: "M19002"
"gRinseONS" := "mDelayPowerOnTmr" AND "HMI_Variables_Status"."System"."Blender_Prod_CIP" AND NOT "M19002";
// Network 28: CIP ONS (Original Language: LAD)
// PBox SymPy processed, logic in consumer
"M19003" := "gBlenderCIPMode"; // P_TRIG("gBlenderCIPMode") - Mem: "M19003"
"gCIPONS" := "gBlenderCIPMode" AND "mDelayPowerOnTmr" AND NOT "M19003";
// Network 29: CIp Mode Init (Original Language: LAD)
IF "gCIPONS" THEN
BlenderCtrl_CIPModeInit();
END_IF;
// Network 30: Reset SPWords (Original Language: LAD)
BlenderCtrl_ResetSPWord();
// Network 31: Blender Run Control (Original Language: LAD)
BlenderRun__Control();
// Network 32: Tank Pressure Control (Original Language: LAD)
Prod_Tank_PressCtrl();
// Network 33: Balaiage (Original Language: LAD)
Baialage();
// Network 34: First Production (Original Language: LAD)
"FirstProduction_Data"();
// Network 35: CIP MAIN Calling (Original Language: LAD)
CIPMain();
// Network 36: Blender Rinse (Original Language: LAD)
BlenderRinse();
// Network 37: Safeties (Original Language: LAD)
Safeties();
// Network 38: Instrument Scanner (Original Language: LAD)
Instrument_Scanner();
// Network 39: Vacuum Control (Original Language: LAD)
VacuumCtrl();
// Network 40: Syrup Room Control (Original Language: LAD)
SyrupRoomCtrl();
// Network 41: Blend Procedure Data (Original Language: LAD)
IF "mDelayPowerOnTmr" THEN
"Blender_Procedure Data"();
END_IF;
// Network 42: Pneumatic Valve Control (Original Language: LAD)
Pneumatic_Valve_Ctrl();
// Network 43: Pumps Control (Original Language: LAD)
PumpsControl();
// Network 44: Prod Report Manager (Original Language: LAD)
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Report" THEN
ProdReportManager();
END_IF;
// Network 45: Outputs (Original Language: LAD)
Output();
// Network 46: SLIM BLOCK (Original Language: LAD)
SLIM_Block();
// Network 47: Interlocking Panel 1 (Original Language: LAD)
Interlocking_Panel_1();
// Network 48: Filler Control (Original Language: LAD)
FillerControl();
// Network 49: Blender Ctrl Update PWORD (Original Language: LAD)
BlenderCtrl_UpdatePWord();
// Network 50: ResetTotalizer (Original Language: LAD)
"mResetTotalizerTmr"(IN := "gBlendResetTotalizer", PT := S5T#2S); // TODO: Declarar "mResetTotalizerTmr" : TP;
// Network 51: ResetWaterTot (Original Language: LAD)
"mResetFTN301TotTmr"(IN := "gFTN301_ResetTot" OR "mResetTotalizerTmr", PT := S5T#2S); // TODO: Declarar "mResetFTN301TotTmr" : TP;
"mResetWaterTot" := "mResetFTN301TotTmr".Q;
// Network 52: Water VFM Reset Totalizer (Original Language: LAD)
IF "gFTN301_ResetTot" THEN
"gFTN301_ResetTot" := FALSE;
END_IF;
// Network 53: ResetCO2Tot (Original Language: LAD)
"mResetFTP302TotTmr"(IN := "mResetTotalizerTmr" OR "gFTP302_ResetTot", PT := S5T#2S); // TODO: Declarar "mResetFTP302TotTmr" : TP;
"mResetSyrupTot" := "gSyrupRoomEn" AND "mResetFTP302TotTmr".Q;
// Network 54: Syrup MFM Reset Totalizer (Original Language: LAD)
IF "gFTP302_ResetTot" THEN
"gFTP302_ResetTot" := FALSE;
END_IF;
// Network 55: ResetProductTot (Original Language: LAD)
"mResetFTM303TotTmr"(IN := "mResetTotalizerTmr" OR "gFTM303_ResetTot", PT := S5T#2S); // TODO: Declarar "mResetFTM303TotTmr" : TP;
"mResetCO2Tot" := "mResetFTM303TotTmr".Q;
// Network 56: CO2 MFM Reset Tot (Original Language: LAD)
IF "gFTM303_ResetTot" THEN
"gFTM303_ResetTot" := FALSE;
END_IF;
// Network 57: ResetCO2Tot (Original Language: LAD)
"mResetProductTotTmr"(IN := "mResetTotalizerTmr" OR "gProductMFMResetTot", PT := S5T#2S); // TODO: Declarar "mResetProductTotTmr" : TP;
"mResetProductTot" := "mResetProductTotTmr".Q;
// Network 58: Reset Totalizer (Original Language: LAD)
IF "gProductMFMResetTot" THEN
"gProductMFMResetTot" := FALSE;
END_IF;
// Network 59: Reset Totalizer (Original Language: LAD)
IF "gBlendResetTotalizer" THEN
"gBlendResetTotalizer" := FALSE;
END_IF;
// Network 60: Blender Ctrl Command (Original Language: LAD)
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" THEN
BlenderCtrl_MFM_Command(mResetCO2Tot := "mResetCO2Tot", mResetProductTot := "mResetProductTot", mResetSyrupTot := "mResetSyrupTot", mResetWaterTot := "mResetWaterTot");
END_IF;
// Network 61: DP Global Diag (Original Language: LAD)
CPU_DP_Global_Diag();
// Network 62: Profibus (Original Language: LAD)
Profibus_Network();
// Network 63: Valve Fault (Original Language: LAD)
ModValveFault();
// Network 64: All Auto (Original Language: LAD)
// NBox SymPy processed, logic in consumer
"M19011" := "HMI_Variables_Cmd"."Commands_From_HMI"."F7_DeviceControl"."Command" AND "HMI_Variables_Cmd"."Commands_From_HMI"."F7_DeviceControl"."Enable"; // N_TRIG("HMI_Variables_Cmd"."Commands_From_HMI"."F7_DeviceControl"."Command" AND "HMI_Variables_Cmd"."Commands_From_HMI"."F7_DeviceControl"."Enable") - Mem: "M19011"
IF ("M19011" AND NOT "HMI_Variables_Cmd"."Commands_From_HMI"."F7_DeviceControl"."Command") OR ("M19011" AND NOT "HMI_Variables_Cmd"."Commands_From_HMI"."F7_DeviceControl"."Enable") THEN
BlenderCtrl_All_Auto();
END_IF;
"HMI_Variables_Cmd"."Commands_From_HMI"."F7_DeviceControl"."Light" := "HMI_Variables_Cmd"."Commands_From_HMI"."F7_DeviceControl"."Command" AND "HMI_Variables_Cmd"."Commands_From_HMI"."F7_DeviceControl"."Enable";
// Network 65: Ctrl HMI Manual Active (Original Language: LAD)
BlenderCtrl_ManualActive();
// Network 66: Mod Copy Recipe (Original Language: LAD)
"mAux_FP_M700_1" := "HMI_Variables_Cmd"."Recipe"."Main_Page" AND "mFP_Recip_Main_Page";
"mFP_Recip_Main_Page" := "HMI_Variables_Cmd"."Recipe"."Main_Page";
IF "mAux_FP_M700_1" THEN
"HMI_Variables_Cmd"."Recipe"."Edit" := TRUE;
END_IF;
// Network 67: to HMI - Recipe Management (Original Language: LAD)
IF "AUX TRUE" THEN
"RecipeManagement_Data"(Active_Recipe_Req := "HMI_Variables_Cmd"."Recipe"."Active_Request", Active_Recipe_Running := "HMI_Variables_Cmd"."Recipe"."Active_Recipe_Running", Active_Recipe_Start := "HMI_Variables_Cmd"."Recipe"."Active_Recipe_Start", Copy := "HMI_Variables_Cmd"."Recipe"."Copy", Copy_to := "HMI_Variables_Cmd"."Recipe"."Copy_Request", Delete := "HMI_Variables_Cmd"."Recipe"."Delete", Download := "HMI_Variables_Cmd"."Recipe"."Download", Edit := "HMI_Variables_Cmd"."Recipe"."Edit", HMI_Recipe_Main_Page := "HMI_Variables_Cmd"."Recipe"."Main_Page", HMI_Recipe_Page_Running := "HMI_Variables_Cmd"."Recipe"."Page_Running", Max_Recipe_Number := 50, Read := "HMI_Variables_Cmd"."Recipe"."Read", Upload := "HMI_Variables_Cmd"."Recipe"."Upload", UploadPC := "HMI_Variables_Cmd"."Recipe"."UploadPC", Work_Recipe := "HMI_Variables_Cmd"."Recipe"."Edit_Request", Write := "HMI_Variables_Cmd"."Recipe"."Write");
END_IF;
// Network 68: Recipe Calculation (Original Language: LAD)
RecipeCalculation();
END_FUNCTION
```

View File

@ -0,0 +1,97 @@
```pascal
// Block Type: FB
// Block Number: 1787
// Original Network Languages: LAD
FUNCTION_BLOCK "BlenderPIDCtrl_Monitor"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR_INPUT
i_Value : Real;
i_Cols : Int;
i_Rows : Int;
END_VAR
VAR_OUTPUT
MeanValue : Real;
Variance : Real;
Std_Deviation : Real;
END_VAR
VAR_STAT
Water_Stat : "Statistical_Analisys";
Syrup_Stat : "Statistical_Analisys";
Carbo_CO2_Stat : "Statistical_Analisys";
Gas2_Stat : "Statistical_Analisys";
END_VAR
BEGIN
// Network 1: Water Statistic analisys (Original Language: LAD)
"Water_Stat"(i_Cols := 14, i_Rows := 1, i_Value := "HMI_PID"."RMM301"."Out");
// Network 2: Water Values (Original Language: LAD)
"HMI_Service"."PID_Monitoring"."_RMM301_MeanValue" := "Blender_Variables"."gWaterStat_MeanValue";
"HMI_Service"."PID_Monitoring"."_RMM301_Variance" := "Blender_Variables"."gWaterStat_Variance";
"HMI_Service"."PID_Monitoring"."_RMM301_StdDev" := "Blender_Variables"."gWaterStat_DevStd";
// Network 3: Water PID Controlling Ok (Original Language: LAD)
// Network 3 did not produce printable SCL code.
// Network 4: Syrup Statistic analisys (Original Language: LAD)
"Syrup_Stat"(i_Cols := 14, i_Rows := 1, i_Value := "HMI_PID"."RMP302"."Out");
// Network 5: Syrup Values (Original Language: LAD)
"HMI_Service"."PID_Monitoring"."_RMP302_MeanValue" := "Blender_Variables"."gSyrupStat_MeanValue";
"HMI_Service"."PID_Monitoring"."_RMP302_Variance" := "Blender_Variables"."gSyrupStat_Variance";
"HMI_Service"."PID_Monitoring"."_RMP302_StdDev" := "Blender_Variables"."gSyrupStat_DevStd";
// Network 6: Syrup PID Controlling Ok (Original Language: LAD)
// Network 6 did not produce printable SCL code.
// Network 7: Co2 Statistic analisys (Original Language: LAD)
"Carbo_CO2_Stat"(i_Cols := 12, i_Rows := 1, i_Value := "HMI_PID"."RMM303"."Out");
// Network 8: Co2 Values (Original Language: LAD)
"HMI_Service"."PID_Monitoring"."_RMM303_MeanValue" := "Blender_Variables"."gCarboCO2Stat_MeanValue";
"HMI_Service"."PID_Monitoring"."_RMM303_Variance" := "Blender_Variables"."gCarboCO2Stat_Variance";
"HMI_Service"."PID_Monitoring"."_RMM303_StdDev" := "Blender_Variables"."gCarboCO2Stat_DevStd";
// Network 9: CO2 PID Controlling Ok (Original Language: LAD)
// Network 9 did not produce printable SCL code.
// Network 10: Gas2 Statistic analisys (Original Language: LAD)
"Gas2_Stat"(i_Cols := 12, i_Rows := 1, i_Value := "HMI_PID"."RMM304"."Out");
// Network 11: Gas2 Values (Original Language: LAD)
"HMI_Service"."PID_Monitoring"."_RMM304_MeanValue" := "Blender_Variables"."gGAS2Stat_MeanValue";
"HMI_Service"."PID_Monitoring"."_RMM304_Variance" := "Blender_Variables"."gGAS2Stat_Variance";
"HMI_Service"."PID_Monitoring"."_RMM304_StdDev" := "Blender_Variables"."gGAS2Stat_DevStd";
// Network 12: Gas2 PID Controlling Ok (Original Language: LAD)
// Network 12 did not produce printable SCL code.
END_FUNCTION_BLOCK
```

View File

@ -0,0 +1,34 @@
```pascal
FUNCTION "BlenderPIDCtrl_PresRelea" : Void
{ S7_Optimized_Access := 'FALSE' }
AUTHOR : 'Author'
FAMILY : TASK1
NAME : 'Name'
VERSION : 1.0
BEGIN
"Blender_Variables".gPrdTankPressError := "HMI_PID".RVM301.Sp - "HMI_PID".RVM301.Pv ;
IF "HMI_PID".RVM301.KP > 0 AND NOT "HMI_PID".RVM301.ManualControl.ManOut AND "Procedure_Variables".TM301_Pressure.Qualifier THEN (* Product Tank Pressure Release *)
IF "Blender_Variables".gPrdTankPressError < 0 THEN
IF "gBlenderTankPress_Ok" OR "gFirstProdPressHold" THEN
"PID_Variables".PID_RVM301_Release := FALSE;
// "HMI_PID".VEP1.ManualControl.ManOut := FALSE ;
ELSE
(* classic code: "HMI_PID".RVM301.OutMan := 0.0 ;*)
"HMI_PID".RVM301.OutMan := REAL#0.0;
// "HMI_PID".VEP1.ManualControl.ManOut := TRUE ;
"PID_Variables".PID_RVM301_Release := TRUE;
END_IF;
ELSE
"PID_Variables".PID_RVM301_Release := FALSE;
// "HMI_PID".VEP1.ManualControl.ManOut := FALSE ;
END_IF;
END_IF;
END_FUNCTION
```

View File

@ -0,0 +1,172 @@
```pascal
// Block Type: FB
// Block Number: 1790
// Original Network Languages: LAD
// Block Comment:
// TASK1 PID
FUNCTION_BLOCK "BlenderPIDCtrl_ReadAnIn"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR_INPUT
i_Value : Real;
i_Num : Int;
i_Enable : Bool;
END_VAR
VAR_OUTPUT
FilterOut : Real;
END_VAR
VAR_STAT
mDiffSensFaultEnON : Bool;
mProdTnkPressFlted : "LowPassFilter";
mWaterTempFlted : "LowPassFilter";
mProdTempFlted : "LowPassFilter";
mSyrupTnkLvlFlted : "LowPassFilter";
mCIPHeatTempFlted : "LowPassFilter";
mP3_Freq_Flted : "LowPassFilter";
mFlrFreqPrdctPump : "LowPassFilter";
mDiffTrasducerFlted : "LowPassFilter";
mInletSirupPress : "LowPassFilter";
mDeairTnkLvlFlted : "LowPassFilter";
mBaialageFlowFlted : "LowPassFilter";
mDiffSensFaultEn : STRUCT
PT : Time;
ET : Time;
IN : Bool;
Q : Bool;
END_STRUCT;
END_VAR
VAR_TEMP
RealTemp : Real;
mH_Fault : Bool;
mL_Fault : Bool;
mDummy : Bool;
mDifferentialTrasducer : Word;
END_VAR
#_0 : Bool; // Auto-generated temporary
#_27648 : Bool; // Auto-generated temporary
#_2S : Bool; // Auto-generated temporary
#TON_INSTANCE_30 : Bool; // Auto-generated temporary
BEGIN
// Network 1: Product Tank Pressure (Original Language: LAD)
// Product Tank Pressure
// DB972.DBW36 = 27648
ReadAnalogIn(ANALOG := "HMI_Instrument"."PTM304", MAX_Analog_Value := "Blender_Constants"."gAnalogMaxValue", MIN_Analog_Value := 0, PEW := "P_AI_PTM304");
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" THEN
"mProdTnkPressFlted"(i_Enable := "AUX TRUE", i_Num := 3, i_Value := "HMI_Instrument"."PTM304"."PV");
END_IF;
"mDummy" := TRUE;
// Network 2: Syrup Tank Level (Original Language: LAD)
ReadAnalogIn(ANALOG := "HMI_Instrument"."LTP303", MAX_Analog_Value := "Blender_Constants"."gAnalogMaxValue", MIN_Analog_Value := 0, PEW := "P_AI_LTP303");
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" THEN
"mSyrupTnkLvlFlted"(i_Enable := "AUX TRUE", i_Num := 3, i_Value := "HMI_Instrument"."LTP303"."PV");
END_IF;
"mDummy" := TRUE;
// Network 3: Chiller Temperature (Original Language: LAD)
IF "AUX FALSE" THEN
ReadAnalogIn(ANALOG := "HMI_Instrument"."TTM306_H2O", MAX_Analog_Value := "Blender_Constants"."gAnalogMaxValue", MIN_Analog_Value := 0, PEW := "P_AI_TTM306");
END_IF;
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" THEN
"mWaterTempFlted"(i_Enable := "AUX TRUE", i_Num := 10, i_Value := "HMI_Instrument"."TTM306_H2O"."PV");
END_IF;
"mDummy" := "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" OR "AUX FALSE";
// Network 4: Chiller Temperature (Original Language: LAD)
ReadAnalogIn(ANALOG := "HMI_Instrument"."TTM306_PRD", MAX_Analog_Value := "Blender_Constants"."gAnalogMaxValue", MIN_Analog_Value := 0, PEW := "P_AI_TTM306");
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" THEN
"mProdTempFlted"(i_Enable := "AUX TRUE", i_Num := 10, i_Value := "HMI_Instrument"."TTM306_PRD"."PV");
END_IF;
"mDummy" := TRUE;
// Network 5: Cip Heating Temperature (Original Language: LAD)
IF "AUX FALSE" AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Conductimeter_Profibus" THEN
ReadAnalogIn(ANALOG := "HMI_Instrument"."TT_S5", MAX_Analog_Value := "Blender_Constants"."gAnalogMaxValue", MIN_Analog_Value := 0, PEW := "P_AI_CIPHeaterTemperature");
END_IF;
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" THEN
"mCIPHeatTempFlted"(i_Enable := "AUX TRUE", i_Num := 10, i_Value := "HMI_Instrument"."TT_S5"."PV");
END_IF;
"mDummy" := "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" OR ("AUX FALSE" AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Conductimeter_Profibus");
// Network 6: Differential Trasducer (Original Language: LAD)
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_BlendFillSystem" THEN
"mDifferentialTrasducer" := "P_AI_PTF203";
END_IF;
IF "mDifferentialTrasducer" <= 0 THEN
"mDifferentialTrasducer" := INT#0;
END_IF;
IF "mDifferentialTrasducer" > 27648 THEN
"mDifferentialTrasducer" := INT#27648;
END_IF;
// Network 7: Differential Pressure (Original Language: LAD)
IF "HMI_Instrument"."PTF203"."Config" THEN
ReadAnalogIn(ANALOG := "HMI_Instrument"."PTF203", MAX_Analog_Value := "Blender_Constants"."gAnalogMaxValue", MIN_Analog_Value := 0, PEW := "mDifferentialTrasducer");
END_IF;
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" THEN
"mDiffTrasducerFlted"(i_Enable := "AUX TRUE", i_Num := 4, i_Value := "HMI_Instrument"."PTF203"."PV");
END_IF;
"mDummy" := "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" OR "HMI_Instrument"."PTF203"."Config";
// Network 8: Differential Pressure Fault (Original Language: LAD)
#TON_INSTANCE_30(IN := "gIN_ResetBtn" AND "Procedure_Variables"."BlendFill_StartUp"."Done", PT := T#2S); // TODO: Declarar #TON_INSTANCE_30 : TON;
"gDiffSensor_Analog_Fault" := #TON_INSTANCE_30.Q AND "mDiffSensFaultEnON" AND "HMI_Instrument"."PTF203"."Alarm" AND "gWorkshopTest";
// Network 9: Syrup Inlet Pressure (Original Language: LAD)
IF "HMI_Instrument"."PTP338"."Config" THEN
ReadAnalogIn(ANALOG := "HMI_Instrument"."PTP338", MAX_Analog_Value := "Blender_Constants"."gAnalogMaxValue", MIN_Analog_Value := 0, PEW := "P_AI_PTP338");
END_IF;
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" THEN
"mInletSirupPress"(i_Enable := "AUX TRUE", i_Num := 5, i_Value := "HMI_Instrument"."PTP338"."PV");
END_IF;
"mDummy" := "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" OR "HMI_Instrument"."PTP338"."Config";
// Network 10: TTS305 - Local Cip Heating Temperature (Original Language: LAD)
IF "AUX TRUE" THEN
ReadAnalogIn(ANALOG := "HMI_Instrument"."FTM305", MAX_Analog_Value := "Blender_Constants"."gAnalogMaxValue", MIN_Analog_Value := 0, PEW := "P_AI_FTM305");
END_IF;
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" THEN
"mBaialageFlowFlted"(i_Enable := "AUX TRUE", i_Num := 5, i_Value := "HMI_Instrument"."FTM305"."PV");
END_IF;
"mDummy" := "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" OR "AUX TRUE";
END_FUNCTION_BLOCK
```

View File

@ -0,0 +1,233 @@
```pascal
FUNCTION_BLOCK "BlenderPIDCtrl_SaveInteg"
{ S7_Optimized_Access := 'FALSE' }
AUTHOR : 'Author'
FAMILY : TASK1
NAME : 'Name'
VERSION : 1.0
VAR
mMinProd : Bool;
Timer135En : Bool;
Timer136En : Bool;
Timer137En : Bool;
Timer144En : Bool;
Timer145En : Bool;
Timer146En : Bool;
END_VAR
VAR_TEMP
ValBinTmr135 : Word;
ValBcdTmr135 : S5Time;
ValBinTmr136 : Word;
ValBcdTmr136 : S5Time;
ValBinTmr137 : Word;
ValBcdTmr137 : S5Time;
ValBinTmr144 : Word;
ValBcdTmr144 : S5Time;
ValBinTmr145 : Word;
ValBcdTmr145 : S5Time;
ValBinTmr146 : Word;
ValBcdTmr146 : S5Time;
END_VAR
BEGIN
(* This block save the Integral Component for each PID when the prod flow is minimum *)
(* for the next blender start, that is at minimum speed *)
(* classic code: IF ABS("Blender_Variables".gActual_Prod_SP - "Blender_Variables".gMinProduction) < 0.1 * "Blender_Variables".gMinProduction THEN*)
IF ABS("Blender_Variables".gActual_Prod_SP - "Blender_Variables".gMinProduction) < REAL#0.1 * "Blender_Variables".gMinProduction THEN
#mMinProd := TRUE ;
ELSE
#mMinProd := FALSE ;
END_IF;
"ONS_R"(Enable_ONS := "HMI_PID".RMM301.ManualControl.PidEnable,
Aux_ONS := "mRMM301_Int_Init",
ONS_R => "mRMM301_Int_ONS" );
#Timer135En := #mMinProd;
IF "HMI_PID".RMM301.ManualControl.PidEnable THEN
#ValBcdTmr135:= S_ODT (T_NO := "mSaveRMM301_IntTON",
S := #Timer135En,
TV := s5time#20s,
R := "AUX FALSE",
BI => #ValBinTmr135,
Q => "mSaveRMM301_IntTON.Q");
IF "mSaveRMM301_IntTON.Q" AND "gRMM301_PIDCtrlOk" THEN
"PID_Variables".RMM301PIDIntValue := "mPID_RMM301_Int" ;
"HMI_PID".RMM301.I_ITLVAL := "PID_Variables".RMM301PIDIntValue ;
#Timer135En := FALSE ;
END_IF;
ELSE
#Timer135En := FALSE ;
END_IF;
IF "HMI_PID".RMM301.High_Limit OR "HMI_PID".RMM301.Low_Limit THEN
(* classic code: "HMI_PID".RMM301.I_ITLVAL := 0.0 ;*)
"HMI_PID".RMM301.I_ITLVAL := REAL#0.0 ;
END_IF;
IF "mRMM301_Int_ONS" THEN
"HMI_PID".RMM301.I_ITL := TRUE ;
END_IF;
"ONS_R"(Enable_ONS := "HMI_PID".RMP302.ManualControl.PidEnable,
Aux_ONS := "mRMP302_Int_Init",
ONS_R => "mRMP302_Int_ONS" );
#Timer136En := #mMinProd;
IF "HMI_PID".RMP302.ManualControl.PidEnable THEN
#ValBcdTmr136:= S_ODT (T_NO := "mSaveRMP302_IntTON",
S := #Timer136En,
TV := s5time#20s,
R := "AUX FALSE",
BI => #ValBinTmr136,
Q => "mSaveRMP302_IntTON.Q");
IF "mSaveRMP302_IntTON.Q" AND "gRMP302_PIDCtrlOk" THEN
"PID_Variables".RMP302PIDIntValue := "mPID_RMP302_Int" ;
"HMI_PID".RMP302.I_ITLVAL := "PID_Variables".RMP302PIDIntValue ;
#Timer136En := FALSE ;
END_IF;
ELSE;
#Timer136En := FALSE ;
END_IF;
IF "HMI_PID".RMP302.High_Limit OR "HMI_PID".RMP302.Low_Limit THEN
(* classic code: "HMI_PID".RMP302.I_ITLVAL := 0.0 ;*)
"HMI_PID".RMP302.I_ITLVAL := REAL#0.0 ;
END_IF;
IF "mRMP302_Int_ONS" THEN
"HMI_PID".RMP302.I_ITL := TRUE ;
END_IF;
"ONS_R"(Enable_ONS := "HMI_PID".RMM303.ManualControl.PidEnable ,
Aux_ONS := "mRMM303_Int_Init",
ONS_R => "mRMM303_Int_ONS" );
#Timer137En := #mMinProd;
IF "HMI_PID".RMM303.ManualControl.PidEnable THEN
#ValBcdTmr137:= S_ODT (T_NO := "mSaveRMM303_IntTON",
S := #Timer137En,
TV := s5time#20s,
R := "AUX FALSE",
BI => #ValBinTmr137,
Q => "mSaveRMM303_IntTON.Q");
IF "mSaveRMM303_IntTON.Q" AND "gRMM303_PIDCtrlOk" THEN
"PID_Variables".RMM303PIDIntValue := "mPID_RMM303_Int" ;
"HMI_PID".RMM303.I_ITLVAL := "PID_Variables".RMM303PIDIntValue ;
#Timer137En := FALSE ;
END_IF;
ELSE
#Timer137En := FALSE ;
END_IF;
IF ("HMI_PID".RMM303.High_Limit OR "HMI_PID".RMM303.Low_Limit) THEN
(* classic code: "HMI_PID".RMM303.I_ITLVAL := 0.0 ;*)
"HMI_PID".RMM303.I_ITLVAL := REAL#0.0 ;
END_IF;
IF "mRMM303_Int_ONS" THEN
"HMI_PID".RMM303.I_ITL := TRUE ;
END_IF;
// SECOND GAS INJECTION
"ONS_R"(Enable_ONS := "HMI_PID".RMM304.ManualControl.PidEnable ,
Aux_ONS := "mRMM304_Int_Init",
ONS_R => "mRMM304_Int_ONS" );
#Timer146En := #mMinProd;
IF "HMI_PID".RMM304.ManualControl.PidEnable THEN
#ValBcdTmr137:= S_ODT (T_NO := "mSaveRMM304_IntTON",
S := #Timer146En,
TV := s5time#20s,
R := "AUX FALSE",
BI => #ValBinTmr146,
Q => "mSaveRMM304_IntTON.Q");
IF "mSaveRMM304_IntTON.Q" AND "gRMM304_PIDCtrlOk" THEN
"PID_Variables".RMM304PIDIntValue := "mPID_RMM304_Int" ;
"HMI_PID".RMM304.I_ITLVAL := "PID_Variables".RMM304PIDIntValue ;
#Timer146En := FALSE ;
END_IF;
ELSE
#Timer146En := FALSE ;
END_IF;
IF ("HMI_PID".RMM304.High_Limit OR "HMI_PID".RMM304.Low_Limit) THEN
(* classic code: "HMI_PID".RMM304.I_ITLVAL := 0.0 ;*)
"HMI_PID".RMM304.I_ITLVAL := REAL#0.0 ;
END_IF;
IF "mRMM304_Int_ONS" THEN
"HMI_PID".RMM304.I_ITL := TRUE ;
END_IF;
"ONS_R"(Enable_ONS := "HMI_PID".RVP303.ManualControl.PidEnable,
Aux_ONS := "mRVP303_Int_Init",
ONS_R => "mRVP303_Int_ONS" );
#Timer144En := #mMinProd;
IF "HMI_PID".RVP303.ManualControl.PidEnable THEN
#ValBcdTmr144:= S_ODT (T_NO := "mSaveRVP303_IntTON",
S := #Timer144En,
TV := S5TIME#20s,
R := "AUX FALSE",
BI => #ValBinTmr144,
Q => "mSaveRVP303_IntTON.Q");
IF "mSaveRVP303_IntTON.Q" THEN
"PID_Variables".RVP303PIDIntValue := "mPID_RVP303_Int" ;
"HMI_PID".RVP303.I_ITLVAL := "PID_Variables".RVP303PIDIntValue ;
#Timer144En := FALSE ;
END_IF;
ELSE;
#Timer144En := FALSE ;
END_IF;
IF "HMI_PID".RVP303.High_Limit OR "HMI_PID".RVP303.Low_Limit THEN
(* classic code: "HMI_PID".RVP303.I_ITLVAL := 0.0 ;*)
"HMI_PID".RVP303.I_ITLVAL := REAL#0.0 ;
END_IF;
IF "mRVP303_Int_ONS" THEN
"HMI_PID".RVP303.I_ITL := TRUE ;
END_IF;
"ONS_R"(Enable_ONS := "HMI_PID".RVN302.ManualControl.PidEnable,
Aux_ONS := "mRVN302_Int_Init",
ONS_R => "mRVN302_Int_ONS" );
#Timer145En := #mMinProd;
IF "HMI_PID".RVN302.ManualControl.PidEnable THEN
#ValBcdTmr145:= S_ODT (T_NO := "mSaveRVN302_IntTON",
S := #Timer145En,
TV := S5TIME#20s,
R := "AUX FALSE",
BI => #ValBinTmr145,
Q => "mSaveRVN302_IntTON.Q");
IF "mSaveRVN302_IntTON.Q" THEN
"PID_Variables".RVN302PIDIntValue := "mPID_RVN302_Int" ;
"HMI_PID".RVN302.I_ITLVAL := "PID_Variables".RVN302PIDIntValue ;
#Timer145En := FALSE ;
END_IF;
ELSE;
#Timer145En := FALSE ;
END_IF;
IF "HMI_PID".RVN302.High_Limit OR "HMI_PID".RVN302.Low_Limit THEN
(* classic code: "HMI_PID".RVN302.I_ITLVAL := 0.0 ;*)
"HMI_PID".RVN302.I_ITLVAL := REAL#0.0 ;
END_IF;
IF "mRVN302_Int_ONS" THEN
"HMI_PID".RVN302.I_ITL := TRUE ;
END_IF;
END_FUNCTION_BLOCK
```

View File

@ -0,0 +1,44 @@
```pascal
FUNCTION "BlenderPIDCtrl_SaveValve" : Void
{ S7_Optimized_Access := 'FALSE' }
AUTHOR : 'Author'
FAMILY : TASK1
NAME : 'Name'
VERSION : 1.0
VAR_TEMP
ValBinTmr138 : Word;
ValBcdTmr138 : S5Time;
Timer138En : Bool;
END_VAR
VAR CONSTANT
"Time" : S5Time := S5T#40s;
END_VAR
BEGIN
(* classic code: IF ABS("Blender_Variables".gActual_Prod_SP - "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProductionRate) < "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProductionRate * 0.1 THEN*)
IF ABS("Blender_Variables".gActual_Prod_SP - "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProductionRate) < "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProductionRate * REAL#0.1 THEN
#Timer138En := TRUE;
#ValBcdTmr138:= S_ODT (T_NO := "mSpeedConstTmr",
S := #Timer138En,
TV := #Time,
R := "AUX FALSE",
BI => #ValBinTmr138,
Q => "mSpeedConstTmr.Q");
ELSE
#Timer138En := FALSE;
END_IF;
IF "mSpeedConstTmr.Q" THEN
"HMI_Variables_Cmd".Recipe_Updates.ValvesUpdate := TRUE ;
#Timer138En := FALSE ;
END_IF;
END_FUNCTION
```

View File

@ -0,0 +1,265 @@
```pascal
// Block Type: FC
// Block Number: 1925
// Original Network Languages: LAD
// Block Comment:
// TASK1 PID
FUNCTION "BlenderPIDCtrl_WriteAnOu" : Void
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR_TEMP
mVLT_freq_REAL : Real;
mDummy : Bool;
mVLT_PumpP2_freq_REAL : Real;
mVLT_PumpP1_freq_REAL : Real;
END_VAR
BEGIN
// Network 1: Carbonated Water Valve (Original Language: LAD)
// Water Valve
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" AND "HMI_PID"."RMM301"."Config" THEN
WritePeripheral(Analog_Value := "HMI_PID"."RMM301"."Out", MAX_Analog_Value := 100.0, MAX_Out := "Blender_Constants"."gAnalogMaxValue", MIN_Analog_Value := 0.0, MIN_Out := 0);
END_IF;
// Network 2: Syrup Valve (Original Language: LAD)
// Syrup
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" AND "HMI_PID"."RMP302"."Config" THEN
WritePeripheral(Analog_Value := "HMI_PID"."RMP302"."Out", MAX_Analog_Value := 100.0, MAX_Out := "Blender_Constants"."gAnalogMaxValue", MIN_Analog_Value := 0.0, MIN_Out := 0);
END_IF;
// Network 3: Co2 Valve (Original Language: LAD)
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" AND "HMI_PID"."RMM303"."Config" THEN
WritePeripheral(Analog_Value := "HMI_PID"."RMM303"."Out", MAX_Analog_Value := 100.0, MAX_Out := "Blender_Constants"."gAnalogMaxValue", MIN_Analog_Value := 0.0, MIN_Out := 0);
END_IF;
// Network 4: Gas2 Valve (Original Language: LAD)
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" AND "HMI_PID"."RMM304"."Config" THEN
WritePeripheral(Analog_Value := "HMI_PID"."RMM304"."Out", MAX_Analog_Value := 100.0, MAX_Out := "Blender_Constants"."gAnalogMaxValue", MIN_Analog_Value := 0.0, MIN_Out := 0);
END_IF;
// Network 5: Product Tank Pressure Valve (Original Language: LAD)
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" AND "HMI_PID"."RVM301"."Config" THEN
WritePeripheral(Analog_Value := "HMI_PID"."RVM301"."Out", MAX_Analog_Value := 100.0, MAX_Out := "Blender_Constants"."gAnalogMaxValue", MIN_Analog_Value := 0.0, MIN_Out := 0);
END_IF;
// Network 6: Syrup Tank Level Valve (Original Language: LAD)
IF "HMI_PID"."RVP303"."Out" >= 1.0 THEN
WritePeripheral(Analog_Value := "HMI_PID"."RVP303"."Out", MAX_Analog_Value := 100.0, MAX_Out := "Blender_Constants"."gAnalogMaxValue", MIN_Analog_Value := 0.0, MIN_Out := 5530);
END_IF;
// Network 7: Valve Power Enable (Power Supply Analog Signal) (Original Language: LAD)
IF "HMI_PID"."RVP303"."Out" < 1.0 THEN
"P_AO_RVP303" := 0;
END_IF;
"DO_SyrupValve_Enable" := "HMI_PID"."RVP303"."Out" < 1.0;
// Network 8: Deaireator Level Valve (Original Language: LAD)
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" AND "HMI_PID"."RVN302"."ConfigPID" AND "HMI_PID"."RVN302"."Config" THEN
WritePeripheral(Analog_Value := "HMI_PID"."RVN302"."Out", MAX_Analog_Value := 100.0, MAX_Out := "Blender_Constants"."gAnalogMaxValue", MIN_Analog_Value := 0.0, MIN_Out := 0);
END_IF;
// Network 9: CIp Heating Valve (Original Language: LAD)
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" AND "HMI_PID"."RVS318"."Config" THEN
WritePeripheral(Analog_Value := "HMI_PID"."RVS318"."Out", MAX_Analog_Value := 100.0, MAX_Out := "Blender_Constants"."gAnalogMaxValue", MIN_Analog_Value := 0.0, MIN_Out := 0);
END_IF;
// Network 10: Chiller Temperature (Original Language: LAD)
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" AND "HMI_PID"."RVM319_PRD"."Config" THEN
WritePeripheral(Analog_Value := "HMI_Blender_Parameters"."Actual_Recipe_Parameters"."_SP_ProdTemp", MAX_Analog_Value := 50.0, MAX_Out := "Blender_Constants"."gAnalogMaxValue", MIN_Analog_Value := 0.0, MIN_Out := 0);
END_IF;
IF "HMI_Variables_Status"."Procedures"."WarmRinseRun" THEN
"HMI_PID"."RVM319_H2O"."Out" := "HMI_PID"."RVM319_PRD"."Out";
END_IF;
// Network 11: Cip Return Temperature (Original Language: LAD)
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_LocalCIP" THEN
WritePeripheral(Analog_Value := "HMI_Instrument"."TTS305_1"."PVFiltered", MAX_Analog_Value := 100.0, MAX_Out := "Blender_Constants"."gAnalogMaxValue", MIN_Analog_Value := 0.0, MIN_Out := 0);
END_IF;
// Network 12: Cip Conductivity (Original Language: LAD)
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_LocalCIP" THEN
WritePeripheral(Analog_Value := "HMI_Instrument"."CTS301"."PVFiltered", MAX_Analog_Value := 2000.0, MAX_Out := "Blender_Constants"."gAnalogMaxValue", MIN_Analog_Value := 0.0, MIN_Out := 0);
END_IF;
// Network 13: Cip Caustic Conductivity (Original Language: LAD)
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_LocalCIP" THEN
WritePeripheral(Analog_Value := "HMI_Instrument"."CTS302"."PVFiltered", MAX_Analog_Value := 200.0, MAX_Out := "Blender_Constants"."gAnalogMaxValue", MIN_Analog_Value := 0.0, MIN_Out := 0);
END_IF;
// Network 14: Product Pump (Original Language: LAD)
IF "gBlenderProdMode" AND "gBlenderRinseMode" AND "HMI_Device"."PPM303"."Out" AND "gIN_Filler1ProductReq" AND "HMI_PID"."PPM303"."PID_FIX" AND "HMI_PID"."PPM303"."ManualControl"."ManOut" THEN
"HMI_PID"."PPM303"."Out" := "HMI_Blender_Parameters"."Actual_Recipe_Parameters"."_ProdPump1_Hz";
END_IF;
IF "gBlenderProdMode" AND "gBlenderRinseMode" AND "HMI_Device"."PPM303"."Out" AND "gIN_Filler1ProductReq" AND "HMI_PID"."PPM303"."PID_FIX" AND "HMI_PID"."PPM303"."ManualControl"."ManOut" THEN
"HMI_PID"."PPM303"."Out" := 10.0;
END_IF;
IF ("gBlenderProdMode" AND "gBlenderRinseMode" AND "HMI_Device"."PPM303"."Out" AND "HMI_PID"."PPM303"."PID_FIX" AND "HMI_PID"."PPM303"."ManualControl"."ManOut" AND "HMI_Alarms"."gH_Status") OR ("gBlenderProdMode" AND "gBlenderRinseMode" AND "HMI_Device"."PPM303"."Out" AND "HMI_PID"."PPM303"."ManualControl"."ManOut" AND "HMI_Alarms"."gH_Status" AND "Disable_Bit") THEN
"HMI_PID"."PPM303"."Out" := 15.0;
END_IF;
IF "gBlenderProdMode" AND "gBlenderRinseMode" AND "HMI_Device"."PPM303"."Out" AND "HMI_PID"."PPM303"."ManualControl"."ManOut" THEN
"HMI_PID"."PPM303"."Out" := "HMI_Blender_Parameters"."ProcessSetup"."_RinsePPM303Freq";
END_IF;
IF "HMI_Device"."PPM303"."Out" AND "HMI_PID"."PPM303"."ManualControl"."ManOut" AND "gBlenderCIPMode" THEN
"HMI_PID"."PPM303"."Out" := "HMI_Blender_Parameters"."ProcessSetup"."_CIPPPM303Freq";
END_IF;
IF "HMI_PID"."PPM303"."ManualControl"."ManOut" THEN
"HMI_PID"."PPM303"."Out" := "HMI_PID"."PPM303"."OutMan";
END_IF;
IF "HMI_Device"."PPM303"."Out" AND "HMI_PID"."PPM303"."ManualControl"."ManOut" THEN
"HMI_PID"."PPM303"."Out" := 0.0;
END_IF;
"mDummy" := "gBlenderProdMode" AND "gBlenderRinseMode" AND "HMI_Device"."PPM303"."Out" AND "gIN_Filler1ProductReq" AND "HMI_PID"."PPM303"."PID_FIX" AND "HMI_PID"."PPM303"."ManualControl"."ManOut";
// Network 15: Product Pump Reference Value (Original Language: LAD)
// N.B. impostare il MAX_Analog_Value al valore di produzione + 10 Hz ( con
// macchina a 50Hz verrà impostato a 60Hz).
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" AND "HMI_PID"."PPM303"."Config" THEN
WritePeripheral(Analog_Value := "HMI_PID"."PPM303"."Out", MAX_Analog_Value := 50.0, MAX_Out := "Blender_Constants"."gAnalogMaxValue_VFC", MIN_Analog_Value := 0.0, MIN_Out := 0);
END_IF;
// Network 16: Product Pump 2 (Original Language: LAD)
IF "gBlenderProdMode" AND "gBlenderRinseMode" AND "HMI_PID"."PPM303"."PID_FIX" AND "HMI_PID"."PPM303"."ManualControl"."ManOut" AND "HMI_Device"."PPM305"."Out" AND "gIN_Filler2ProductReq" THEN
"HMI_PID"."PPM305"."Out" := "HMI_Blender_Parameters"."Actual_Recipe_Parameters"."_ProdPump2_Hz";
END_IF;
IF "gBlenderProdMode" AND "gBlenderRinseMode" AND "HMI_PID"."PPM303"."PID_FIX" AND "HMI_PID"."PPM303"."ManualControl"."ManOut" AND "HMI_Device"."PPM305"."Out" AND "gIN_Filler2ProductReq" THEN
"HMI_PID"."PPM305"."Out" := 10.0;
END_IF;
IF "gBlenderProdMode" AND "HMI_Device"."PPM303"."Out" AND "HMI_PID"."PPM303"."PID_FIX" THEN
"HMI_PID"."PPM305"."Out" := "HMI_Blender_Parameters"."Actual_Recipe_Parameters"."_FillingValveHead_SP";
END_IF;
IF "gBlenderProdMode" AND "gBlenderRinseMode" AND "HMI_Device"."PPM305"."Out" AND "HMI_PID"."PPM305"."ManualControl"."ManOut" THEN
"HMI_PID"."PPM305"."Out" := "HMI_Blender_Parameters"."ProcessSetup"."_RinsePPM303Freq";
END_IF;
IF "gBlenderCIPMode" AND "HMI_Device"."PPM305"."Out" AND "HMI_PID"."PPM305"."ManualControl"."ManOut" THEN
"HMI_PID"."PPM305"."Out" := "HMI_Blender_Parameters"."ProcessSetup"."_CIPPPM303Freq";
END_IF;
IF "HMI_Device"."PPM305"."Out" AND "HMI_PID"."PPM305"."ManualControl"."ManOut" THEN
"HMI_PID"."PPM305"."Out" := 0.0;
END_IF;
IF "HMI_PID"."PPM305"."ManualControl"."ManOut" THEN
"HMI_PID"."PPM305"."Out" := "HMI_PID"."PPM305"."OutMan";
END_IF;
"mDummy" := "gBlenderProdMode" AND "gBlenderRinseMode" AND "HMI_PID"."PPM303"."PID_FIX" AND "HMI_PID"."PPM303"."ManualControl"."ManOut" AND "HMI_Device"."PPM305"."Out" AND "gIN_Filler2ProductReq";
// Network 17: Product Pump 2 Reference Value (Original Language: LAD)
// N.B. impostare il MAX_Analog_Value al valore di produzione + 10 Hz ( con
// macchina a 50Hz verrà impostato a 60Hz).
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" AND "HMI_PID"."PPM305"."Config" THEN
WritePeripheral(Analog_Value := "HMI_PID"."PPM305"."Out", MAX_Analog_Value := 50.0, MAX_Out := "Blender_Constants"."gAnalogMaxValue_VFC", MIN_Analog_Value := 0.0, MIN_Out := 0);
END_IF;
// Network 18: Syrup Pump (Original Language: LAD)
IF "gBlenderProdMode" AND "HMI_Device"."PPP302"."Out" THEN
"mVLT_PumpP2_freq_REAL" := "HMI_Blender_Parameters"."Actual_Recipe_Parameters"."_SyrupPumpFreq";
END_IF;
IF "gBlenderRinseMode" AND "HMI_Device"."PPP302"."Out" THEN
"mVLT_PumpP2_freq_REAL" := "HMI_Blender_Parameters"."ProcessSetup"."_RinsePPP302Freq";
END_IF;
IF "gBlenderCIPMode" AND "HMI_Device"."PPP302"."Out" THEN
"mVLT_PumpP2_freq_REAL" := "HMI_Blender_Parameters"."ProcessSetup"."_CIPPPP302Freq";
END_IF;
IF "HMI_Device"."PPP302"."Out" THEN
"mVLT_PumpP2_freq_REAL" := 0.0;
END_IF;
IF "HMI_PID"."PPP302"."ManualControl"."ManOut" THEN
"HMI_PID"."PPP302"."OutMan" := "mVLT_PumpP2_freq_REAL";
END_IF;
IF "HMI_PID"."PPP302"."ManualControl"."ManOut" THEN
"mVLT_PumpP2_freq_REAL" := "HMI_PID"."PPP302"."OutMan";
END_IF;
"HMI_PID"."PPP302"."Out" := "mVLT_PumpP2_freq_REAL";
"mDummy" := ("gBlenderProdMode" AND "HMI_Device"."PPP302"."Out") OR ("gBlenderRinseMode" AND "HMI_Device"."PPP302"."Out");
// Network 19: Syrup Pump Reference Value (Original Language: LAD)
// N.B. impostare il MAX_Analog_Value al valore di produzione + 10 Hz ( con
// macchina a 50Hz verrà impostato a 60Hz).
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" AND "HMI_PID"."PPP302"."Config" THEN
WritePeripheral(Analog_Value := "HMI_PID"."PPP302"."Out", MAX_Analog_Value := 60.0, MAX_Out := "Blender_Constants"."gAnalogMaxValue_VFC", MIN_Analog_Value := 0.0, MIN_Out := 0);
END_IF;
// Network 20: Water Pump (Original Language: LAD)
IF "gBlenderProdMode" AND "HMI_Device"."PPN301"."Out" THEN
"mVLT_PumpP1_freq_REAL" := "HMI_Blender_Parameters"."Actual_Recipe_Parameters"."_WaterPumpFreq";
END_IF;
IF "gBlenderRinseMode" AND "HMI_Device"."PPN301"."Out" THEN
"mVLT_PumpP1_freq_REAL" := "HMI_Blender_Parameters"."ProcessSetup"."_RinsePPN301Freq";
END_IF;
IF "gBlenderCIPMode" THEN
"mVLT_PumpP1_freq_REAL" := "HMI_Blender_Parameters"."ProcessSetup"."_CIPPPN301Freq";
END_IF;
IF "HMI_Device"."PPN301"."Out" THEN
"mVLT_PumpP1_freq_REAL" := 0.0;
END_IF;
IF "HMI_PID"."PPN301"."ManualControl"."ManOut" THEN
"HMI_PID"."PPN301"."OutMan" := "mVLT_PumpP1_freq_REAL";
END_IF;
IF "HMI_PID"."PPN301"."ManualControl"."ManOut" THEN
"mVLT_PumpP1_freq_REAL" := "HMI_PID"."PPN301"."OutMan";
END_IF;
"HMI_PID"."PPN301"."Out" := "mVLT_PumpP1_freq_REAL";
"mDummy" := ("gBlenderProdMode" AND "HMI_Device"."PPN301"."Out") OR ("gBlenderRinseMode" AND "HMI_Device"."PPN301"."Out");
// Network 21: Water Pump Reference Value (Original Language: LAD)
// N.B. impostare il MAX_Analog_Value al valore di produzione + 10 Hz ( con
// macchina a 50Hz verrà impostato a 60Hz).
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" AND "HMI_PID"."PPN301"."Config" THEN
WritePeripheral(Analog_Value := "HMI_PID"."PPN301"."Out", MAX_Analog_Value := 60.0, MAX_Out := "Blender_Constants"."gAnalogMaxValue_VFC", MIN_Analog_Value := 0.0, MIN_Out := 0);
END_IF;
END_FUNCTION
```

View File

@ -0,0 +1,135 @@
```pascal
// Block Type: FB
// Block Number: 1729
// Original Network Languages: LAD
// Block Comment:
// TASK1 PID
FUNCTION_BLOCK "BlenderPIDCtrl__Loop"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR_INPUT
i_InValue : Real;
i_SlewMax : Real;
i_Cycle : Real;
END_VAR
VAR_OUTPUT
MeanValue : Real;
Variance : Real;
Std_Deviation : Real;
END_VAR
VAR_INOUT
out : Real;
END_VAR
VAR_STAT
PID_1_300ms : Bool;
PID_2_300ms : Bool;
PID_3_300ms : Bool;
PID_4_300ms : Bool;
PID_5_300ms : Bool;
PID_6_300ms : Bool;
Flow_Meter_Error_RETVAL : Real;
PID_FF_Calc : "BlenderPID_PIDFFCalc";
PID_Blending_Fault : "BlenderPID_BlendingFault";
PID_Save_Integral : "BlenderPIDCtrl_SaveInteg";
PID_Monitor : "BlenderPIDCtrl_Monitor";
Read_AnalogInput : "BlenderPIDCtrl_ReadAnIn";
END_VAR
BEGIN
// Network 1: Read Analoc Inputs (Original Language: LAD)
"Read_AnalogInput"();
// Network 2: MIX - OB35 scan counter (Original Language: LAD)
// PID Control Time Bit (300ms)
"PID_1_300ms" := Eq("MW1968", 1);
"PID_2_300ms" := Eq("MW1968", 2);
"PID_3_300ms" := Eq("MW1968", 3);
"PID_4_300ms" := Eq("MW1968", 4);
"PID_5_300ms" := Eq("MW1968", 5);
"PID_6_300ms" := Eq("MW1968", 6);
// Network 3: PID Call (Original Language: LAD)
// Water PID
// Syrup PID
// CO2 PID
IF "PID_1_300ms" THEN
"PID_FF_Calc"();
"PID_Blending_Fault"();
BlenderPID_FlowMeterErro();
"PID_Monitor"();
"PID_Save_Integral"();
BlenderPIDCtrl_SaveValve();
END_IF;
IF "PID_1_300ms" AND "HMI_PID"."RMM301"."Config" THEN
"PID_RMM301_Data"();
END_IF;
IF "PID_1_300ms" AND "HMI_PID"."RMP302"."Config" THEN
"PID_RMP302_Data"();
END_IF;
IF "PID_1_300ms" AND "HMI_PID"."RMM303"."Config" THEN
"PID_RMM303_Data"();
END_IF;
IF "PID_1_300ms" AND "HMI_PID"."RMM304"."Config" THEN
"PID_RMM304_Data"();
END_IF;
// Network 4: PID Product Tank Pressure (Original Language: LAD)
IF "PID_2_300ms" AND "HMI_PID"."RVM301"."Config" THEN
"PID_RVM301_Data"();
BlenderPIDCtrl_PresRelea();
END_IF;
// Network 5: Pid Call (Original Language: LAD)
IF "PID_4_300ms" AND "HMI_PID"."RVM319_PRD"."Config" THEN
"PID_RVM319_Data"();
END_IF;
IF "HMI_PID"."RVP303"."Config" AND "PID_4_300ms" THEN
"PID_RVP303_Data"();
END_IF;
IF "HMI_PID"."RVN302"."ConfigPID" AND "HMI_PID"."RVN302"."Config" AND "PID_4_300ms" THEN
"PID_RVN302_Data"();
END_IF;
// Network 6: Filling Head (Original Language: LAD)
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_BlendFillSystem" AND "PID_5_300ms" AND "HMI_PID"."PPM303"."Config" THEN
"PID_Filling_Head_Data"();
END_IF;
// Network 7: CIp Heating PID (Original Language: LAD)
IF "PID_6_300ms" AND "HMI_PID"."RVS318"."Config" THEN
"PID_RVS318_Data"();
END_IF;
// Network 8: Write Analog Outputs (Original Language: LAD)
IF "AUX TRUE" THEN
BlenderPIDCtrl_WriteAnOu();
END_IF;
END_FUNCTION_BLOCK
```

View File

@ -0,0 +1,146 @@
```pascal
FUNCTION_BLOCK "BlenderPID_ActualRecipe"
{ S7_Optimized_Access := 'FALSE' }
AUTHOR : 'Author'
FAMILY : TASK1
NAME : 'Name'
VERSION : 1.0
VAR
mPrevRecipeName : String[32];
END_VAR
BEGIN
IF "HMI_Blender_Parameters".Processor_Options.Blender_OPT._BrixMeter AND (("HMI_Blender_Parameters".Processor_Options.Blender_OPT._MeterType <>3 OR "HMI_Blender_Parameters".Processor_Options.Blender_OPT._MeterType <>4
AND "Blender_Variables".gProductRecipeNum <> "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProdMeterRecipeNum)
OR "HMI_Blender_Parameters".Processor_Options.Blender_OPT._MeterType = 4) AND NOT "gBlenderCIPMode" AND NOT "mPDS_PA_Data".Input_From_mPDS.gPAmPDS_ReceiveOnly THEN
"gProdMeterTransferRecipe" := TRUE ;
END_IF ;
IF "HMI_Blender_Parameters".Processor_Options.Blender_OPT._Promass = 1 THEN
"HMI_Blender_Parameters".Actual_Recipe_Parameters._Type := 1 ;
"HMI_Blender_Parameters".Actual_Recipe_Parameters._Ratio := 20 ;
END_IF ;
CASE "HMI_Blender_Parameters".Actual_Recipe_Parameters._Type OF
1: // Recipe Diet Type
"Blender_Variables_Pers".gSugarBeverage := FALSE ;
"gNotARecipe_Fault" := FALSE ;
2: // Recipe Regular Type
"Blender_Variables_Pers".gSugarBeverage := TRUE ;
"gNotARecipe_Fault" := FALSE ;
3: // Recipe Ratio Type
"Blender_Variables_Pers".gSugarBeverage := TRUE ;
"gNotARecipe_Fault" := FALSE ;
ELSE:
"gNotARecipe_Fault" := TRUE ;
"Blender_Variables_Pers".gSugarBeverage := FALSE ;
END_CASE;
IF "HMI_Blender_Parameters".Processor_Options.Blender_OPT._CoolerPresent AND ("HMI_Blender_Parameters".Processor_Options.Blender_OPT._CoolerControl >= 1) AND "HMI_Blender_Parameters".Actual_Recipe_Parameters._EnProdTemp THEN
"Blender_Variables_Pers".gCoolerEnabled := TRUE ;
ELSE
"Blender_Variables_Pers".gCoolerEnabled := FALSE ;
END_IF;
IF NOT "HMI_Blender_Parameters".Processor_Options.Blender_OPT._CarboPresent THEN
(* classic code: "HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Vols := 0.0 ;*)
"HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Vols := REAL#0.0 ;
END_IF;
IF "HMI_Blender_Parameters".Processor_Options.Blender_OPT._CO2_GAS2_Injection AND ("HMI_Blender_Parameters".Processor_Options.Blender_OPT._VacuumPump >= 1) THEN
(* classic code: IF ("HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Vols > 0.1) AND ("HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Fact > 0.1 ) AND NOT "HMI_Blender_Parameters".Actual_Recipe_Parameters._GAS2_Injection THEN*)
IF ("HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Vols > REAL#0.1) AND ("HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Fact > REAL#0.1 ) AND NOT "HMI_Blender_Parameters".Actual_Recipe_Parameters._GAS2_Injection THEN
"Blender_Variables_Pers".gCarboStillRecipe := TRUE ;
ELSE
"Blender_Variables_Pers".gCarboStillRecipe := FALSE ;
END_IF;
ELSE
IF #mPrevRecipeName <> "HMI_Blender_Parameters".Actual_Recipe_Parameters._Name THEN
(* classic code: IF ("HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Vols > 0.1) AND ("HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Fact > 0.1 ) THEN*)
IF ("HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Vols > REAL#0.1) AND ("HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Fact > REAL#0.1 ) THEN
"Blender_Variables_Pers".gCarboStillRecipe := TRUE ;
ELSE
"Blender_Variables_Pers".gCarboStillRecipe := FALSE ;
END_IF;
END_IF;
END_IF;
IF "HMI_Blender_Parameters".Processor_Options.Blender_OPT._CO2_GAS2_Injection AND "HMI_Blender_Parameters".Actual_Recipe_Parameters._GAS2_Injection THEN
// IF ("HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Vols > 0.1) AND ("HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Fact > 0.1 ) THEN
// "Blender_Variables_Pers".gCarboStillProduct := TRUE ;
// ELSE
"Blender_Variables_Pers".gCarboStillProduct := FALSE ;
(* classic code: "HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Vols := 0.0 ;*)
"HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Vols := REAL#0.0 ;
(* classic code: "HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Fact := 0.0 ;*)
"HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Fact := REAL#0.0 ;
// END_IF;
ELSE
(* classic code: IF ("HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Vols > 0.1) AND ("HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Fact > 0.1 ) THEN*)
IF ("HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Vols > REAL#0.1) AND ("HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Fact > REAL#0.1 ) THEN
"Blender_Variables_Pers".gCarboStillProduct := TRUE ;
ELSE
"Blender_Variables_Pers".gCarboStillProduct := FALSE ;
END_IF;
END_IF;
//IF NOT "HMI_Blender_Parameters".Processor_Options.Blender_OPT._CO2_GAS2_Injection AND ("HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Vols > 0.1) THEN
// "HMI_Blender_Parameters".Actual_Recipe_Parameters._GAS2_Injection := true;
//END_IF;
"gActualSP_RatioVol" := "HMI_Blender_Parameters".Actual_Recipe_Parameters._Ratio ;
IF ("HMI_Blender_Parameters".Actual_Recipe_Parameters._Ratio > 19) THEN
"Blender_Variables_Pers".gWaterRecipe := TRUE ;
"Blender_Variables_Pers".gSugarBeverage := FALSE ;
ELSE
"Blender_Variables_Pers".gWaterRecipe := FALSE ;
END_IF;
IF ("HMI_Blender_Parameters".Processor_Options.Blender_OPT._ByPassDeair AND NOT "HMI_Blender_Parameters".Actual_Recipe_Parameters._EnDeaireation) OR
("HMI_Blender_Parameters".Processor_Options.Blender_OPT._StillWaterByPass AND "Blender_Variables_Pers".gWaterRecipe AND
NOT "Blender_Variables_Pers".gCarboStillRecipe) THEN
"Blender_Variables_Pers".gSkipDeaireation := TRUE ;
ELSE
"Blender_Variables_Pers".gSkipDeaireation := FALSE ;
END_IF;
IF ("HMI_Blender_Parameters".Actual_Recipe_Parameters._ProductionRate > "Blender_Variables".gMinProduction) AND NOT "HMI_Blender_Parameters".Processor_Options.Blender_OPT._BlendFillSystem THEN
"Blender_Variables".gProdTankStartLvl := "Blender_Constants".gStartLvl_NormalSpeed ;
ELSE
"Blender_Variables".gProdTankStartLvl := "Blender_Constants".gStartLvl_VeryLowSpeed ;
END_IF ;
IF "HMI_Blender_Parameters".Processor_Options.Blender_OPT._BlendFillSystem THEN
(* "Blender_Variables".gProdTankStopLvl := "Blender_Constants".gStopLvl_BlendFill ;
"Blender_Variables".gProdTankTargetLvl := "Blender_Constants".gTargetLvl_BlendFill ;*)
(* classic code: "Blender_Variables".gProdTankStopLvl := ((("HMI_Blender_Parameters".ProcessSetup._FillingValveHeight + "HMI_Blender_Parameters".Actual_Recipe_Parameters._FillingValveHead_SP) -
"HMI_Blender_Parameters".ProcessSetup._TM301Height_0) / "Blender_Variables".gBufferTankProbeHeight) * 100.0 ;*)
"Blender_Variables".gProdTankStopLvl := ((("HMI_Blender_Parameters".ProcessSetup._FillingValveHeight + "HMI_Blender_Parameters".Actual_Recipe_Parameters._FillingValveHead_SP) -
"HMI_Blender_Parameters".ProcessSetup._TM301Height_0) / "Blender_Variables".gBufferTankProbeHeight) * REAL#100.0;
(* classic code: "Blender_Variables".gProdTankStopLvl := LIMIT(MN:= 30.0, IN:= "Blender_Variables".gProdTankStopLvl, MX:= 80.0);*)
"Blender_Variables".gProdTankStopLvl := LIMIT(MN := REAL#30.0, IN := "Blender_Variables".gProdTankStopLvl, MX := REAL#50);//80.0);
(* classic code: "Blender_Variables".gProdTankTargetLvl := "Blender_Variables".gProdTankStopLvl - 15.0 ;*)
"Blender_Variables".gProdTankTargetLvl := "Blender_Variables".gProdTankStopLvl - REAL#15.0;
(* classic code: "Blender_Variables".gProdTankStartLvl := 10.0 ;*)
"Blender_Variables".gProdTankStartLvl := REAL#20.0;
ELSE
"Blender_Variables".gProdTankStopLvl := "Blender_Constants".gStopLvl_OnlyBlend;
"Blender_Variables".gProdTankTargetLvl := "Blender_Constants".gTargetLvl_OnlyBlend;
END_IF;
IF "HMI_Blender_Parameters".Actual_Recipe_Parameters._PrdTankMinLevel > "Blender_Variables".gProdTankTargetLvl THEN
"Blender_Variables".gProdTankTargetLvl := "HMI_Blender_Parameters".Actual_Recipe_Parameters._PrdTankMinLevel ;
END_IF;
#mPrevRecipeName := "HMI_Blender_Parameters".Actual_Recipe_Parameters._Name ;
END_FUNCTION_BLOCK
```

View File

@ -0,0 +1,109 @@
```pascal
FUNCTION_BLOCK "BlenderPID_BlendingFault"
{ S7_Optimized_Access := 'FALSE' }
AUTHOR : 'Author'
FAMILY : TASK1
NAME : 'Name'
VERSION : 1.0
VAR
Timer132Enable : Bool;
Timer133Enable : Bool;
Timer134Enable : Bool;
END_VAR
VAR_TEMP
ValBinTmr132 : Word;
ValBcdTmr132 : S5Time;
ValBinTmr133 : Word;
ValBcdTmr133 : S5Time;
ValBinTmr134 : Word;
ValBcdTmr134 : S5Time;
END_VAR
BEGIN
IF "Procedure_Variables".First_Production.Latch AND "gBlenderEnToRamp" THEN
#Timer132Enable := TRUE;
#ValBcdTmr132:= S_ODT (T_NO := "mFirstProdBlendErrEnTON",
S := #Timer132Enable,
TV := s5time#20s,
R := "AUX FALSE",
BI => #ValBinTmr132,
Q => "mFirstProdBlendErrEn.Q");
ELSE
#Timer132Enable := FALSE ;
END_IF;
IF (ABS("Blender_Variables".gBlendError) > "HMI_Variables_Status".Analog_Values.MaxBlendError AND "gBlenderBlending") AND ("mFirstProdBlendErrEn.Q" OR "Procedure_Variables".First_Production.Done) THEN
IF "Blender_Variables".gBlendError > 0 THEN
"gBlendErrorLowSyr_Fault" := TRUE ;
ELSE
"gBlendErrorHighSyr_Fault" := TRUE ;
END_IF;
END_IF;
IF ("gBlendErrorLowSyr_Fault" OR "gBlendErrorHighSyr_Fault") AND "gIN_ResetBtn" THEN
"Blender_Variables".gBlendError := 0 ;
"gMaxBlendErrorAfterFault" := TRUE ;
"gBlendErrorLowSyr_Fault" := FALSE ;
"gBlendErrorHighSyr_Fault" := FALSE ;
END_IF;
IF "gMaxBlendErrorAfterFault" AND "gBlenderStableFlow" THEN
#Timer133Enable := TRUE;
END_IF;
#ValBcdTmr133:= S_ODT (T_NO := "mBlendErrorRecTmr",
S := #Timer133Enable,
TV := s5time#10s,
R := "AUX FALSE",
BI => #ValBinTmr133,
Q => "mBlendErrorRecTmr.Q");
IF "mBlendErrorRecTmr.Q" THEN
IF ABS("Blender_Variables".gBlendError) < "HMI_Variables_Status".Analog_Values.MaxBlendError THEN
#Timer133Enable := FALSE ;
"gMaxBlendErrorAfterFault" := FALSE ;
END_IF;
END_IF;
IF (ABS("Blender_Variables".gCarboCO2Error) > "HMI_Variables_Status".Analog_Values.MaxCarboCO2Error AND "gBlenderBlending") AND ("mFirstProdBlendErrEn.Q" OR "Procedure_Variables".First_Production.Done) THEN
IF "Blender_Variables".gCarboCO2Error > 0 THEN
"gCarboCO2Err_L_CO2_Fault" := TRUE ;
ELSE
"gCarboCO2Err_H_CO2_Fault" := FALSE ;
END_IF;
END_IF;
IF ("gCarboCO2Err_L_CO2_Fault" OR "gCarboCO2Err_H_CO2_Fault") AND "gIN_ResetBtn" THEN
"Blender_Variables".gCarboCO2Error := 0 ;
"gMaxCarboErrorAfterFault" := TRUE ;
"gCarboCO2Err_L_CO2_Fault" := FALSE ;
"gCarboCO2Err_H_CO2_Fault" := FALSE ;
END_IF;
IF "gMaxCarboErrorAfterFault" AND "gBlenderStableFlow" THEN
#Timer134Enable := TRUE;
END_IF;
#ValBcdTmr134:= S_ODT (T_NO := "mCarboErrorRecTmr",
S := #Timer134Enable,
TV := s5time#20s,
R := "AUX FALSE",
BI => #ValBinTmr134,
Q => "mCarboErrorRecTmr.Q");
IF "mCarboErrorRecTmr.Q" THEN
IF ABS("Blender_Variables".gCarboCO2Error) < "HMI_Variables_Status".Analog_Values.MaxCarboCO2Error THEN
#Timer134Enable := FALSE ;
"gMaxCarboErrorAfterFault":= FALSE ;
END_IF;
END_IF;
END_FUNCTION_BLOCK
```

View File

@ -0,0 +1,56 @@
```pascal
FUNCTION "BlenderPID_FlowMeterErro" : Real
{ S7_Optimized_Access := 'FALSE' }
AUTHOR : 'Author'
FAMILY : TASK1
NAME : 'Name'
VERSION : 1.0
VAR_TEMP
mWaterMaxFlow : Real;
mWaterMinFlow : Real;
mSyrupMaxFlow : Real;
mSyrupMinFlow : Real;
mMinRatio : Real;
mMaxRatio : Real;
mBevBrixMax : Real;
mBevBrixMin : Real;
END_VAR
BEGIN
IF "Blender_Variables".gSP_H2O <> 0 THEN
"Blender_Variables".gWaterVFMCalcError := "Blender_Variables".gWaterVFMMeasError / 100 * "Blender_Variables".gSP_H2O ;
END_IF;
IF "Blender_Variables".gSP_SYR <> 0 THEN
"Blender_Variables".gSyrupMFMCalcError := ("Blender_Variables".gSyrupMFMMeasError / 100 + ("Blender_Variables".gSyrupMFMZeroStab / ("Blender_Variables".gSP_SYR * 60)) / 100) * "Blender_Variables".gSP_SYR ;
END_IF;
IF "Blender_Variables".gSP_CO2 <>0 THEN
"Blender_Variables".gCO2MFMCalcError := ("Blender_Variables".gCO2MFMMeasError / 100 + ("Blender_Variables".gCO2MFMZeroStab / ("Blender_Variables".gSP_CO2 * 60 / 1000)) / 100) * "Blender_Variables".gSP_CO2 ;
END_IF;
#mWaterMaxFlow := "Blender_Variables".gSP_H2O + "Blender_Variables".gWaterVFMCalcError ;
#mWaterMinFlow := "Blender_Variables".gSP_H2O - "Blender_Variables".gWaterVFMCalcError ;
IF "HMI_Blender_Parameters".Actual_Recipe_Parameters._SyrupDensity <> 0 THEN
#mSyrupMaxFlow := ("Blender_Variables".gSP_SYR + "Blender_Variables".gSyrupMFMCalcError) / "HMI_Blender_Parameters".Actual_Recipe_Parameters._SyrupDensity ;
#mSyrupMinFlow := ("Blender_Variables".gSP_SYR - "Blender_Variables".gSyrupMFMCalcError) / "HMI_Blender_Parameters".Actual_Recipe_Parameters._SyrupDensity ;
END_IF;
IF #mSyrupMaxFlow <> 0 THEN
#mMinRatio := #mWaterMinFlow / #mSyrupMaxFlow ;
END_IF;
IF #mSyrupMinFlow <> 0 THEN
#mMaxRatio := #mWaterMaxFlow / #mSyrupMinFlow ;
END_IF;
IF "HMI_Blender_Parameters".Actual_Recipe_Parameters._SyrupDensity <> 0 THEN
#mBevBrixMax := "HMI_Blender_Parameters".Actual_Recipe_Parameters._SyrupBrix / ((#mMinRatio / "HMI_Blender_Parameters".Actual_Recipe_Parameters._SyrupDensity) + 1) ;
#mBevBrixMin := "HMI_Blender_Parameters".Actual_Recipe_Parameters._SyrupBrix / ((#mMaxRatio / "HMI_Blender_Parameters".Actual_Recipe_Parameters._SyrupDensity) + 1) ;
END_IF;
"Blender_Variables".gBlenderBlendMaxError := #mBevBrixMax - #mBevBrixMin ;
#BlenderPID_FlowMeterErro := "Blender_Variables".gBlenderBlendMaxError ;
END_FUNCTION
```

View File

@ -0,0 +1,26 @@
```pascal
// Block Type: FC
// Block Number: 1916
// Original Network Languages: LAD
FUNCTION "BlenderPID_NextRecipe" : Void
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR_TEMP
Block_Move_Err : Int;
END_VAR
BEGIN
// Network 1: (Original Language: LAD)
"Block_Move_Err" := BLKMOV(SRCBLK := "System_RunOut_Variables"."gNext_Recipe", DSTBLK => "HMI_Blender_Parameters"."Actual_Recipe_Parameters"); // ADVERTENCIA: BLKMOV usado directamente, probablemente no compile!
// Network 2: (Original Language: LAD)
"HMI_Variables_Cmd"."Recipe"."Active_Recipe_Running" := "HMI_Blender_Parameters"."Next_Recipe_Number";
END_FUNCTION
```

View File

@ -0,0 +1,213 @@
```pascal
FUNCTION_BLOCK "BlenderPID_PIDFFCalc"
{ S7_Optimized_Access := 'FALSE' }
AUTHOR : 'Author'
FAMILY : TASK1
NAME : 'Name'
VERSION : 1.0
VAR
mWaterFF_SlewLimit : "SlewLimit";
mSP_SYR_Flow : Real;
END_VAR
BEGIN
"PID_Variables".PPN301FrictionLoss := "FrictionLoss"(i_Flow := "Blender_Variables".gSP_H2O,
i_K := "HMI_Blender_Parameters".ProcessSetup._KWaterLoss,
i_Dens := "Blender_Constants".gH2O_Density) ;
IF "PID_Variables".PPN301FrictionLoss > "HMI_Blender_Parameters".ProcessSetup._PPN301Pressure THEN
"PID_Variables".PPN301FrictionLoss := "HMI_Blender_Parameters".ProcessSetup._PPN301Pressure ;
ELSIF "PID_Variables".PPN301FrictionLoss < 0 THEN
(* classic code: "PID_Variables".PPN301FrictionLoss := 0.0 ;*)
"PID_Variables".PPN301FrictionLoss := REAL#0.0 ;
END_IF;
"PID_Variables".PPP302FrictionLoss := "FrictionLoss"(i_Flow := "Blender_Variables".gSP_SYR,
i_K := "HMI_Blender_Parameters".ProcessSetup._KSyrupLoss,
i_Dens := "Blender_Variables".gActualSyrupDens) ;
"gHProcessSetup_KWatPump" := (("HMI_Blender_Parameters".ProcessSetup._PPN301Pressure * 10) / 2500) ; (* Kwat = Pwat [METERS]/(fxf) f=50Hz*)
IF "PID_Variables".PPP302FrictionLoss > "HMI_Blender_Parameters".ProcessSetup._PPP302Pressure THEN
"PID_Variables".PPP302FrictionLoss := "HMI_Blender_Parameters".ProcessSetup._PPP302Pressure ;
ELSIF "PID_Variables".PPP302FrictionLoss < 0 THEN
(* classic code: "PID_Variables".PPP302FrictionLoss := 0.0 ;*)
"PID_Variables".PPP302FrictionLoss := REAL#0.0 ;
END_IF;
IF "gBlenderBlending" THEN
IF "HMI_PID".RMM301.ManualControl.PidEnable THEN
IF "gEqPressSelected" THEN
"PID_Variables".RMM301DeltaP := "HMI_Blender_Parameters".ProcessSetup._PPN301Pressure + "HMI_Instrument".PTN313.PVFiltered - "PID_Variables".PPN301FrictionLoss - "HMI_PID".RVM301.Pv ;
ELSE
"PID_Variables".RMM301DeltaP := "HMI_Blender_Parameters".ProcessSetup._PPN301Pressure + "HMI_Instrument".PTN313.PVFiltered - "PID_Variables".PPN301FrictionLoss - "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProdTankPress ;
END_IF;
IF "gBlenderStableFlow" THEN
// 100% / 12.5 sec = 8 %/sec slew LIMIT TO Water PID Feed Forward
#mWaterFF_SlewLimit(i_InValue := "FeedForward"(i_Flow := "Blender_Variables".gSP_H2O,
i_KFF := "HMI_PID".RMM301.Ff,
i_Delta_P := "PID_Variables".RMM301DeltaP),
i_SlewMax := 8,
i_Cycle := "Time_300ms",
out := "HMI_PID".RMM301.FfOut) ;
ELSE
"HMI_PID".RMM301.FfOut := "FeedForward"(i_Flow:="Blender_Variables".gSP_H2O ,i_KFF:="HMI_PID".RMM301.Ff, i_Delta_P:="PID_Variables".RMM301DeltaP) ;
END_IF;
IF NOT "gModValveRiseTimeCalcEn" THEN
"gModValveRiseTimeCalcEn":= TRUE ;
"Blender_Variables".gH2OValveRiseUpTime := REAL_TO_INT ("HMI_PID".RMM301.FfOut / 18) ;
END_IF;
END_IF;
ELSE
(* classic code: "HMI_PID".RMM301.FfOut := 0.0 ;*)
"HMI_PID".RMM301.FfOut := REAL#0.0 ;
"gModValveRiseTimeCalcEn" := FALSE ;
END_IF;
(* classic code: IF "HMI_PID".PPN301.Out <= 0.0 THEN*)
IF "HMI_PID".PPN301.Out <= REAL#0.0 THEN
"P1_Pressure" := "HMI_Blender_Parameters".ProcessSetup._PPN301Pressure;
ELSE
"P1_Pressure" := ("gHProcessSetup_KWatPump"*(SQR("HMI_PID".PPN301.Out))/10) - "PID_Variables".PPN301FrictionLoss;
END_IF;
IF "gBlenderBlending" THEN
IF "HMI_PID".RMP302.ManualControl.PidEnable THEN
IF "Procedure_Variables".First_Production.Latch THEN
"PID_Variables".RMP302DeltaP := "HMI_Blender_Parameters".ProcessSetup._PPP302Pressure - "PID_Variables".PPP302FrictionLoss - "HMI_PID".RVM301.Pv ;
ELSE
"PID_Variables".RMP302DeltaP := "HMI_Blender_Parameters".ProcessSetup._PPP302Pressure - "PID_Variables".PPP302FrictionLoss - "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProdTankPress ;
END_IF;
"HMI_PID".RMP302.FfOut := "FeedForward"(i_Flow := "Blender_Variables".gSP_SYR ,
i_KFF := "HMI_PID".RMP302.Ff ,
i_Delta_P := "PID_Variables".RMP302DeltaP) ;
END_IF;
ELSIF "gSyrupQcoRinse" OR "Procedure_Variables".FTP302Line_Preparation.Latch THEN
"PID_Variables".RMP302DeltaP := "HMI_Blender_Parameters".ProcessSetup._PPP302Pressure - "PID_Variables".PPP302FrictionLoss ;
"HMI_PID".RMP302.FfOut := "FeedForward"(i_Flow := "Blender_Variables".gSP_SYR ,
i_KFF := "HMI_PID".RMP302.Ff ,
i_Delta_P := "PID_Variables".RMP302DeltaP) ;
ELSE
(* classic code: "HMI_PID".RMP302.FfOut := 0.0 ;*)
"HMI_PID".RMP302.FfOut := REAL#0.0 ;
END_IF;
IF "gBlenderBlending" OR "gP_CarboPipe_En" OR ("HMI_Service".Workshop_Test.CO2TestRequest AND "gWorkshopTest") THEN
IF "HMI_PID".RMM303.ManualControl.PidEnable THEN
IF "HMI_Service".Workshop_Test.CO2TestRequest AND "gWorkshopTest" THEN
"PID_Variables".RMM303DeltaP := "HMI_PID".PCM306.Sp - "HMI_PID".RVM301.Pv ;
ELSE
IF "HMI_Blender_Parameters".Processor_Options.Blender_OPT._InverterWaterPumpPPN301 THEN
"PID_Variables".RMM303DeltaP := "HMI_Blender_Parameters".ProcessSetup._CarboCO2Pressure - "P1_Pressure" ;
ELSE
"PID_Variables".RMM303DeltaP := "HMI_Blender_Parameters".ProcessSetup._CarboCO2Pressure - "HMI_Blender_Parameters".ProcessSetup._PPN301Pressure ;
END_IF;
END_IF;
"HMI_PID".RMM303.FfOut := "FeedForward"(i_Flow := "Blender_Variables".gSP_CO2 ,
i_KFF := "HMI_PID".RMM303.Ff ,
i_Delta_P := "PID_Variables".RMM303DeltaP ) ;
IF "HMI_PID".RMM303.FfOut < 0 THEN
"HMI_PID".RMM303.FfOut := 0;
END_IF;
END_IF;
ELSE
(* classic code: "HMI_PID".RMM303.FfOut := 0.0 ;*)
"HMI_PID".RMM303.FfOut := REAL#0.0 ;
END_IF ;
// SECOND GAS INJECTION
IF "HMI_Blender_Parameters".Processor_Options.Blender_OPT._CO2_GAS2_Injection THEN
IF "gBlenderBlending" AND "HMI_Blender_Parameters".Actual_Recipe_Parameters._GAS2_Injection
AND ("HMI_Blender_Parameters".Processor_Options.Blender_OPT._GAS2InjectionType > 0) THEN
IF "HMI_PID".RMM304.ManualControl.PidEnable THEN
"PID_Variables".RMM304DeltaP := "HMI_Blender_Parameters".ProcessSetup._GAS2InjectionPress - "HMI_Blender_Parameters".ProcessSetup._PPN301Pressure ;
"HMI_PID".RMM304.FfOut := "FeedForward"(i_Flow := "Blender_Variables".gSP_GAS2 ,
i_KFF := "HMI_PID".RMM304.Ff ,
i_Delta_P := "PID_Variables".RMM304DeltaP ) ;
IF "HMI_PID".RMM304.FfOut < 0 THEN
"HMI_PID".RMM304.FfOut := 0;
END_IF;
END_IF;
ELSE
(* classic code: "HMI_PID".RMM304.FfOut := 0.0 ;*)
"HMI_PID".RMM304.FfOut := REAL#0.0 ;
END_IF ;
ELSE
(* classic code: "HMI_PID".RMM304.FfOut := 0.0 ;*)
"HMI_PID".RMM304.FfOut := REAL#0.0 ;
END_IF ;
IF "gBlenderBlending" THEN
#mSP_SYR_Flow := "Blender_Variables".gSP_SYR ;
ELSIF "Procedure_Variables".FTP302Line_Preparation.Latch OR "Procedure_Variables".FTP302_StartUp.Latch THEN
#mSP_SYR_Flow := "Blender_Constants".gTP301_FirstProdRate ;
ELSIF "gSyrupQcoRinse" THEN
#mSP_SYR_Flow := "Blender_Constants".gTP301_RinseRate ;
ELSE
(* classic code: #mSP_SYR_Flow := 0.0 ;*)
#mSP_SYR_Flow := REAL#0.0 ;
END_IF ;
IF "gBlenderBlending" OR "Procedure_Variables".FTP302Line_Preparation.Latch OR "Procedure_Variables".FTP302_StartUp.Latch OR "gSyrupQcoRinse" THEN
IF "HMI_PID".RVP303.ManualControl.PidEnable THEN
"HMI_PID".RVP303.FfOut := "FeedForward"(i_Flow:=#mSP_SYR_Flow ,
i_KFF:="HMI_PID".RVP303.Ff ,
i_Delta_P:= "HMI_Blender_Parameters".ProcessSetup._SyrupLinePressure) ;
END_IF ;
ELSE
(* classic code: "HMI_PID".RVP303.FfOut := 0.0 ;*)
"HMI_PID".RVP303.FfOut := REAL#0.0 ;
END_IF ;
IF NOT "Blender_Variables_Pers".gSkipDeaireation THEN
IF "gBlenderBlending" OR "Procedure_Variables".TN301_StartUp.Latch THEN
IF "HMI_PID".RVN302.ManualControl.PidEnable THEN
IF "HMI_Device".PPN304.Out THEN
"PID_Variables".RVN302DeltaP := "HMI_Blender_Parameters".ProcessSetup._WaterLinePressure - "HMI_Instrument".PTN313.PVFiltered ;
ELSE
"PID_Variables".RVN302DeltaP := "HMI_Blender_Parameters".ProcessSetup._WaterLinePressure ;
END_IF ;
"HMI_PID".RVN302.FfOut := "FeedForward"(i_Flow := "Blender_Variables".gSP_H2O ,
i_KFF := "HMI_PID".RVN302.Ff ,
i_Delta_P := "PID_Variables".RVN302DeltaP) ;
END_IF ;
ELSE
(* classic code: "HMI_PID".RVN302.FfOut := 0.0 ;*)
"HMI_PID".RVN302.FfOut := REAL#0.0 ;
END_IF ;
ELSE
IF "gBlenderBlending" OR "Procedure_Variables".BlendFill_StartUp.Latch THEN
IF "HMI_PID".RVN302.ManualControl.PidEnable THEN
"PID_Variables".RVN302DeltaP := "HMI_Blender_Parameters".ProcessSetup._WaterLinePressure ;
"HMI_PID".RVN302.FfOut := "FeedForward"(i_Flow := "Filler_Head_Variables".Prod_FlowEstimated ,
i_KFF := "HMI_PID".RVN302_TM301.Ff ,
i_Delta_P := "PID_Variables".RVN302DeltaP) ;
END_IF ;
ELSE
(* classic code: "HMI_PID".RVN302.FfOut := 0.0 ;*)
"HMI_PID".RVN302.FfOut := REAL#0.0 ;
END_IF ;
END_IF;
IF "gGencoldChillerEn" AND "HMI_Blender_Parameters".Actual_Recipe_Parameters._EnProdTemp THEN
(* classic code: "HMI_PID".RVM319_H2O.FfOut := 100.0 - "CVQ_1p7_8_Perc"("HMI_PID".RVM319_H2O.Sp) ;*)
"HMI_PID".RVM319_H2O.FfOut := REAL#100.0 - "CVQ_1p7_8_Perc"("HMI_PID".RVM319_H2O.Sp) ;
(* classic code: "HMI_PID".RVM319_PRD.FfOut := 100.0 - "CVQ_1p7_8_Perc"("HMI_PID".RVM319_PRD.Sp) ;*)
"HMI_PID".RVM319_PRD.FfOut := REAL#100.0 - "CVQ_1p7_8_Perc"("HMI_PID".RVM319_PRD.Sp);
ELSIF
NOT "gGencoldChillerEn" AND "HMI_Blender_Parameters".Actual_Recipe_Parameters._EnProdTemp THEN
(* classic code: "HMI_PID".RVM319_H2O.FfOut := 0.0 ;*)
"HMI_PID".RVM319_H2O.FfOut := REAL#80.0 ;
(* classic code: "HMI_PID".RVM319_PRD.FfOut := 0.0 ;*)
"HMI_PID".RVM319_PRD.FfOut := REAL#80.0 ;
END_IF;
END_FUNCTION_BLOCK
```

View File

@ -0,0 +1,232 @@
```pascal
FUNCTION_BLOCK "BlenderPID_PIDInitParam"
{ S7_Optimized_Access := 'FALSE' }
AUTHOR : 'Author'
FAMILY : TASK1
NAME : 'Name'
VERSION : 1.0
VAR
mCO2DevStdInt : Int;
mGAS2DevStdInt : Int;
mH2OKp : Real;
mSyrKp : Real;
mCO2DevStdFOut : Real;
mCO2Kp : Real;
mGAS2DevStdFOut : Real;
mGAS2Kp : Real;
mH2OKpLimit : "SlewLimit";
mSyrKpLimit : "SlewLimit";
mCO2KpLimit : "SlewLimit";
mGAS2KpLimit : "SlewLimit";
mCO2DevStdFlt : "LowPassFilter";
mGAS2DevStdFlt : "LowPassFilter";
END_VAR
VAR_TEMP
mAuxONS_Q : Bool;
mAuxONS1_Q : Bool;
END_VAR
BEGIN
"Blender_Variables".gK_RecBlendError := "HMI_Blender_Parameters".ProcessSetup._KRecBlendError ;
"Blender_Variables".gK_RecCarboCO2Error := "HMI_Blender_Parameters".ProcessSetup._KRecCarboCO2Error ;
"HMI_PID".RMM301.Cycle_Time := "Time_300ms" ;
"HMI_PID".RMP302.Cycle_Time := "Time_300ms" ;
"HMI_PID".RMM303.Cycle_Time := "Time_300ms" ;
"HMI_PID".RMM304.Cycle_Time := "Time_300ms" ;
"HMI_PID".RVM301.Cycle_Time := "Time_300ms" ;
"HMI_PID".RVP303.Cycle_Time := "Time_300ms" ;
"HMI_PID".RVN302.Cycle_Time := "Time_300ms" ;
"HMI_PID".RVS318.Cycle_Time := "Time_300ms" ;
"HMI_PID".RVM319_PRD.Cycle_Time := "Time_300ms" ;
"HMI_PID".RVM319_H2O.Cycle_Time := "Time_300ms" ;
IF "HMI_PID".RMM301.Bp <> 0 THEN
"HMI_PID".RMM301.KP := 100 / "HMI_PID".RMM301.Bp ;
#mH2OKp := "HMI_PID".RMM301.KP ;
(* classic code: #mH2OKpLimit(i_InValue := #mH2OKp ,
i_SlewMax := 0.02 ,
i_Cycle := "Time_300ms",
out := "HMI_PID".RMM301.KP) ;*)
#mH2OKpLimit(i_InValue := #mH2OKp ,
i_SlewMax := REAL#0.02 ,
i_Cycle := "Time_300ms",
out := "HMI_PID".RMM301.KP) ;
ELSE
(* classic code: "HMI_PID".RMM301.KP := 0.0 ;*)
"HMI_PID".RMM301.KP := REAL#0.0 ;
END_IF;
IF "HMI_PID".RMP302.Bp <> 0 THEN
"HMI_PID".RMP302.KP := 100 / "HMI_PID".RMP302.Bp ;
IF "gBlenderStopping" THEN
(* classic code: #mSyrKp := "HMI_PID".RMP302.KP * 1.4 ;*)
#mSyrKp := "HMI_PID".RMP302.KP * REAL#1.4 ;
ELSE
#mSyrKp := "HMI_PID".RMP302.KP ;
END_IF;
(* classic code: #mSyrKpLimit(i_InValue := #mSyrKp ,
i_SlewMax := 0.08 ,
i_Cycle := "Time_300ms" ,
out := "HMI_PID".RMP302.KP) ;*)
#mSyrKpLimit(i_InValue := #mSyrKp ,
i_SlewMax := REAL#0.08 ,
i_Cycle := "Time_300ms" ,
out := "HMI_PID".RMP302.KP) ;
ELSE
(* classic code: "HMI_PID".RMP302.KP := 0.0 ;*)
"HMI_PID".RMP302.KP := REAL#0.0 ;
END_IF;
IF "HMI_PID".RMM303.Bp <> 0 THEN
"HMI_PID".RMM303.KP := 100 / "HMI_PID".RMM303.Bp ;
#mCO2DevStdFlt(i_Value := "Blender_Variables".gCarboCO2Stat_DevStd ,
i_Num := 10 ,
i_Enable := "gBlenderFlowFltEn") ;
#mCO2DevStdFOut := ABS(#mCO2DevStdFlt.FilterOut) ;
"ONS_R"(Enable_ONS := "gP_CarboPipe_En", Aux_ONS := "mCO2TdOns", ONS_R => #mAuxONS_Q);
IF #mAuxONS_Q THEN
"mCO2TD" := "HMI_PID".RMM303.Td ;
END_IF;
"ONS_R"(Enable_ONS := NOT "gP_CarboPipe_En", Aux_ONS := "mCO2Td1Ons", ONS_R => #mAuxONS1_Q);
IF #mAuxONS1_Q THEN
"HMI_PID".RMM303.Td := "mCO2TD" ;
END_IF;
IF "gBlenderStableFlow" THEN
#mCO2DevStdInt := REAL_TO_INT(#mCO2DevStdFOut * 1) ;
END_IF;
IF #mCO2DevStdInt < 1 THEN
#mCO2Kp := 1 ;
ELSIF #mCO2DevStdInt > 10 THEN
#mCO2DevStdInt := 10 ;
END_IF;
IF "gBlenderStopping" THEN
(* classic code: #mCO2Kp := "HMI_PID".RMM303.KP * 1.3 ;*)
#mCO2Kp := "HMI_PID".RMM303.KP * REAL#1.3 ;
ELSIF "gP_CarboPipe_En" THEN
// mCO2Kp := "PID_Variables".CO2_PID.KP / 2.5 ;
(* classic code: #mCO2Kp := 0.006 ;*)
#mCO2Kp := REAL#0.006 ;
"HMI_PID".RMM303.KP := #mCO2Kp ;
(* classic code: "HMI_PID".RMM303.Td := 0.0 ;*)
"HMI_PID".RMM303.Td := REAL#0.0 ;
// gR_CO2_TI := 30 ;
ELSIF #mCO2DevStdInt > 5 AND NOT "gBlenderStopping" THEN
#mCO2Kp := "HMI_PID".RMM303.KP / 2;
ELSE
#mCO2Kp := "HMI_PID".RMM303.KP ;
END_IF;
(* classic code: #mCO2KpLimit(i_InValue := #mCO2Kp ,
i_SlewMax := 0.8 ,
i_Cycle := "Time_300ms",
out := "HMI_PID".RMM303.KP) ;*)
#mCO2KpLimit(i_InValue := #mCO2Kp ,
i_SlewMax := REAL#0.8 ,
i_Cycle := "Time_300ms",
out := "HMI_PID".RMM303.KP) ;
ELSE
(* classic code: "HMI_PID".RMM303.KP:= 0.0 ;*)
"HMI_PID".RMM303.KP:= REAL#0.0 ;
END_IF;
// SECOND GAS INJECTION
IF "HMI_PID".RMM304.Bp <> 0 THEN
"HMI_PID".RMM304.KP := 100 / "HMI_PID".RMM304.Bp ;
#mGAS2DevStdFlt(i_Value := "Blender_Variables".gGAS2Stat_DevStd ,
i_Num := 10 ,
i_Enable := "gBlenderFlowFltEn") ;
#mGAS2DevStdFOut := ABS(#mGAS2DevStdFlt.FilterOut) ;
IF "gBlenderStableFlow" THEN
#mGAS2DevStdInt := REAL_TO_INT(#mGAS2DevStdFOut * 1) ;
END_IF;
IF #mGAS2DevStdInt < 1 THEN
#mGAS2Kp := 1 ;
ELSIF #mGAS2DevStdInt > 10 THEN
#mGAS2DevStdInt := 10 ;
END_IF;
IF "gBlenderStopping" THEN
(* classic code: #mGAS2Kp := "HMI_PID".RMM304.KP * 1.3 ;*)
#mGAS2Kp := "HMI_PID".RMM304.KP * REAL#1.3 ;
ELSIF #mGAS2DevStdInt > 5 AND NOT "gBlenderStopping" THEN
#mGAS2Kp := "HMI_PID".RMM304.KP / 2;
ELSE
#mGAS2Kp := "HMI_PID".RMM304.KP ;
END_IF;
(* classic code: #mGAS2KpLimit(i_InValue := #mGAS2Kp ,
i_SlewMax := 0.8 ,
i_Cycle := "Time_300ms",
out := "HMI_PID".RMM304.KP) ;*)
#mGAS2KpLimit(i_InValue := #mGAS2Kp ,
i_SlewMax := REAL#0.8 ,
i_Cycle := "Time_300ms",
out := "HMI_PID".RMM304.KP) ;
ELSE
(* classic code: "HMI_PID".RMM304.KP:= 0.0 ;*)
"HMI_PID".RMM304.KP:= REAL#0.0 ;
END_IF;
IF "HMI_PID".RVP303.Bp <> 0 THEN
"HMI_PID".RVP303.KP := 100 / "HMI_PID".RVP303.Bp ;
ELSE
(* classic code: "HMI_PID".RVP303.KP := 0.0 ;*)
"HMI_PID".RVP303.KP := REAL#0.0 ;
END_IF;
IF NOT "Blender_Variables_Pers".gSkipDeaireation THEN
IF "HMI_PID".RVN302.Bp <> 0 THEN
"HMI_PID".RVN302.KP := 100 / "HMI_PID".RVN302.Bp ;
ELSE
(* classic code: "HMI_PID".RVN302.KP := 0.0 ;*)
"HMI_PID".RVN302.KP := REAL#0.0 ;
END_IF;
ELSE
IF "HMI_PID".RVN302_TM301.Bp <> 0 THEN
"HMI_PID".RVN302.KP := 100 / "HMI_PID".RVN302_TM301.Bp ;
ELSE
(* classic code: "HMI_PID".RVN302.KP := 0.0 ;*)
"HMI_PID".RVN302.KP := REAL#0.0 ;
END_IF;
END_IF ;
IF "HMI_PID".RVS318.Bp <> 0 THEN
"HMI_PID".RVS318.KP := 100 / "HMI_PID".RVS318.Bp ;
ELSE
(* classic code: "HMI_PID".RVS318.KP := 0.0 ;*)
"HMI_PID".RVS318.KP := REAL#0.0 ;
END_IF;
IF "HMI_PID".RVM319_PRD.Bp <> 0 THEN
"HMI_PID".RVM319_PRD.KP := 100 / "HMI_PID".RVM319_PRD.Bp ;
ELSE
(* classic code: "HMI_PID".RVM319_PRD.KP := 0.0 ;*)
"HMI_PID".RVM319_PRD.KP := REAL#0.0 ;
END_IF;
IF "HMI_PID".RVM319_H2O.Bp <> 0 THEN
"HMI_PID".RVM319_H2O.KP := 100 / "HMI_PID".RVM319_H2O.Bp ;
ELSE
(* classic code: "HMI_PID".RVM319_H2O.KP := 0.0 ;*)
"HMI_PID".RVM319_H2O.KP := REAL#0.0 ;
END_IF;
END_FUNCTION_BLOCK
```

View File

@ -0,0 +1,61 @@
```pascal
FUNCTION "BlenderPID_PIDResInteg" : Void
{ S7_Optimized_Access := 'FALSE' }
AUTHOR : 'Author'
FAMILY : TASK1
NAME : 'Name'
VERSION : 1.0
BEGIN
(* classic code: "HMI_PID".RMM301.I_ITLVAL := 0.0 ;*)
"HMI_PID".RMM301.I_ITLVAL := REAL#0.0 ;
(* classic code: "PID_Variables".RMM301PIDIntValue := 0.0 ;*)
"PID_Variables".RMM301PIDIntValue := REAL#0.0 ;
"HMI_PID".RMM301.I_ITL := TRUE ;
(* classic code: "HMI_PID".RMP302.I_ITLVAL := 0.0 ;*)
"HMI_PID".RMP302.I_ITLVAL := REAL#0.0 ;
(* classic code: "PID_Variables".RMP302PIDIntValue := 0.0 ;*)
"PID_Variables".RMP302PIDIntValue := REAL#0.0 ;
"HMI_PID".RMP302.I_ITL := TRUE ;
(* classic code: "HMI_PID".RMM303.I_ITLVAL := 0.0 ;*)
"HMI_PID".RMM303.I_ITLVAL := REAL#0.0 ;
(* classic code: "PID_Variables".RMM303PIDIntValue := 0.0;*)
"PID_Variables".RMM303PIDIntValue := REAL#0.0;
"HMI_PID".RMM303.I_ITL := TRUE ;
// SECOND GAS INJECTION
(* classic code: "HMI_PID".RMM304.I_ITLVAL := 0.0 ;*)
"HMI_PID".RMM304.I_ITLVAL := REAL#0.0 ;
(* classic code: "PID_Variables".RMM304PIDIntValue := 0.0;*)
"PID_Variables".RMM304PIDIntValue := REAL#0.0;
"HMI_PID".RMM304.I_ITL := TRUE ;
(* classic code: "HMI_PID".RVM301.I_ITLVAL := 0.0 ;*)
"HMI_PID".RVM301.I_ITLVAL := REAL#0.0 ;
"HMI_PID".RVM301.I_ITL := TRUE ;
(* classic code: "HMI_PID".RVP303.I_ITLVAL := 0.0 ;*)
"HMI_PID".RVP303.I_ITLVAL := REAL#0.0 ;
"HMI_PID".RVP303.I_ITL := TRUE ;
(* classic code: "HMI_PID".RVN302.I_ITLVAL := 0.0 ;*)
"HMI_PID".RVN302.I_ITLVAL := REAL#0.0 ;
"HMI_PID".RVN302.I_ITL := TRUE ;
(* classic code: "HMI_PID".RVM319_PRD.I_ITLVAL := 0.0 ;*)
"HMI_PID".RVM319_PRD.I_ITLVAL := REAL#0.0 ;
"HMI_PID".RVM319_PRD.I_ITL := TRUE ;
(* classic code: "HMI_PID".RVM319_H2O.I_ITLVAL := 0.0 ;*)
"HMI_PID".RVM319_H2O.I_ITLVAL := REAL#0.0 ;
"HMI_PID".RVM319_H2O.I_ITL := TRUE ;
END_FUNCTION
```

View File

@ -0,0 +1,464 @@
```pascal
FUNCTION_BLOCK "BlenderPID_PIDSPCalc"
{ S7_Optimized_Access := 'FALSE' }
AUTHOR : 'Author'
FAMILY : TASK1
NAME : 'Name'
VERSION : 1.0
VAR
mCriticalBlending : Bool;
TimerConvDINT : DInt;
TimerConvTIME : Time;
TimerConvS5TIME : S5Time;
mTargetRatioSlewOut : Real;
mBevBrixDelta : Real;
mTargetProdSlwd : "SlewLimit";
mTargetFillerProdSlwd : "SlewLimit";
mTargetRatioSlwd : "SlewLimit";
mTargetSyrupLvlSlwd : "SlewLimit";
mTargetDeairLvlSlwd : "SlewLimit";
mTargetStorgLvlSlwd : "SlewLimit";
END_VAR
VAR_TEMP
ValBinTmr131 : Word;
ValBcdTmr131 : S5Time;
END_VAR
BEGIN
IF "HMI_Blender_Parameters".Processor_Options.Blender_OPT._BrixMeter AND "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProdMeterHighBrix > "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProductBrix
AND "AUX FALSE" THEN
(* classic code: #mBevBrixDelta := ("HMI_Blender_Parameters".Actual_Recipe_Parameters._ProdMeterHighBrix - "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProductBrix) / 2.0 ;*)
#mBevBrixDelta := ("HMI_Blender_Parameters".Actual_Recipe_Parameters._ProdMeterHighBrix - "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProductBrix) / REAL#2.0 ;
ELSE
// mBevBrixDelta := 0.1 ; Pepsico Vitoria Plant - New Eurostar 2000 140 Valves
(* classic code: #mBevBrixDelta := 0.06 ;*)
#mBevBrixDelta := REAL#0.06 ; //Coca Cola Begano Plant - New Starcans 2000 91 Valves
END_IF;
IF "Blender_Variables_Pers".gSugarBeverage AND "HMI_Blender_Parameters".Actual_Recipe_Parameters._SyrupBrix <> 0 THEN
IF "Procedure_Variables".First_Production.Latch THEN
"Blender_Variables".gActualSyrupPerc := ("HMI_Blender_Parameters".Actual_Recipe_Parameters._ProductBrix + "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProdBrixOffset + "Blender_Variables".gFirstProdExtraBrix)
/ "Blender_Variables".gActualSyrupBrix ;
ELSE
"Blender_Variables".gActualSyrupPerc := ("HMI_Blender_Parameters".Actual_Recipe_Parameters._ProductBrix + "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProdBrixOffset + "Blender_Variables".gBrixTrackingCorr)
/ "Blender_Variables".gActualSyrupBrix ;
END_IF;
ELSE
IF "Procedure_Variables".First_Production.Latch THEN
"Blender_Variables".gActualSyrupPerc := 1 / ("HMI_Blender_Parameters".Actual_Recipe_Parameters._Ratio + 1 ) + "Blender_Variables".gFirstProdDietExtraSyr ; // During First Production: syrup injection 1.2% more
ELSE
"Blender_Variables".gActualSyrupPerc := 1 / ("HMI_Blender_Parameters".Actual_Recipe_Parameters._Ratio + 1 ) ;
END_IF;
END_IF;
IF "Blender_Variables_Pers".gWaterRecipe THEN
(* classic code: "Blender_Variables".gActualWaterPerc := 1.0 ;*)
"Blender_Variables".gActualWaterPerc := REAL#1.0 ;
(* classic code: "Blender_Variables".gActualSyrupPerc := 0.0 ;*)
"Blender_Variables".gActualSyrupPerc := REAL#0.0 ;
ELSE
"Blender_Variables".gActualWaterPerc := 1 - "Blender_Variables".gActualSyrupPerc ;
END_IF;
IF "Blender_Variables".gActualSyrupPerc <> 0 THEN
(* classic code: IF "Blender_Variables".gActualSyrupDens > 0.99 AND NOT "Blender_Variables_Pers".gSugarBeverage THEN*)
IF "Blender_Variables".gActualSyrupDens > REAL#0.99 AND NOT "Blender_Variables_Pers".gSugarBeverage THEN
"Blender_Variables".gActual_RatioM := "Blender_Variables".gActualWaterPerc / ("Blender_Variables".gActualSyrupPerc * "Blender_Variables".gActualSyrupDens) ;
ELSE
"Blender_Variables".gActual_RatioM := "Blender_Variables".gActualWaterPerc / "Blender_Variables".gActualSyrupPerc ;
END_IF;
END_IF;
IF "Blender_Constants".gH2O_Density <> 0 THEN
"gActualSP_RatioVol" := "Blender_Variables".gActual_RatioM * "Blender_Variables".gActualSyrupDens / "Blender_Constants".gH2O_Density ;
END_IF;
IF "gActualSP_RatioVol" = 0 THEN
(* classic code: "gActualSP_RatioVol" := 0.01 ;*)
"gActualSP_RatioVol" := REAL#0.01 ;
END_IF;
IF "Blender_Constants".gModValveFullStrokeTime <> 0 THEN
"Blender_Variables".gBlenderProdSlewMax := "Blender_Variables".gBlenderNomSpeed / "Blender_Constants".gModValveFullStrokeTime ;
IF "Blender_Constants".gProductionSlewRate > "Blender_Variables".gBlenderProdSlewMax THEN
"Blender_Constants".gProductionSlewRate := "Blender_Variables".gBlenderProdSlewMax ;
END_IF;
END_IF;
//Limit the minimum and maximum recipe Production Rate
IF "Blender_Variables".gActual_Prod_SP > "Blender_Variables".gBlenderNomSpeed THEN
"Blender_Variables".gActual_Prod_SP := "Blender_Variables".gBlenderNomSpeed ;
END_IF;
IF "Blender_Variables".gActual_Prod_SP < "Blender_Variables".gMinProduction AND NOT "Procedure_Variables".Blender_Run.Wait THEN
"Blender_Variables".gActual_Prod_SP := "Blender_Variables".gMinProduction ;
END_IF;
IF "gBlenderProdMode" THEN
//Calculates the CO2 Equilibrium Pressure plus 0.5 Atm, to Pressurize Product Tank
IF "Blender_Variables_Pers".gCarboStillRecipe THEN
(* classic code: "Blender_Variables".gCO2EqPressure := LIMIT (MN:= 0, IN:= "CO2EqPress"(i_CO2Vol := "HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Vols * "Blender_Variables".gFirstProdExtraCO2Fact
* "HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Fact ,
i_Temp := "HMI_Blender_Parameters".Actual_Recipe_Parameters._SP_ProdTemp ), MX:= "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProdTankPress) + 0.3 ;*)
"Blender_Variables".gCO2EqPressure := LIMIT(MN := 0, IN := "CO2EqPress"(i_CO2Vol := "HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Vols * "Blender_Variables".gFirstProdExtraCO2Fact
* "HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Fact,
i_Temp := "HMI_Blender_Parameters".Actual_Recipe_Parameters._SP_ProdTemp), MX := "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProdTankPress) + REAL#0.8; // REAL#0.3 ;
ELSE
"Blender_Variables".gCO2EqPressure := "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProdTankPress ;
END_IF;
// Transfer the Set Point TO the PID's SP Input
IF "gBlenderRinseMode" AND NOT "Procedure_Variables".TM301_Drain.Latch THEN
"HMI_PID".RVM301.Sp := "HMI_Blender_Parameters".ProcessSetup._RinseTM301Press ;
ELSIF "Procedure_Variables".TM301_Drain.Latch THEN
"HMI_PID".RVM301.Sp := "HMI_Blender_Parameters".ProcessSetup._DrainTM301Press ;
ELSIF NOT "gWaitLevToHold_TankPress" AND NOT "Procedure_Variables".First_Production.Done THEN
"HMI_PID".RVM301.Sp := "Blender_Variables".gCO2EqPressure ;
ELSE
"HMI_PID".RVM301.Sp := "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProdTankPress ;
END_IF;
IF "Procedure_Variables".First_Production.Latch AND NOT "Procedure_Variables".Blender_Run.Wait THEN // During First Production set minimum speed
"Blender_Variables".gActual_Prod_SP := "Blender_Variables".gMinProduction * "Blender_Constants".gFirstProdSpeedGain ;
END_IF;
IF "gBlenderStartPumps" AND NOT "gBlenderBlending" AND "gEnRampDownToStop" THEN // Start blending with minimum speed
(* classic code: IF "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProductionRate >= (0.5 * "Blender_Variables".gBlenderNomSpeed) THEN*)
IF "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProductionRate >= (REAL#0.5 * "Blender_Variables".gBlenderNomSpeed) THEN
(* classic code: "Blender_Variables".gActual_Prod_SP := 0.5 * "Blender_Variables".gBlenderNomSpeed ;*)
"Blender_Variables".gActual_Prod_SP := REAL#0.5 * "Blender_Variables".gBlenderNomSpeed ;
ELSE
"Blender_Variables".gActual_Prod_SP := "Blender_Variables".gMinProduction ;
END_IF;
ELSIF NOT "gEnRampDownToStop" THEN
"Blender_Variables".gActual_Prod_SP := "Blender_Variables".gSP_ProdTrackFiller ;
ELSE
IF NOT "Procedure_Variables".First_Production.Latch AND "gBlenderEnToRamp" THEN
#mTargetFillerProdSlwd(i_InValue := "Blender_Variables".gSP_ProdTrackFiller ,
i_SlewMax := "Blender_Constants".gFillerSpeedTrackSlew ,
i_Cycle := "Time_300ms" ,
out := "Blender_Variables".gActual_Prod_SP) ;
END_IF;
IF "Procedure_Variables".Blender_Run.Wait THEN
// Stop Blender with the Maximum Slope
(* classic code: #mTargetProdSlwd(i_InValue := 0.0 ,
i_SlewMax := "Blender_Variables".gBlenderProdSlewMax ,
i_Cycle := "Time_300ms" ,
out := "Blender_Variables".gActual_Prod_SP ) ;*)
#mTargetProdSlwd(i_InValue := REAL#0.0 ,
i_SlewMax := "Blender_Variables".gBlenderProdSlewMax ,
i_Cycle := "Time_300ms" ,
out := "Blender_Variables".gActual_Prod_SP ) ; // Slewed AT ""Blender_Variables".gBlenderProdSlewMax" L/sec
END_IF;
END_IF;
ELSE
(* classic code: "Blender_Variables".gActual_Prod_SP := 0.0 ;*)
"Blender_Variables".gActual_Prod_SP := REAL#0.0 ;
END_IF;
(* classic code: #mTargetRatioSlwd(i_InValue := "gActualSP_RatioVol",
i_SlewMax := 0.02,
i_Cycle := "Time_300ms",
out := #mTargetRatioSlewOut ) ;*)
#mTargetRatioSlwd(i_InValue := "gActualSP_RatioVol",
i_SlewMax := REAL#0.02,
i_Cycle := "Time_300ms",
out := #mTargetRatioSlewOut ) ; // Slewed AT 0.02
IF "Procedure_Variables".Blender_Run.Running AND NOT "gBlenderRinseMode" THEN
(* classic code: IF NOT "Blender_Variables_Pers".gWaterRecipe AND ("gActualSP_RatioVol" + 1.0) <> 0 THEN*)
IF NOT "Blender_Variables_Pers".gWaterRecipe AND ("gActualSP_RatioVol" + REAL#1.0) <> 0 THEN
(* classic code: "Blender_Variables".gSP_H2O := "Blender_Variables".gActual_Prod_SP / ("gActualSP_RatioVol" + 1.0) * "gActualSP_RatioVol" ;*)
"Blender_Variables".gSP_H2O := "Blender_Variables".gActual_Prod_SP / ("gActualSP_RatioVol" + REAL#1.0) * "gActualSP_RatioVol" ;
ELSE
"Blender_Variables".gSP_H2O := "Blender_Variables".gActual_Prod_SP ;
END_IF;
ELSE
(* classic code: "Blender_Variables".gSP_H2O := 0.0 ;*)
"Blender_Variables".gSP_H2O := REAL#0.0 ;
END_IF;
IF "HMI_PID".RMM301.Sp > 0 THEN
(* classic code: IF ABS("Blender_Variables".gBlendError) > 0.5 AND ABS(("HMI_PID".RMM301.Sp - "HMI_PID".RMM301.Pv) / "HMI_PID".RMM301.Sp) > 0.2
AND ("Blender_Variables".gActual_Prod_SP >(0.6 * "Blender_Variables".gBlenderNomSpeed)) AND "gFlowToFiller" THEN*)
IF ABS("Blender_Variables".gBlendError) > REAL#0.5 AND ABS(("HMI_PID".RMM301.Sp - "HMI_PID".RMM301.Pv) / "HMI_PID".RMM301.Sp) > REAL#0.2
AND ("Blender_Variables".gActual_Prod_SP >(REAL#0.6 * "Blender_Variables".gBlenderNomSpeed)) AND "gFlowToFiller" THEN
#mCriticalBlending := TRUE ;
ELSE
#mCriticalBlending := FALSE ;
END_IF;
ELSE
#mCriticalBlending := FALSE ;
END_IF;
#TimerConvDINT := REAL_TO_DINT ("Blender_Constants".gModValveFullStrokeTime * 1000) ;
#TimerConvTIME := DINT_TO_TIME (#TimerConvDINT);
#TimerConvS5TIME := TIME_TO_S5TIME(IN := #TimerConvTIME // IN: TIME FC40
); // S5TIME
#ValBcdTmr131:= S_OFFDT (T_NO := "mCriticalBlendingTOF" ,
S := #mCriticalBlending ,
TV := #TimerConvS5TIME , // Timer in sec
R := "AUX FALSE" ,
BI => #ValBinTmr131 ,
Q => "gCriticalBlending" ) ;
IF ("gBlenderEnToRamp" AND ("HMI_PID".RMM301.Out > 95)) OR "gCriticalBlending" OR ("gBlenderStopping" AND "gBlenderBlending")
OR "HMI_Blender_Parameters".Processor_Options.Blender_OPT._TrackH2OEnable THEN
"PID_Variables".Track_H2O_Enable := TRUE ;
ELSE
"PID_Variables".Track_H2O_Enable := FALSE ;
END_IF;
IF "Procedure_Variables".Blender_Run.Running AND NOT "Blender_Variables_Pers".gWaterRecipe AND NOT "gBlenderRinseMode" AND NOT "Procedure_Variables".FTP302Line_Preparation.Latch THEN
IF "gBlenderStableFlow" THEN
IF "PID_Variables".Track_H2O_Enable AND "gBlenderEnToRamp" THEN
"Blender_Variables".gSyrSPRef := "Blender_Variables".gH2O_Flow_Meas / "gActualSP_RatioVol" ;
ELSE
(* classic code: "Blender_Variables".gSyrSPRef := "Blender_Variables".gActual_Prod_SP / ("gActualSP_RatioVol" + 1.0) ;*)
"Blender_Variables".gSyrSPRef := "Blender_Variables".gActual_Prod_SP / ("gActualSP_RatioVol" + REAL#1.0) ;
END_IF;
ELSE
IF "PID_Variables".Track_H2O_Enable THEN
"Blender_Variables".gSyrSPRef := "Blender_Variables".gH2O_Flow_Meas / "gActualSP_RatioVol" ;
ELSE
(* classic code: "Blender_Variables".gSyrSPRef := "Blender_Variables".gActual_Prod_SP / ("gActualSP_RatioVol" + 1.0) ;*)
"Blender_Variables".gSyrSPRef := "Blender_Variables".gActual_Prod_SP / ("gActualSP_RatioVol" + REAL#1.0) ;
END_IF;
END_IF;
(* classic code: "Blender_Variables".gSyrSPTemp := LIMIT(MN:= (-1.0 * "Blender_Variables".gSyrSPRef * "Blender_Constants".gSyrupSPRecFact),
IN:= ("Blender_Variables".gBlendError * "Blender_Variables".gK_RecBlendError),
MX:= ("Blender_Variables".gSyrSPRef * "Blender_Constants".gSyrupSPRecFact));*)
"Blender_Variables".gSyrSPTemp := LIMIT(MN:= (REAL#-1.0 * "Blender_Variables".gSyrSPRef * "Blender_Constants".gSyrupSPRecFact),
IN:= ("Blender_Variables".gBlendError * "Blender_Variables".gK_RecBlendError),
MX:= ("Blender_Variables".gSyrSPRef * "Blender_Constants".gSyrupSPRecFact));
"Blender_Variables".gSP_SYR := ("Blender_Variables".gSyrSPRef + "Blender_Variables".gSyrSPTemp) * "Blender_Variables".gActualSyrupDens ;
ELSIF "Procedure_Variables".FTP302Line_Preparation.Latch OR "Procedure_Variables".FTP302_StartUp.Latch THEN
"Blender_Variables".gSP_SYR := "Blender_Constants".gTP301_FirstProdRate;
ELSIF "gSyrupQcoRinse" THEN
"Blender_Variables".gSP_SYR := "Blender_Constants".gTP301_RinseRate;
ELSE
(* classic code: "Blender_Variables".gSP_SYR := 0.0 ;*)
"Blender_Variables".gSP_SYR := REAL#0.0 ;
END_IF;
"Blender_Variables".gDeairCO2Comp := "DeairCO2TempComp"(i_Temp := "HMI_Instrument".TTN321.PVFiltered,
i_CO2Off := "HMI_Blender_Parameters".Processor_Options.Blender_OPT._CO2_Offset) ;
"Blender_Variables".gWaterO2 := "PPM O2"(i_Temp := "HMI_Instrument".TTN321.PVFiltered);
"Blender_Variables".gSyrupO2 := "PPM O2"(i_Temp := "Profibus_Variables".gFTP302_Temp) * (1 - "HMI_Blender_Parameters".Actual_Recipe_Parameters._SyrupBrix / 100) ;
IF ("Blender_Variables".gActual_RatioM + 1) <> 0 THEN
"Blender_Variables".gProductO2 := ("Blender_Variables".gActual_RatioM * "Blender_Variables".gDeairWaterO2 + "Blender_Variables".gSyrupO2) / ("Blender_Variables".gActual_RatioM + 1) ;
END_IF;
"Blender_Variables".gCO2Solubility := "CO2 Solubility"(i_Temp :="HMI_Instrument".TTN321.PVFiltered) *"Blender_Constants".gTN301Efficiency ;
IF "gBlenderEnToRamp" OR "gBlenderRinseMode" OR "gBlenderCIPMode" OR "Procedure_Variables"."CarboWaterLine".Latch THEN
"Blender_Variables".gDeairCO2Vol := "MaxCarboCO2 Vol"(i_Temp := "HMI_Instrument".TTN321.PVFiltered,
i_Press := "Blender_Constants".gTN301Pressure) * "Blender_Constants".gTN301Efficiency ;
END_IF;
IF NOT "gOUT_PPN304_Run" THEN
"Blender_Variables".gDeairCO2Comp := "Blender_Variables".gDeairCO2Vol - "HMI_Blender_Parameters".Processor_Options.Blender_OPT._CO2_Offset ;
ELSE
(* classic code: "Blender_Variables".gDeairCO2Comp := 0.0 ;*)
"Blender_Variables".gDeairCO2Comp := REAL#0.0 ;
END_IF ;
"Blender_Variables".gFillerCO2Loss := "HMI_Blender_Parameters".Processor_Options.Blender_OPT._CO2_Offset ;
IF "Procedure_Variables".First_Production.Latch THEN
(* classic code: "Blender_Variables".gActual_SP_CO2 := ("HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Vols - "Blender_Variables".gDeairCO2Comp) * "Blender_Variables".gFirstProdExtraCO2Fact
* "HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Fact * (1 - "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProductBrix / 100.0) ;*)
"Blender_Variables".gActual_SP_CO2 := ("HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Vols - "Blender_Variables".gDeairCO2Comp) * "Blender_Variables".gFirstProdExtraCO2Fact
* "HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Fact * (1 - "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProductBrix / REAL#100.0) ; // nL/MIN
ELSE
(* classic code: "Blender_Variables".gActual_SP_CO2 := ("HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Vols - "Blender_Variables".gDeairCO2Comp + "Blender_Variables".gCO2TrackingCorr) * "HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Fact
* (1 - "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProductBrix / 100.0) ;*)
"Blender_Variables".gActual_SP_CO2 := ("HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Vols - "Blender_Variables".gDeairCO2Comp + "Blender_Variables".gCO2TrackingCorr) * "HMI_Blender_Parameters".Actual_Recipe_Parameters._CO2Fact
* (1 - "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProductBrix / REAL#100.0) ; // nL/MIN
END_IF;
IF "gBlenderBlending" AND "Blender_Variables_Pers".gCarboStillProduct AND "gBlenderStableFlow" AND NOT "gBlenderRinseMode" THEN
"Blender_Variables".gCO2SPRef := "Blender_Variables".gActual_SP_CO2 * "Blender_Variables".gActual_Prod_Flow ;
"Blender_Variables".gCO2SPTemp2 := "Blender_Variables".gCarboCO2Error * "Blender_Variables".gK_RecCarboCO2Error ;
ELSIF "gBlenderBlending" AND NOT "gBlenderStableFlow" AND "Blender_Variables_Pers".gCarboStillProduct AND NOT "gBlenderRinseMode" THEN
"Blender_Variables".gCO2SPRef := "Blender_Variables".gActual_SP_CO2 * "Blender_Variables".gActual_Prod_SP ;
"Blender_Variables".gCO2SPTemp2 := "Blender_Variables".gCarboCO2Error * "Blender_Variables".gK_RecCarboCO2Error ;
ELSIF "gP_CarboPipe_En" AND "Blender_Variables_Pers".gCarboStillProduct AND NOT "gBlenderRinseMode" THEN
IF "gActualSP_RatioVol" <> 0 AND NOT "Blender_Variables_Pers".gWaterRecipe THEN
"Blender_Variables".gCO2SPRef := "Blender_Variables".gActual_SP_CO2 *("Blender_Variables".gH2O_Flow_Meas +
"Blender_Variables".gH2O_Flow_Meas / "gActualSP_RatioVol") ;
(* classic code: "Blender_Variables".gCO2SPTemp2 := 0.0 ;*)
"Blender_Variables".gCO2SPTemp2 := REAL#0.0 ;
ELSE
"Blender_Variables".gCO2SPRef := ("Blender_Variables".gActual_SP_CO2 * "Blender_Variables".gActual_Prod_Flow) ;
(* classic code: "Blender_Variables".gCO2SPTemp2 := 0.0 ;*)
"Blender_Variables".gCO2SPTemp2 := REAL#0.0 ;
END_IF;
(*ELSIF "HMI_Service".Workshop_Test.CO2TestRequest AND "gWorkshopTest" THEN
"Blender_Variables".gCO2SPRef := "HMI_Service".Workshop_Test.SIMCO2_Test_SP ;
(* classic code: "Blender_Variables".gCO2SPTemp2 := 0.0 ;*)
"Blender_Variables".gCO2SPTemp2 := REAL#0.0 ;*)
ELSE
(* classic code: "Blender_Variables".gCO2SPRef := 0.0 ;*)
"Blender_Variables".gCO2SPRef := REAL#0.0 ;
(* classic code: "Blender_Variables".gCO2SPTemp2 := 0.0 ;*)
"Blender_Variables".gCO2SPTemp2 := REAL#0.0 ;
END_IF;
(* classic code: "Blender_Variables".gCO2SPTemp := LIMIT(MN:= (-1.0 * "Blender_Variables".gCO2SPRef * "Blender_Constants".gCO2SPRecFact),
IN:= ("Blender_Variables".gCO2SPTemp2),
MX:= ("Blender_Variables".gCO2SPRef * "Blender_Constants".gCO2SPRecFact));*)
"Blender_Variables".gCO2SPTemp := LIMIT(MN:= (REAL#-1.0 * "Blender_Variables".gCO2SPRef * "Blender_Constants".gCO2SPRecFact),
IN:= ("Blender_Variables".gCO2SPTemp2),
MX:= ("Blender_Variables".gCO2SPRef * "Blender_Constants".gCO2SPRecFact));
"Blender_Variables".gSP_CO2 := "Blender_Variables".gCO2SPRef + "Blender_Variables".gCO2SPTemp ;
// SECOND GAS INJECTION
IF "HMI_Blender_Parameters".Processor_Options.Blender_OPT._CO2_GAS2_Injection THEN
(* classic code: "Blender_Variables".gActual_SP_GAS2 := "HMI_Blender_Parameters".Actual_Recipe_Parameters._Gas2Vols * "HMI_Blender_Parameters".Actual_Recipe_Parameters._Gas2Fact
* (1 - "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProductBrix / 100.0) ;*)
"Blender_Variables".gActual_SP_GAS2 := "HMI_Blender_Parameters".Actual_Recipe_Parameters._Gas2Vols * "HMI_Blender_Parameters".Actual_Recipe_Parameters._Gas2Fact
* (1 - "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProductBrix / REAL#100.0) ; // nL/MIN
IF "gBlenderBlending" AND "gBlenderStableFlow" AND NOT "gBlenderRinseMode" THEN
"Blender_Variables".gSP_GAS2 := "Blender_Variables".gActual_SP_GAS2 * "Blender_Variables".gActual_Prod_Flow ;
ELSIF "gBlenderBlending" AND NOT "gBlenderStableFlow" AND NOT "gBlenderRinseMode" THEN
"Blender_Variables".gSP_GAS2 := "Blender_Variables".gActual_SP_GAS2 * "Blender_Variables".gActual_Prod_SP ;
ELSE
(* classic code: "Blender_Variables".gSP_GAS2 := 0.0 ;*)
"Blender_Variables".gSP_GAS2 := REAL#0.0 ;
END_IF ;
ELSE
(* classic code: "Blender_Variables".gSP_GAS2 := 0.0 ;*)
"Blender_Variables".gSP_GAS2 := REAL#0.0 ;
END_IF ;
//"HMI_PID".RMM301.SP := "Blender_Variables".gSP_H2O ;
//"HMI_PID".RMP302.SP := "Blender_Variables".gSP_SYR ;
(* classic code: "Blender_Variables".gMaxCarboCO2_V := "MaxCarboCO2 Vol"(i_Temp := "HMI_Instrument".TTN321.PVFiltered ,
i_Press := "HMI_Blender_Parameters".ProcessSetup._PPN301Pressure - 1.5 ) ;*)
"Blender_Variables".gMaxCarboCO2_V := "MaxCarboCO2 Vol"(i_Temp := "HMI_Instrument".TTN321.PVFiltered ,
i_Press := "HMI_Blender_Parameters".ProcessSetup._PPN301Pressure - REAL#1.5 ) ;
IF NOT ("gP_CarboPipe_En" OR ("HMI_Service".Workshop_Test.CO2TestRequest AND "gWorkshopTest")) THEN
"Blender_Variables".gSP_CO2 := LIMIT(MN:= 0, IN:= "Blender_Variables".gSP_CO2, MX:= ("Blender_Variables".gMaxCarboCO2_V * "Blender_Variables".gSP_H2O)) ;
END_IF;
IF "gBlenderProdMode" THEN
IF "gBlenderRinseMode" AND NOT "System_RunOut_Variables".FastChangeOverActivated THEN
"Blender_Variables".gSP_SYR_Level := "Blender_Constants".gTP301FirstProdLvl;
ELSIF "Procedure_Variables".FTP302Line_Preparation.Latch OR "Procedure_Variables".FTP302_StartUp.Latch THEN
"Blender_Variables".gSP_SYR_Level := "Blender_Constants".gTP301FirstProdLvl;
ELSIF "Procedure_Variables".First_Production.Running AND "gBlenderBlending" THEN
#mTargetSyrupLvlSlwd(i_InValue:="Blender_Constants".gTP301ProdLvl ,
i_SlewMax:="Blender_Constants".gTP301_LvlSlewRate ,
i_Cycle:="Time_300ms" ,
out:="Blender_Variables".gSP_SYR_Level ) ;
ELSIF "Procedure_Variables".Syr_RunOut.Latch AND "gBlenderBlending" THEN
#mTargetSyrupLvlSlwd(i_InValue:="Blender_Constants".gTP301FirstProdLvl ,
i_SlewMax:="Blender_Constants".gTP301_LvlSlewRate ,
i_Cycle:="Time_300ms" ,
out:="Blender_Variables".gSP_SYR_Level ) ;
"Blender_Variables".gSP_SYR_Level := "Blender_Constants".gTP301ProdLvl;
ELSIF "System_RunOut_Variables".FastChangeOverActivated AND "gSyrupQcoRinse" THEN
"Blender_Variables".gSP_SYR_Level := "HMI_Blender_Parameters".ProcessSetup._CIPTP301MinLevel;
ELSIF "Procedure_Variables".First_Production.Done AND NOT "Procedure_Variables".Syr_RunOut.Latch THEN
"Blender_Variables".gSP_SYR_Level := "Blender_Constants".gTP301ProdLvl;
END_IF ;
ELSE
IF "HMI_Variables_Status".Procedures.CIP_SyrTankFloodRun THEN
(* classic code: "Blender_Variables".gSP_SYR_Level := 100.0 ;*)
"Blender_Variables".gSP_SYR_Level := REAL#100.0 ;
ELSE
"Blender_Variables".gSP_SYR_Level := "HMI_Blender_Parameters".ProcessSetup._CIPTP301MinLevel;
END_IF ;
END_IF;
IF "gBlenderProdMode" THEN
IF "gBlenderRinseMode" THEN
"Blender_Variables".gSP_DEAIR_Level := "HMI_Blender_Parameters".ProcessSetup._CIPTN301MinLevel;
ELSIF "Procedure_Variables".TN301_StartUp.Latch OR ("Procedure_Variables".First_Production.Running AND "gBlenderBlending") THEN
#mTargetDeairLvlSlwd(i_InValue:="Blender_Constants".gTN301ProdLvl ,
i_SlewMax:="Blender_Constants".gTN301_LvlSlewRate ,
i_Cycle:="Time_300ms" ,
out:="Blender_Variables".gSP_DEAIR_Level ) ;
ELSIF "Procedure_Variables".First_Production.Done THEN
"Blender_Variables".gSP_DEAIR_Level := "Blender_Constants".gTN301ProdLvl;
END_IF ;
ELSE
IF "HMI_Variables_Status".Procedures.CIP_DeairTankFloodRun THEN
(* classic code: "Blender_Variables".gSP_DEAIR_Level := 100.0 ;*)
"Blender_Variables".gSP_DEAIR_Level := REAL#100.0 ;
ELSE
"Blender_Variables".gSP_DEAIR_Level := "HMI_Blender_Parameters".ProcessSetup._CIPTN301MinLevel;
END_IF ;
END_IF;
IF "gBlenderProdMode" THEN
IF "Procedure_Variables".BlendFill_StartUp.Latch THEN
#mTargetStorgLvlSlwd(i_InValue:="Blender_Variables".gProdTankTargetLvl ,
i_SlewMax:="Blender_Constants".gTM301_LvlSlewRate ,
i_Cycle:="Time_300ms" ,
out:="Blender_Variables".gSP_STORAGE_Level ) ;
ELSIF "Procedure_Variables".First_Production.Done THEN
"Blender_Variables".gSP_STORAGE_Level := "Blender_Variables".gProdTankTargetLvl ;
END_IF ;
END_IF;
IF "gBlenderProdMode" THEN
IF "gProductChillerEn" OR "gProdDoubleChillerEn" THEN
"Blender_Variables".gSP_H2O_Temperature := "HMI_Blender_Parameters".Actual_Recipe_Parameters._SP_ProdTemp ;
"Blender_Variables".gSP_Prod_Temperature := "HMI_Blender_Parameters".Actual_Recipe_Parameters._SP_ProdTemp ;
ELSIF "gWaterChillerEn" THEN
"Blender_Variables".gSP_H2O_Temperature := "HMI_Blender_Parameters".Actual_Recipe_Parameters._SP_ProdTemp - ("Blender_Constants".gCpSyrup
* ("Blender_Variables".gMeterSyrTemp - "HMI_Blender_Parameters".Actual_Recipe_Parameters._SP_ProdTemp) * "Blender_Variables".gActualSyrupDens / "Blender_Constants".gCpH2O) ;
END_IF;
IF "HMI_Variables_Status".Procedures.ColdRinseRun OR "Procedure_Variables".First_Production.Latch OR "Procedure_Variables"."CarboWaterLine".Latch THEN
"Blender_Variables".gSP_H2O_Temperature := "Blender_Constants".gFirstProdRinseTempSP ;
"Blender_Variables".gSP_Prod_Temperature := "Blender_Constants".gFirstProdRinseTempSP ;
END_IF;
ELSIF "gBlenderCIPMode" AND "gGencoldChillerEn" THEN
(* classic code: "Blender_Variables".gSP_H2O_Temperature := 0.0 ;*)
"Blender_Variables".gSP_H2O_Temperature := REAL#0.0 ;
(* classic code: "Blender_Variables".gSP_Prod_Temperature := 0.0 ;*)
"Blender_Variables".gSP_Prod_Temperature := REAL#0.0 ;
ELSE
(* classic code: "Blender_Variables".gSP_H2O_Temperature := 100.0 ;*)
"Blender_Variables".gSP_H2O_Temperature := REAL#100.0 ;
(* classic code: "Blender_Variables".gSP_Prod_Temperature := 100.0 ;*)
"Blender_Variables".gSP_Prod_Temperature := REAL#100.0 ;
END_IF;
IF "gBlenderProdMode" AND "HMI_Device".RVN301.Out OR "Procedure_Variables".TN301_StartUp.Latch THEN
IF "gBlenderRinseMode" OR "Procedure_Variables"."CarboWaterLine".Running THEN
(*"HMI_PID".RVN304.Sp := "Blender_Variables".gH2O_Flow_Meas *"HMI_Blender_Parameters".Actual_Recipe_Parameters._DeareationFactor;*)
"HMI_PID".RVN304.Sp := "Blender_Variables".gH2O_Flow_Meas *0.7 ;
;
ELSE
"HMI_PID".RVN304.Sp := "Blender_Variables".gH2O_Flow_Meas * "HMI_Blender_Parameters".Actual_Recipe_Parameters._DeareationFactor;
END_IF ;
IF "gDeairTank_Loading" OR (NOT "HMI_Digital".LSN301L.Filtered AND NOT "Procedure_Variables".TN301_StartUp.Done) THEN
"HMI_PID".RVN304.Sp := "Blender_Variables".gBlenderNomSpeed * "HMI_Blender_Parameters".Actual_Recipe_Parameters._DeareationFactor;
ELSIF "HMI_Digital".LSN301L.Filtered AND NOT "Procedure_Variables".TN301_StartUp.Done THEN
"HMI_PID".RVN304.Sp := "Blender_Variables".gMinProduction ;
END_IF ;
IF NOT "Blender_Variables_Pers".gCarboStillRecipe OR NOT "HMI_Blender_Parameters".Processor_Options.Blender_OPT._Deaireation THEN
"HMI_PID".RVN304.Sp := "HMI_PID".RVN304.Sp / 10 ;
END_IF ;
ELSE
(* classic code: "HMI_PID".RVN304.Sp := 0.0;*)
"HMI_PID".RVN304.Sp := REAL#0.0;
END_IF ;
IF NOT "HMI_Device".AVN347.Out AND NOT "HMI_Blender_Parameters".Processor_Options.Blender_OPT._Flowtronic THEN
"HMI_PID".RVN304.Sp := "HMI_Instrument".RVN304.PVFiltered ;
END_IF ;
END_FUNCTION_BLOCK
```

View File

@ -0,0 +1,438 @@
```pascal
FUNCTION_BLOCK "BlenderPID__Main"
{ S7_Optimized_Access := 'FALSE' }
AUTHOR : 'Author'
FAMILY : TASK1
NAME : 'Name'
VERSION : 1.0
VAR
mSlewOk : Bool;
mWaterFlowSlewMFMSav : Real;
mWaterFlowSlewCycleCount : Real;
mSyrupFlowSlewMFM : Real;
mSyrFact : Real;
mProdSimLt : Real;
mProdBrixFlowF : Real;
mPressCO2Flow : Real;
mPressCO2Total : Real;
mProdTotalizerLt : "Integral";
gBlendErrorInt : "Integral";
gCarboCO2ErrorInt : "Integral";
mProdBrixFlowFlt : "LowPassFilter";
_PID_SP_Calc : "BlenderPID_PIDSPCalc";
Init_PID_Parameters : "BlenderPID_PIDInitParam";
PID_ActualRecipe : "BlenderPID_ActualRecipe";
mAuxONS : Bool;
mAux1ONS : Bool;
END_VAR
VAR_TEMP
ValBinTmr130 : Word;
ValBcdTmr130 : S5Time;
mAuxONS_Q : Bool;
mAux1ONS_Q : Bool;
END_VAR
BEGIN
#Init_PID_Parameters ();
#_PID_SP_Calc ();
//Not A Recipe Check
IF ("HMI_Blender_Parameters".Actual_Recipe_Parameters._Type >= 1) AND ("HMI_Blender_Parameters".Actual_Recipe_Parameters._Type <= 3) OR NOT "gBlenderProdMode" THEN
"gNotARecipe_Fault" := FALSE ;
ELSE
"gNotARecipe_Fault" := TRUE ;
END_IF;
IF NOT "HMI_Blender_Parameters".Processor_Options.Blender_OPT._Simulation THEN
"HMI_PID".RVM301.Pv := "HMI_Instrument".PTM304.PVFiltered ;
END_IF;
IF NOT "HMI_PID".RVP303.ManualControl.ManOut THEN
"HMI_PID".RVP303.OutMan := "HMI_PID".RVP303.Out ;
END_IF;
IF NOT "HMI_PID".RVN302.ManualControl.ManOut AND NOT "HMI_PID".RVN302.ConfigPID THEN
"HMI_PID".RVN302.OutMan := "HMI_PID".RVN302.Out ;
ELSE
IF "HMI_PID".RVN302.ManualControl.ManOut AND "HMI_PID".RVN302.ConfigPID AND "HMI_PID".RVN302.ManualControl.ManOut THEN
"HMI_PID".RVN302.OutMan := REAL#100.0;
END_IF;
END_IF;
IF "HMI_PID".RVN304.ManualControl.ManOut THEN
"HMI_PID".RVN304.Out := "HMI_PID".RVN304.OutMan ;
ELSE
IF "gBlenderProdMode" AND NOT "HMI_Blender_Parameters".Processor_Options.Blender_OPT._Flowtronic THEN
IF "HMI_PID".RVN304.Sp > 0 THEN
IF "HMI_Device".AVN347.Out THEN
"HMI_PID".RVN304.Out := "DeaireationValve"(in_DeaireationFlow:= "HMI_PID".RVN304.Sp ,
in_InletPressure:= "HMI_Instrument".PCM306.PVFiltered ,
in_FlowCoefficient:= "HMI_Blender_Parameters".ProcessSetup._RVN304KV);
ELSE
"HMI_PID".RVN304.Out := "DeaireationValve"(in_DeaireationFlow:= "HMI_PID".RVN304.Sp,
in_InletPressure:= "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProdTankPress ,
in_FlowCoefficient:= "HMI_Blender_Parameters".ProcessSetup._RVN304KV);
END_IF;
ELSE
(* classic code: "HMI_PID".RVN304.Out := 0.0 ;*)
"HMI_PID".RVN304.Out := REAL#0.0 ;
END_IF;
ELSIF "HMI_Blender_Parameters".Processor_Options.Blender_OPT._Flowtronic AND ("Blender_Variables".gFlowTronicFullScale <> 0) THEN
(* classic code: "HMI_PID".RVN304.Out := "HMI_Instrument".RVN304.PVFiltered * 100.0 / "Blender_Variables".gFlowTronicFullScale ;*)
"HMI_PID".RVN304.Out := "HMI_Instrument".RVN304.PVFiltered * REAL#100.0 / "Blender_Variables".gFlowTronicFullScale ;
END_IF;
"HMI_PID".RVN304.OutMan := "HMI_PID".RVN304.Out ;
END_IF;
IF NOT "HMI_PID".RVS318.ManualControl.ManOut THEN
"HMI_PID".RVS318.OutMan := "HMI_PID".RVS318.Out ;
END_IF;
IF NOT "HMI_PID".RVM319_PRD.ManualControl.ManOut THEN
"HMI_PID".RVM319_PRD.OutMan := "HMI_PID".RVM319_PRD.Out ;
END_IF;
IF "gBlenderProdMode" THEN
IF "HMI_Blender_Parameters".Processor_Options.Blender_OPT._Simulation THEN
// Product Totalizer in Liters
IF ("Procedure_Variables".TN301_StartUp.Done AND NOT "Blender_Variables_Pers".gCarboStillProduct) OR (("Blender_Variables_Pers".gCarboStillProduct AND "Procedure_Variables"."CarboWaterLine".Done)
AND "Procedure_Variables"."CarboWaterLine".Done) THEN
#mProdTotalizerLt.i_NewValue :=("Blender_Variables".gActual_Prod_Flow - "Blender_Variables".gFillerProductFlow) / 60 ;
#mProdTotalizerLt.i_IntCycle := "Time_300ms" ;
#mProdTotalizerLt(Out_Integral := #mProdSimLt) ;
ELSE
(* classic code: #mProdSimLt := 0.1 ;*)
#mProdSimLt := REAL#0.1 ;
END_IF;
// Product Tank Level Variation during simulation
IF #mProdSimLt > "Blender_Variables".gProdTankBottomVol THEN
"HMI_Instrument".LTM302.PVFiltered := ((#mProdSimLt - "Blender_Variables".gProdTankBottomVol) / ("Blender_Variables".gProdTankVolume - "Blender_Variables".gProdTankBottomVol)) * 100 ;
END_IF;
IF "HMI_PID".RVM301.ManualControl.PidEnable THEN
IF NOT "PID_Variables".PID_RVM301_Release THEN
(* classic code: #mPressCO2Flow := "ValveFlow" (i_DeltaP := "HMI_PID".RVM301.Sp - "HMI_PID".RVM301.Pv,
i_ValveOp := "HMI_PID".RVM301.Out ,
i_KFF := 1100.5,
i_Dens := "Blender_Constants".gCO2_Density / 1000.0);*)
#mPressCO2Flow := "ValveFlow" (i_DeltaP := "HMI_PID".RVM301.Sp - "HMI_PID".RVM301.Pv,
i_ValveOp := "HMI_PID".RVM301.Out ,
i_KFF := REAL#1100.5,
i_Dens := "Blender_Constants".gCO2_Density / REAL#1000.0);
#mPressCO2Total := #mPressCO2Total + (#mPressCO2Flow * "HMI_PID".RVM301.Cycle_Time * 60) ;
ELSE
#mPressCO2Total := #mPressCO2Total - "ValveFlow"(i_DeltaP := "HMI_PID".RVM301.Pv,
i_ValveOp := 9 ,
i_KFF := 20,
i_Dens := "Blender_Constants".gCO2_Density / 1000);
END_IF;
END_IF;
IF "HMI_Device".AVM312.Out THEN
#mPressCO2Total := #mPressCO2Total - "ValveFlow"(i_DeltaP := "HMI_PID".RVM301.Pv,
i_ValveOp := 2 ,
i_KFF := 20,
i_Dens := "Blender_Constants".gCO2_Density / 1000);
END_IF;
IF "Blender_Variables".gProdTankVolume > 0 AND #mProdSimLt < "Blender_Variables".gProdTankVolume THEN
"HMI_PID".RVM301.Pv := #mPressCO2Total / ("Blender_Variables".gProdTankVolume - #mProdSimLt) ;
END_IF;
ELSE
;
END_IF; // End OF IF gH_Blender_OPT_Simulation THEN...
// Transfer the Flowrate Measure TO the PID's PV Input
"HMI_PID".RMM301.Pv := "Blender_Variables".gH2O_Flow_Meas ;
"HMI_PID".RMP302.Pv := "Blender_Variables".gSYR_Flow_Meas ;
"HMI_PID".RMM303.Pv := "Blender_Variables".gCO2_Flow_Meas ;
"HMI_PID".RMM304.Pv := "Blender_Variables".gCO2_Flow_Meas ;
IF "gBlenderStableFlow" AND ("Blender_Variables".gH2O_Flow_Meas < 50) THEN
"gFTN301_FlowTooLow" := TRUE ;
ELSE
"gFTN301_FlowTooLow" := FALSE ;
END_IF;
// Calculates the actual product brix from Flows
IF "Blender_Variables".gH2O_Flow_Meas <> 0 AND "Blender_Variables".gSYR_Flow_Meas <> 0 THEN
#mProdBrixFlowF := ("Blender_Variables".gSYR_Flow_Meas * "Blender_Variables".gActualSyrupBrix) / ("Blender_Variables".gH2O_Flow_Meas + "Blender_Variables".gSYR_Flow_Meas ) ;
#mProdBrixFlowFlt(i_Value := #mProdBrixFlowF ,
i_Num := 49 ,
i_Enable := "gBlenderBlending") ;
"Blender_Variables".gFlowProdBrix := #mProdBrixFlowFlt.FilterOut ;
END_IF;
IF ("HMI_PID".RMM301.Sp + "HMI_PID".RMP302.Sp) <> 0 AND "Blender_Variables".gActualSyrupDens <> 0 THEN
"Blender_Variables".gProductDensity := ("HMI_PID".RMM301.Sp + "HMI_PID".RMP302.Sp) / ("HMI_PID".RMM301.Sp + "HMI_PID".RMP302.Sp / "Blender_Variables".gActualSyrupDens) ;
END_IF;
// PID's Manual Bit
IF NOT "HMI_PID".RMM301.ManualControl.ManOut THEN
"HMI_PID".RMM301.OutMan := "HMI_PID".RMM301.Out ;
END_IF;
IF "HMI_Service".Workshop_Test.CO2TestRequest AND "gWorkshopTest" AND NOT "Procedure_Variables".Blender_Run.Running THEN
// "HMI_PID".RMM301.ManualControl.ManOut := TRUE ;
(* classic code: "HMI_PID".RMM301.OutMan := 60.0 ;*)
"HMI_PID".RMM301.OutMan := REAL#60.0 ;
END_IF;
IF ("System_RunOut_Variables".ProdPipe_RunOut.Running OR "Procedure_Variables".TM301_RunOut.Running) AND "System_RunOut_Variables".ProdPipeRunOutWaterCount THEN
// "HMI_PID".RMM301.ManualControl.ManOut := TRUE ;
"HMI_PID".RMM301.OutMan := "System_RunOut_Variables".RMM301_OV_ProdPipeRunOut ;
END_IF;
IF NOT "HMI_PID".RMP302.ManualControl.ManOut THEN
"HMI_PID".RMP302.OutMan := "HMI_PID".RMP302.Out ;
END_IF;
IF ("System_RunOut_Variables".ProdPipe_RunOut.Running OR "Procedure_Variables".TM301_RunOut.Running) AND "System_RunOut_Variables".ProdPipeRunOutWaterCount THEN
// "HMI_PID".RMP302.ManualControl.ManOut := TRUE ;
"HMI_PID".RMP302.OutMan := "System_RunOut_Variables".RMP302_OV_ProdPipeRunOut ;
END_IF;
IF NOT "HMI_PID".RMM303.ManualControl.ManOut THEN
"HMI_PID".RMM303.OutMan := "HMI_PID".RMM303.Out ;
END_IF;
IF NOT "HMI_PID".RMM304.ManualControl.ManOut THEN
"HMI_PID".RMM304.OutMan := "HMI_PID".RMM304.Out ;
END_IF;
IF NOT "HMI_PID".RVM301.ManualControl.ManOut AND NOT "PID_Variables".PID_RVM301_Release THEN
"HMI_PID".RVM301.OutMan := "HMI_PID".RVM301.Out ;
END_IF;
IF "Procedure_Variables".Balaiage.Latch THEN
IF "Procedure_Variables".First_Production.Latch OR (NOT "Procedure_Variables".BlendFill_StartUp.Done AND "HMI_Blender_Parameters".Processor_Options.Blender_OPT._BlendFillSystem)
OR NOT "gBalaiage_MaxFlow" THEN
"HMI_PID".RVM301.OutMan := "HMI_Blender_Parameters".ProcessSetup._BaialageRVM301OVMin ;
ELSE
"HMI_PID".RVM301.OutMan := "HMI_Blender_Parameters".ProcessSetup._BaialageRVM301OVMax ;
END_IF ;
END_IF ;
IF "gBlenderBlending" THEN
IF #mWaterFlowSlewCycleCount > 0 AND NOT #mSlewOk THEN
"Blender_Variables".gWaterFlowSlewValve := "HMI_PID".RMM301.Out / #mWaterFlowSlewCycleCount ;
"Blender_Variables".gWaterFlowSlewMFM := "Profibus_Variables".gFTN301_Flow / #mWaterFlowSlewCycleCount ;
#mSyrupFlowSlewMFM := "Profibus_Variables".gFTP302_Flow / #mWaterFlowSlewCycleCount ;
#mWaterFlowSlewCycleCount := "Time_300ms" + #mWaterFlowSlewCycleCount ;
IF "Blender_Variables".gWaterFlowSlewMFM > #mWaterFlowSlewMFMSav THEN
#mSlewOk := TRUE ;
END_IF;
#mWaterFlowSlewMFMSav := "Blender_Variables".gWaterFlowSlewMFM ;
ELSE
#mWaterFlowSlewCycleCount := "Time_300ms" + #mWaterFlowSlewCycleCount ;
END_IF;
ELSE
(* classic code: #mWaterFlowSlewMFMSav := 0.0 ;*)
#mWaterFlowSlewMFMSav := REAL#0.0 ;
(* classic code: #mWaterFlowSlewCycleCount := 0.0 ;*)
#mWaterFlowSlewCycleCount := REAL#0.0 ;
(* classic code: "Blender_Variables".gWaterFlowSlewValve := 0.0 ;*)
"Blender_Variables".gWaterFlowSlewValve := REAL#0.0 ;
(* classic code: "Blender_Variables".gWaterFlowSlewMFM := 0.0 ;*)
"Blender_Variables".gWaterFlowSlewMFM := REAL#0.0 ;
(* classic code: #mSyrupFlowSlewMFM := 0.0 ;*)
#mSyrupFlowSlewMFM := REAL#0.0 ;
#mSlewOk := FALSE ;
END_IF;
IF "Blender_Variables".gSYR_Flow_Meas > 0 AND "Blender_Variables".gActualSyrupDens <> 0 THEN
"Blender_Variables".gActual_Ratio := "Blender_Variables".gH2O_Flow_Meas / "Blender_Variables".gSYR_Flow_Meas * "Blender_Variables".gActualSyrupDens ;
END_IF;
IF "Blender_Variables".gH2O_Flow_Meas > 0 AND "Blender_Constants".gCO2_Density <> 0 AND "Blender_Variables".gActualSyrupDens <> 0 THEN
"Blender_Variables".gActual_CO2_Vol := ("Blender_Variables".gCO2_Flow_Meas / "Blender_Constants".gCO2_Density) / ("Blender_Variables".gH2O_Flow_Meas + ("Blender_Variables".gSYR_Flow_Meas / "Blender_Variables".gActualSyrupDens)) ;
END_IF;
IF "Blender_Variables".gWaterVFM_Area <> 0 THEN
(* classic code: "Blender_Variables".gWaterSpeedToStopError := "Blender_Variables".gH2O_Flow_Meas / "Blender_Variables".gWaterVFM_Area / 10.0 / 60.0 ;*)
"Blender_Variables".gWaterSpeedToStopError := "Blender_Variables".gH2O_Flow_Meas / "Blender_Variables".gWaterVFM_Area / REAL#10.0 / REAL#60.0 ; // m/s
(* classic code: "Blender_Variables".gWaterVFM_Vel := "Blender_Variables".gSP_H2O / "Blender_Variables".gWaterVFM_Area / 10.0 / 60.0 ;*)
"Blender_Variables".gWaterVFM_Vel := "Blender_Variables".gSP_H2O / "Blender_Variables".gWaterVFM_Area / REAL#10.0 / REAL#60.0 ; // m/s
END_IF;
#ValBcdTmr130 := S_ODT(T_NO := "mStopErrorsTimeOut",
S := NOT "gBlenderBlending",
TV := S5TIME#10s,
R := "AUX FALSE",
BI => #ValBinTmr130,
Q => "mStopErrorsTimeOut.Q");
IF "Blender_Variables".gWaterSpeedToStopError > "Blender_Constants".gFTN301_MinVel AND NOT "mStopErrorsTimeOut.Q" THEN
"gStopBlendCarboError" := FALSE ;
ELSE
"gStopBlendCarboError" := TRUE ;
END_IF;
IF "Blender_Variables".gWaterVFM_Vel > "Blender_Constants".gFTN301_MinVel THEN
"gFTN301_SpeedToStop" := FALSE ;
ELSE
"gFTN301_SpeedToStop" := TRUE ;
END_IF;
IF "Blender_Variables".gWaterPipe_Area <> 0 THEN
(* classic code: "Blender_Variables".gWaterPipe_Vel := "Blender_Variables".gH2O_Flow_Meas / "Blender_Variables".gWaterPipe_Area / 10.0 / 60.0 ;*)
"Blender_Variables".gWaterPipe_Vel := "Blender_Variables".gH2O_Flow_Meas / "Blender_Variables".gWaterPipe_Area / REAL#10.0 / REAL#60.0 ; // m/s
END_IF;
(* classic code: IF "gBlenderStableFlow" AND ("Blender_Variables".gWaterPipe_Vel < 0.6) AND "HMI_Blender_Parameters".Processor_Options.Blender_OPT._CarboPresent THEN*)
IF "gBlenderStableFlow" AND ("Blender_Variables".gWaterPipe_Vel < REAL#0.6) AND "HMI_Blender_Parameters".Processor_Options.Blender_OPT._CarboPresent THEN
"gFTN301_SpeedTooLow" := TRUE ;
ELSE
"gFTN301_SpeedTooLow" := FALSE ;
END_IF;
(********************************************************************************************************************************************************)
// Calculates blend error
IF "Blender_Variables".gActualSyrupDens <> 0 THEN
"Blender_Variables".gSyrupVolFlow_PV := "HMI_PID".RMP302.Pv / "Blender_Variables".gActualSyrupDens ;
END_IF;
IF "Blender_Variables_Pers".gWaterRecipe THEN
(* classic code: "Blender_Variables".gBlendError := 0.0 ;*)
"Blender_Variables".gBlendError := REAL#0.0 ;
END_IF;
IF "PID_Variables".Blend_Error_Enable AND "Blender_Variables".gActualSyrupDens <> 0 THEN
IF "Procedure_Variables".First_Production.Latch AND "Blender_Variables_Pers".gSugarBeverage THEN
IF "HMI_Blender_Parameters".Actual_Recipe_Parameters._SyrupBrix <> 0 THEN
#mSyrFact := "Blender_Variables".gMeterSyrBrix / "HMI_Blender_Parameters".Actual_Recipe_Parameters._SyrupBrix ;
END_IF;
#gBlendErrorInt.i_NewValue := ("HMI_PID".RMM301.Pv + ((1 - #mSyrFact) * "Blender_Variables".gSyrupVolFlow_PV) - "Blender_Variables".gSyrupVolFlow_PV * #mSyrFact * "gActualSP_RatioVol") / 60 ;
#gBlendErrorInt.i_IntCycle := "Time_300ms" ;
#gBlendErrorInt(Out_Integral:= "Blender_Variables".gBlendError);
ELSE
#gBlendErrorInt.i_NewValue:=("HMI_PID".RMM301.Pv - ("HMI_PID".RMP302.Pv / "Blender_Variables".gActualSyrupDens) * "gActualSP_RatioVol") / 60 ;
#gBlendErrorInt.i_IntCycle := "Time_300ms" ;
#gBlendErrorInt(Out_Integral:= "Blender_Variables".gBlendError) ;
END_IF;
ELSE
// gBlendErrorInt(Out_Integral:= "Blender_Variables".gBlendError);
;
END_IF;
IF "PID_Variables".CarboCO2_Error_Enable THEN
#gCarboCO2ErrorInt.i_NewValue:=(("Blender_Variables".gActual_Prod_Flow * "Blender_Variables".gActual_SP_CO2) - "Blender_Variables".gCO2_Flow_Meas) / 60 ;
#gCarboCO2ErrorInt.i_IntCycle := "Time_300ms" ;
#gCarboCO2ErrorInt(Out_Integral:="Blender_Variables".gCarboCO2Error) ;
ELSE
// gCarboCO2ErrorInt(Out_Integral:="Blender_Variables".gCarboCO2Error);
;
END_IF;
IF "gBlenderRinseMode" AND ("Procedure_Variables".TN301_StartUp.Done OR NOT "HMI_Blender_Parameters".Processor_Options.Blender_OPT._Deaireation) THEN
// "HMI_PID".RMM301.ManualControl.ManOut := TRUE;
IF "gCIPRinseOpenValves" THEN
"HMI_PID".RMM301.OutMan := "HMI_Blender_Parameters".ProcessSetup._RinseRMM301OV ;
ELSE
(* classic code: "HMI_PID".RMM301.OutMan := 0.0 ;*)
"HMI_PID".RMM301.OutMan := REAL#0.0 ;
END_IF;
END_IF;
IF "gBlenderRinseMode" THEN
"HMI_PID".RMP302.OutMan := "HMI_Blender_Parameters".ProcessSetup._RinseRMP302OV ;
IF "gRinseDrainRunning" AND NOT "HMI_Blender_Parameters".Processor_Options.Blender_OPT._FastChangeOverEnabled THEN
IF "gDrainPressNotOK" THEN
"HMI_PID".RVM301.OutMan := "Blender_Constants".gRinseDrainOpPressValve ;
ELSE
(* classic code: "HMI_PID".RVM301.OutMan := 0.0 ;*)
"HMI_PID".RVM301.OutMan := REAL#0.0 ;
END_IF;
END_IF;
END_IF;
// "HMI_PID".RVS318.SP := 0.0 ;
ELSE // CIP
// "HMI_PID".RVS318.SP := "CIP_Program_Variables".General_Data.SPTemperature + "Blender_Constants".gCIP_SP_DeltaT ; // Increasing REAL Temperature Set Point
(* classic code: "HMI_PID".RVM301.Sp := 0.0 ;*)
"HMI_PID".RVM301.Sp := REAL#0.0 ;
"PID_Variables".PID_RVM301_Release := TRUE ;
// "HMI_PID".RVM301.ManualControl.ManOut := TRUE ;
(* classic code: "HMI_PID".RVM301.OutMan := 0.0 ;*)
"HMI_PID".RVM301.OutMan := REAL#0.0 ;
// "HMI_PID".RMM301.ManualControl.ManOut := TRUE ;
IF "HMI_Variables_Status".Procedures.CIP_SyrTankFloodRun OR NOT "gOUT_PPN301_Run" OR NOT "gCIPRinseOpenValves" THEN
(* classic code: "HMI_PID".RMM301.OutMan := 0.0 ;*)
"HMI_PID".RMM301.OutMan := REAL#0.0 ;
ELSE
"HMI_PID".RMM301.OutMan := "HMI_Blender_Parameters".ProcessSetup._CIPRMM301OV ;
END_IF;
// "HMI_PID".RMP302.ManualControl.ManOut := TRUE ;
IF "HMI_Variables_Status".Procedures.CIP_SyrTankFloodRun OR NOT "gOUT_PPP302_Run" OR NOT "gCIPRinseOpenRMP302" THEN
(* classic code: "HMI_PID".RMP302.OutMan := 0.0 ;*)
"HMI_PID".RMP302.OutMan := REAL#0.0 ;
ELSE
"HMI_PID".RMP302.OutMan := "HMI_Blender_Parameters".ProcessSetup._CIPRMP302OV ;
END_IF;
// "HMI_PID".RMM303.ManualControl.ManOut := TRUE;
IF "gP_CIP_CO2_Inj" THEN
"HMI_PID".RMM303.OutMan := "Blender_Constants".gCIP_CO2_InjectionValue ;
ELSE
(* classic code: "HMI_PID".RMM303.OutMan := 0.0;*)
"HMI_PID".RMM303.OutMan := REAL#0.0;
END_IF;
(* classic code: "HMI_PID".RMM304.OutMan := 0.0;*)
"HMI_PID".RMM304.OutMan := REAL#0.0;
IF "HMI_Blender_Parameters".Processor_Options.Blender_OPT._Simulation THEN
(* classic code: #mPressCO2Total := 0.0 ;*)
#mPressCO2Total := REAL#0.0 ;
(* classic code: #mProdSimLt := 0.0 ;*)
#mProdSimLt := REAL#0.0 ;
(* classic code: "HMI_Instrument".LTM302.PVFiltered := 0.0 ;*)
"HMI_Instrument".LTM302.PVFiltered := REAL#0.0 ;
END_IF;
END_IF;
IF "System_RunOut_Variables".FastChangeOverActivated THEN
"ONS_R"(Enable_ONS := "System_RunOut_Variables".LoadNextRecipe,
Aux_ONS := #mAux1ONS,
ONS_R => #mAux1ONS_Q );
IF #mAux1ONS_Q THEN
"BlenderPID_NextRecipe" () ;
#PID_ActualRecipe () ;
"System_RunOut_Variables".LoadNextRecipe := FALSE ;
"System_RunOut_Variables".NextRecipeOk := TRUE ;
END_IF;
ELSE
"System_RunOut_Variables".LoadNextRecipe := FALSE ;
END_IF;
"ONS_R"(Enable_ONS := ("HMI_Variables_Cmd".Recipe.Active_Recipe_Start OR "HMI_Variables_Cmd".Recipe.Download) AND NOT "gRecipeManagement_Busy",
Aux_ONS := #mAuxONS,
ONS_R => #mAuxONS_Q );
IF #mAuxONS_Q THEN
#PID_ActualRecipe () ;
END_IF;
"HMI_PID".RVP303.Pv := "HMI_Instrument".LTP303.PVFiltered ;
IF "HMI_Blender_Parameters".Processor_Options.Blender_OPT._BlendFillSystem AND "HMI_Blender_Parameters".Processor_Options.Blender_OPT._StillWaterByPass THEN
IF NOT "Blender_Variables_Pers".gSkipDeaireation THEN
"HMI_PID".RVN302.Pv := "HMI_Instrument".LTN301.PVFiltered;
ELSE
"HMI_PID".RVN302.Pv := "HMI_Instrument".LTM302.PVFiltered;
END_IF;
ELSE
"HMI_PID".RVN302.Pv := "HMI_Instrument".LTN301.PVFiltered;
END_IF ;
"HMI_PID".RVS318.Pv := "HMI_Instrument".TTS305_1.PVFiltered ;
"HMI_PID".RVM319_PRD.Pv := "HMI_Instrument".TTM306_PRD.PVFiltered ;
END_FUNCTION_BLOCK
```

View File

@ -0,0 +1,34 @@
```pascal
// Block Type: InstanceDB
// Block Number: 950
DATA_BLOCK "BlenderPID__Main_Data"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR
mSlewOk : Bool := FALSE;
mWaterFlowSlewMFMSav : Real := 0.0;
mWaterFlowSlewCycleCount : Real := 0.0;
mSyrupFlowSlewMFM : Real := 0.0;
mSyrFact : Real := 0.9908964;
mProdSimLt : Real := 0.0;
mProdBrixFlowF : Real := 12.47313;
mPressCO2Flow : Real := 0.0;
mPressCO2Total : Real := 0.0;
mProdTotalizerLt : "Integral";
gBlendErrorInt : "Integral";
gCarboCO2ErrorInt : "Integral";
mProdBrixFlowFlt : "LowPassFilter";
_PID_SP_Calc : "BlenderPID_PIDSPCalc";
Init_PID_Parameters : "BlenderPID_PIDInitParam";
PID_ActualRecipe : "BlenderPID_ActualRecipe";
mAuxONS : Bool := FALSE;
mAux1ONS : Bool := FALSE;
END_VAR
BEGIN
// Data Blocks have no executable code
END_DATA_BLOCK
```

View File

@ -0,0 +1,148 @@
```pascal
// Block Type: FC
// Block Number: 2019
// Original Network Languages: LAD
FUNCTION "BlenderRinse" : Void
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR_TEMP
mColdReq : Bool;
mWarmReq : Bool;
mColdStop : Bool;
mWarmStop : Bool;
END_VAR
BEGIN
// Network 1: Qualifier (Original Language: LAD)
"Procedure_Variables"."Blender_Rinse"."Qualifier" := "HMI_Variables_Status"."System"."Blender_Prod_CIP" AND "gBlenderSuppliesOk" AND "gBlenderBlending" AND "gBlenderCIPMode" AND "Procedure_Variables"."TM301_Drain"."Latch";
// Network 2: Stop / Request (Original Language: LAD)
// PBox SymPy processed, logic in consumer
"M19014" := ("System_RunOut_Variables"."FastChangeOverActivated" AND "HMI_Variables_Cmd"."Commands_From_HMI"."CMD_ColdRinseReq") OR ("System_RunOut_Variables"."FastChangeOverActivated" AND "System_RunOut_Variables"."ProdPipe_RunOut"."Done" AND "Blender_Variables_Pers"."gCoolerEnabled"); // P_TRIG(("System_RunOut_Variables"."FastChangeOverActivated" AND "HMI_Variables_Cmd"."Commands_From_HMI"."CMD_ColdRinseReq") OR ("System_RunOut_Variables"."FastChangeOverActivated" AND "System_RunOut_Variables"."ProdPipe_RunOut"."Done" AND "Blender_Variables_Pers"."gCoolerEnabled")) - Mem: "M19014"
"mColdReq" := ("System_RunOut_Variables"."FastChangeOverActivated" AND "HMI_Variables_Cmd"."Commands_From_HMI"."CMD_ColdRinseReq" AND "Procedure_Variables"."Blender_Rinse"."Qualifier" AND NOT "M19014") OR ("System_RunOut_Variables"."FastChangeOverActivated" AND "System_RunOut_Variables"."ProdPipe_RunOut"."Done" AND "Blender_Variables_Pers"."gCoolerEnabled" AND "Procedure_Variables"."Blender_Rinse"."Qualifier" AND NOT "M19014");
"mColdStop" := ("ColdRinseON" AND "System_RunOut_Variables"."FastChangeOverActivated" AND "HMI_Variables_Cmd"."Commands_From_HMI"."CMD_ColdRinseReq" AND NOT "M19014") OR ("ColdRinseON" AND "System_RunOut_Variables"."FastChangeOverActivated" AND "System_RunOut_Variables"."ProdPipe_RunOut"."Done" AND "Blender_Variables_Pers"."gCoolerEnabled" AND NOT "M19014");
// Network 3: Warm Request / Stop (Original Language: LAD)
// PBox SymPy processed, logic in consumer
"M19015" := ("HMI_Variables_Cmd"."Commands_From_HMI"."CMD_WarmRinseReq" AND "System_RunOut_Variables"."FastChangeOverActivated") OR ("System_RunOut_Variables"."FastChangeOverActivated" AND "System_RunOut_Variables"."ProdPipe_RunOut"."Done" AND "Blender_Variables_Pers"."gCoolerEnabled"); // P_TRIG(("HMI_Variables_Cmd"."Commands_From_HMI"."CMD_WarmRinseReq" AND "System_RunOut_Variables"."FastChangeOverActivated") OR ("System_RunOut_Variables"."FastChangeOverActivated" AND "System_RunOut_Variables"."ProdPipe_RunOut"."Done" AND "Blender_Variables_Pers"."gCoolerEnabled")) - Mem: "M19015"
"mWarmReq" := ("HMI_Variables_Cmd"."Commands_From_HMI"."CMD_WarmRinseReq" AND "System_RunOut_Variables"."FastChangeOverActivated" AND "Procedure_Variables"."Blender_Rinse"."Qualifier" AND NOT "M19015") OR ("System_RunOut_Variables"."FastChangeOverActivated" AND "System_RunOut_Variables"."ProdPipe_RunOut"."Done" AND "Blender_Variables_Pers"."gCoolerEnabled" AND "Procedure_Variables"."Blender_Rinse"."Qualifier" AND NOT "M19015");
"mWarmStop" := ("HMI_Variables_Cmd"."Commands_From_HMI"."CMD_WarmRinseReq" AND "WarmRinseON" AND "System_RunOut_Variables"."FastChangeOverActivated" AND NOT "M19015") OR ("WarmRinseON" AND "System_RunOut_Variables"."FastChangeOverActivated" AND "System_RunOut_Variables"."ProdPipe_RunOut"."Done" AND "Blender_Variables_Pers"."gCoolerEnabled" AND NOT "M19015");
// Network 4: Rinse Request (Original Language: LAD)
"Procedure_Variables"."Blender_Rinse"."Request" := ("mColdReq" AND "Procedure_Variables"."Blender_Rinse"."Qualifier") OR ("mWarmReq" AND "Procedure_Variables"."Blender_Rinse"."Qualifier");
// Network 5: ColdRinseSR (Original Language: LAD)
// Network 5 did not produce printable SCL code.
// Network 6: WarmRinse (Original Language: LAD)
// Network 6 did not produce printable SCL code.
// Network 7: Wait (Original Language: LAD)
"Procedure_Variables"."Blender_Rinse"."Wait" := "Procedure_Variables"."TM301_Drain"."Latch" OR ("HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Deaireation" AND "Procedure_Variables"."TN301_StartUp"."Done");
// Network 8: Reset (Original Language: LAD)
"Procedure_Variables"."Blender_Rinse"."Reset" := "HMI_Variables_Cmd"."Commands_From_HMI"."CMD_TM301DrainReq" OR "gBlenderCIPMode";
// Network 9: Done (Original Language: LAD)
IF "Procedure_Variables"."Blender_Rinse"."Reset" OR "Procedure_Variables"."Blender_Rinse"."Latch" THEN
"HMI_Variables_Status"."Procedures"."Rinse_WarmRinseDone" := FALSE;
END_IF;
IF "Procedure_Variables"."Blender_Rinse"."Reset" OR "Procedure_Variables"."Blender_Rinse"."Latch" THEN
"HMI_Variables_Status"."Procedures"."Rinse_ColdRinseDone" := FALSE;
END_IF;
// Network 10: Latch (Original Language: LAD)
"Procedure_Variables"."Blender_Rinse"."Latch" := ("Procedure_Variables"."Blender_Rinse"."Reset" AND "Procedure_Variables"."Blender_Rinse"."Latch" AND "FirstScan" AND "Procedure_Variables"."Blender_Rinse"."Done") OR ("Procedure_Variables"."Blender_Rinse"."Reset" AND "Procedure_Variables"."Blender_Rinse"."Request" AND "FirstScan" AND "Procedure_Variables"."Blender_Rinse"."Done");
// Network 11: Rinse Mode (Original Language: LAD)
"gBlenderRinseMode" := "Procedure_Variables"."Blender_Rinse"."Latch";
IF "Procedure_Variables"."Blender_Rinse"."Latch" THEN
"HMI_Variables_Status"."Procedures"."BlenderStateNum" := 18;
END_IF;
// Network 12: Running (Original Language: LAD)
"Procedure_Variables"."Blender_Rinse"."Running" := "Procedure_Variables"."Blender_Rinse"."Latch" AND "Procedure_Variables"."Blender_Rinse"."Wait";
// Network 13: Warm Rinse Running (Original Language: LAD)
"HMI_Alarms"."gH_Status" := "WarmRinseON" AND "Procedure_Variables"."Blender_Rinse"."Latch";
"HMI_Variables_Status"."Procedures"."WarmRinseRun" := "WarmRinseON" AND "Procedure_Variables"."Blender_Rinse"."Latch";
// Network 14: Cold Rinse Running (Original Language: LAD)
"HMI_Alarms"."gH_Status" := "ColdRinseON" AND "Procedure_Variables"."Blender_Rinse"."Latch";
"HMI_Variables_Status"."Procedures"."ColdRinseRun" := "ColdRinseON" AND "Procedure_Variables"."Blender_Rinse"."Latch";
// Network 15: Rinse Drain Active (Original Language: LAD)
"HMI_Alarms"."gH_Status" := "gBlenderRinseMode" AND "Procedure_Variables"."TM301_Drain"."Latch";
"gRinseDrainRunning" := "gBlenderRinseMode" AND "Procedure_Variables"."TM301_Drain"."Latch";
// Network 16: Done (Original Language: LAD)
"Procedure_Variables"."Blender_Rinse"."Done" := ("Procedure_Variables"."Blender_Rinse"."Latch" AND "Procedure_Variables"."TM301_Drain"."Done") OR ("Procedure_Variables"."Blender_Rinse"."Latch" AND "M19077") OR ("Procedure_Variables"."Blender_Rinse"."Reset" AND "Procedure_Variables"."Blender_Rinse"."Done" AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_FastChangeOverEnabled");
// Network 17: Done (Original Language: LAD)
IF "Procedure_Variables"."Blender_Rinse"."Done" OR "gBlenderCIPMode" THEN
"Blender_Variables_Pers"."gFillerRinse_DoneLatch" := FALSE;
END_IF;
// Network 18: Rinse Completed (Original Language: LAD)
// PBox SymPy processed, logic in consumer
"M19020" := "System_RunOut_Variables"."In_Flr_FastRinseComplete"; // P_TRIG("System_RunOut_Variables"."In_Flr_FastRinseComplete") - Mem: "M19020"
IF ("WarmRinseON" AND "mWarmStop") OR ("Procedure_Variables"."Blender_Rinse"."Latch" AND "System_RunOut_Variables"."In_Flr_FastRinseComplete") THEN
"Blender_Variables_Pers"."gFillerRinse_DoneLatch" := TRUE;
END_IF;
IF ("WarmRinseON" AND "mWarmStop") OR ("WarmRinseON" AND "Procedure_Variables"."Blender_Rinse"."Latch" AND "System_RunOut_Variables"."In_Flr_FastRinseComplete") THEN
"HMI_Variables_Status"."Procedures"."Rinse_WarmRinseDone" := TRUE;
END_IF;
IF ("ColdRinseON" AND "WarmRinseON" AND "mWarmStop") OR ("ColdRinseON" AND "Procedure_Variables"."Blender_Rinse"."Latch" AND "System_RunOut_Variables"."In_Flr_FastRinseComplete") THEN
"HMI_Variables_Status"."Procedures"."Rinse_ColdRinseDone" := TRUE;
END_IF;
// Network 19: Rinse Done ONS (Original Language: LAD)
// Edge Logic handled by Coil 26
"M19021" := "Procedure_Variables"."Blender_Rinse"."Done"; // P_TRIG("Procedure_Variables"."Blender_Rinse"."Done") - Mem: "M19021"
"Procedure_Variables"."Blender_Rinse"."ONS_Done" := "Procedure_Variables"."Blender_Rinse"."Done" AND NOT "M19021";
"M19021" := "Procedure_Variables"."Blender_Rinse"."Done"; // P_TRIG("Procedure_Variables"."Blender_Rinse"."Done") - Mem: "M19021"
// Network 20: Blender Rinse Done (Original Language: LAD)
IF "Procedure_Variables"."Blender_Rinse"."ONS_Done" THEN
BlenderRinse_Done();
END_IF;
END_FUNCTION
```

View File

@ -0,0 +1,22 @@
```pascal
// Block Type: FC
// Block Number: 2042
// Original Network Languages: LAD
FUNCTION "BlenderRinse_Done" : Void
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
BEGIN
// Network 1: PID Reset Integral (Original Language: LAD)
BlenderPID_PIDResInteg();
// Network 2: Init Errors (Original Language: LAD)
BlenderCtrl_InitErrors();
END_FUNCTION
```

View File

@ -0,0 +1,293 @@
```pascal
// Block Type: FB
// Block Number: 1719
// Original Network Languages: LAD, STL
FUNCTION_BLOCK "BlenderRun_MeasFilSpeed"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR_INPUT
i_Value : Real;
i_Num : Int;
i_Enable : Bool;
END_VAR
VAR_OUTPUT
FilterOut : Real;
END_VAR
VAR_STAT
mNumOfCycle : Int;
mInitialLevel : Real;
mPrevSpeed : Real;
mAcqTime : Real;
mProdLt : Real;
mSaveDeltaV : Real;
mFillerTracked : Bool;
mFillerTrackedTmrON : Bool;
mFlrFlowDelayOnON : Bool;
mFlrFlowDelayOffON : Bool;
mFillerTrackedTmr : STRUCT
PT : Time;
ET : Time;
IN : Bool;
Q : Bool;
END_STRUCT;
mFlrFlowDelayOn : STRUCT
PT : Time;
ET : Time;
IN : Bool;
Q : Bool;
END_STRUCT;
mFlrFlowDelayOff : STRUCT
PT : Time;
ET : Time;
IN : Bool;
Q : Bool;
END_STRUCT;
mFillerDeltaVFilter : "LowPassFilter";
mFillerSpeedFilter : "LowPassFilter";
END_VAR
VAR_TEMP
mReadLevel : Bool;
mNotZero : Bool;
mSave : Bool;
gBlenderSpeedUp : Bool;
gBlenderSpeedDown : Bool;
mDummy : Bool;
Aux_calc1 : Real;
Aux_calc2 : Real;
mTemp : Real;
mSpeedPerc : Real;
mFillerEstimatedFlow : Real;
__PlcmigTempFillBits_22B0 : Array[0..7] of Bool;
END_VAR
#_20S : Bool; // Auto-generated temporary
#TON_INSTANCE_29 : Bool; // Auto-generated temporary
BEGIN
// Network 1: Track Filler Speed Start (Original Language: LAD)
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_TrackFillerSpeed" THEN
"gTrackFillerSpeed" := TRUE;
END_IF;
// Network 2: Track Filler Speed Stop (Original Language: LAD)
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_TrackFillerSpeed" OR "HMI_PID"."RMM301"."ManualControl"."ManOut" THEN
"gTrackFillerSpeed" := FALSE;
END_IF;
// Network 3: Qualifier (Original Language: LAD)
"Procedure_Variables"."Filler_Speed"."Qualifier" := "Procedure_Variables"."Blender_Run"."Latch" OR "AUX FALSE";
// Network 4: Read Level (Original Language: LAD)
"mReadLevel" := Eq("mNumOfCycle", 0);
// Network 5: Read level & Product Target (Original Language: LAD)
IF "mReadLevel" THEN
"mInitialLevel" := "HMI_Instrument"."LTM302"."PVFiltered";
"mPrevSpeed" := "Blender_Variables"."gActual_Prod_SP";
END_IF;
// Network 6: Acquisition Time (Original Language: LAD)
IF "Procedure_Variables"."Filler_Speed"."Qualifier" AND "Procedure_Variables"."Filler_Speed"."Latch" THEN
"mAcqTime" := "mAcqTime" + "Time_300ms";
END_IF;
// Network 7: Speed Request (Original Language: LAD)
IF "Procedure_Variables"."Filler_Speed"."Qualifier" THEN
"mNumOfCycle" := "mNumOfCycle" + 1;
END_IF;
"Procedure_Variables"."Filler_Speed"."Request" := "mNumOfCycle" > 8;
// Network 8: Speed Latch (Original Language: LAD)
"Procedure_Variables"."Filler_Speed"."Latch" := ("FirstScan" AND "Procedure_Variables"."Filler_Speed"."Done" AND "Procedure_Variables"."Filler_Speed"."Qualifier" AND "Procedure_Variables"."Filler_Speed"."Latch") OR ("FirstScan" AND "Procedure_Variables"."Filler_Speed"."Done" AND "Procedure_Variables"."Filler_Speed"."Qualifier" AND "Procedure_Variables"."Filler_Speed"."Request");
// Network 9: Product Liters Calculation (Original Language: LAD)
IF "Procedure_Variables"."Filler_Speed"."Latch" THEN
"Aux_calc1" := "Blender_Variables"."gProdTankVolume" - "Blender_Variables"."gProdTankBottomVol";
"mNumOfCycle" := 0;
END_IF;
IF "Procedure_Variables"."Filler_Speed"."Latch" THEN
"Aux_calc1" := "Aux_calc1" / 100.0;
END_IF;
IF "Procedure_Variables"."Filler_Speed"."Latch" THEN
"Aux_calc2" := "mInitialLevel" - "HMI_Instrument"."LTM302"."PVFiltered";
END_IF;
IF "Procedure_Variables"."Filler_Speed"."Latch" THEN
"mProdLt" := "Aux_calc1" * "Aux_calc2";
END_IF;
// Network 10: Reset Product Liters (Original Language: LAD)
IF "Procedure_Variables"."First_Production"."Done" THEN
"mProdLt" := 0.0;
END_IF;
// Network 11: Acquisition Time not Zero (Original Language: LAD)
"mNotZero" := Ne("mAcqTime", 0.0);
// Network 12: Filler DeltaV Filter (Original Language: STL)
// Aggiungere il LowPassFilter!!
// --- BEGIN STL Network 12 ---
A "mNotZero"
A "Procedure_Variables".Filler_Speed.Latch
= "__PlcmigTempFillBits_22B0"[0]
A "AUX TRUE"
= "__PlcmigTempFillBits_22B0"[1]
BLD 103
A_BRACK
A_BRACK
A "__PlcmigTempFillBits_22B0"[0]
JNB _00b
L "mProdLt"
L "mAcqTime"
DIV_R
T "Aux_calc1"
AN _Statusword_?
SAVE
CLR
_00b: A _Statusword_?
BRACKET
JNB _00c
L "Aux_calc1"
L 60.0
MUL_R
T "Aux_calc1"
AN _Statusword_?
SAVE
CLR
_00c: A _Statusword_?
BRACKET
JNB _00d
CALL "mFillerDeltaVFilter"
_00d: NOP_0
A "__PlcmigTempFillBits_22B0"[0]
JNB _00e
L 0
T "mAcqTime"
_00e: NOP_0
// --- END STL Network 12 ---
// Network 13: Save (Original Language: LAD)
IF "Procedure_Variables"."Filler_Speed"."Qualifier" THEN
"Aux_calc1" := "mSaveDeltaV" - "Blender_Variables"."gBlenderFillerDeltaV";
END_IF;
"mSave" := "Aux_calc1" < 20.0;
// Network 14: Delta V (Original Language: LAD)
"Blender_Variables"."gBlenderFillerDeltaV" := "mSaveDeltaV";
// Network 15: Actual Product Target With Slew Limitation (Original Language: LAD)
"gBlenderSpeedUp" := "Blender_Variables"."gActual_Prod_SP" > "mPrevSpeed";
// Network 16: Actual Product Target With Slew Limitation (Original Language: LAD)
"gBlenderSpeedDown" := "mPrevSpeed" < "Blender_Variables"."gActual_Prod_SP";
// Network 17: FillerTracked (Original Language: LAD)
#TON_INSTANCE_29(IN := "HMI_Device"."PPM303"."Out" AND "HMI_Device"."AVM362"."Out" AND "DI_Flr1_PROD_ok", PT := T#20S); // TODO: Declarar #TON_INSTANCE_29 : TON;
"gFlowToFiller" := #TON_INSTANCE_29.Q;
// Network 18: Calculates blender target production Set Point TO track Filler. (Original Language: LAD)
// Calculates blender target production Set Point TO track Filler.
"Aux_calc1" := "Blender_Variables"."gBlenderFillerDeltaV" / 4.0;
"mTemp" := "Blender_Variables"."gActual_Prod_SP" + "Aux_calc1";
// Network 19: Blender Filler Production Rate difference - L/min - (Original Language: LAD)
"Aux_calc1" := "Blender_Variables"."gSP_ProdTrackFiller" - "mTemp";
// Network 20: Product Tank Bottom Volume Below level Probe (Original Language: LAD)
IF "gWorkshopTest" THEN
SpeedAdjust(i_IstLvl := "Blender_Constants"."gTM301TargetL_Ist", i_PrdTnkLvl := "HMI_Instrument"."LTM302"."PVFiltered", i_SpeedPerc := "Blender_Constants"."gTM301LvlPercRange", i_TrgTnkLvl := "Blender_Variables"."gProdTankTargetLvl");
END_IF;
IF "gWorkshopTest" THEN
"mSpeedPerc" := 1.0;
END_IF;
"mDummy" := "gWorkshopTest";
// Network 21: Speed Perc (Original Language: LAD)
IF "gWorkshopTest" AND "AUX TRUE" THEN
SpeedAdjust(i_IstLvl := "Blender_Constants"."gTM301TargetL_Ist", i_PrdTnkLvl := "HMI_Instrument"."LTM302"."PVFiltered", i_SpeedPerc := "Blender_Constants"."gTM301LvlPercRange", i_TrgTnkLvl := "Blender_Variables"."gProdTankTargetLvl");
END_IF;
IF "gWorkshopTest" AND "AUX TRUE" THEN
"mSpeedPerc" := 1.0;
END_IF;
// Network 22: Estimated Filler Speed (Original Language: LAD)
IF "mFillerTracked" THEN
"mFillerSpeedFilter"(i_Enable := "gBlenderBlending" AND "gBlenderStableFlow", i_Num := 10, i_Value := "mTemp");
END_IF;
// Network 23: Estimated Flow (Original Language: LAD)
IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_BlendFillSystem" THEN
"mFillerEstimatedFlow" := "Filler_Head_Variables"."Prod_FlowEstimatedSlw";
END_IF;
IF NOT "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_BlendFillSystem" THEN
"mFillerEstimatedFlow" := "Blender_Variables"."gEstimateFillerSpeed";
END_IF;
// Network 24: Estimated Flow (Original Language: LAD)
IF NOT "gTrackFillerSpeed" OR NOT "gEnRampDownToStop" THEN
"mFillerEstimatedFlow" := "HMI_Blender_Parameters"."Actual_Recipe_Parameters"."_ProductionRate";
END_IF;
// Network 25: L / min (Original Language: LAD)
"Blender_Variables"."gSP_ProdTrackFiller" := "mFillerEstimatedFlow" * "mSpeedPerc";
// Network 26: Analog Values (Original Language: LAD)
"HMI_Variables_Status"."Analog_Values"."BlenderProd" := "Blender_Variables"."gActual_Prod_SP";
"HMI_Variables_Status"."Analog_Values"."EstFillerProd" := "Blender_Variables"."gEstimateFillerSpeed";
"mDummy" := TRUE;
// Network 27: Speed Measuring Done (Original Language: LAD)
"Procedure_Variables"."Filler_Speed"."Done" := "Procedure_Variables"."Filler_Speed"."Latch" AND "Procedure_Variables"."Filler_Speed"."Request";
END_FUNCTION_BLOCK
```

View File

@ -0,0 +1,49 @@
```pascal
// Block Type: InstanceDB
// Block Number: 974
DATA_BLOCK "BlenderRun_MeasFil_Data"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR
mNumOfCycle : Int := 8;
mInitialLevel : Real := 0.1653909;
mPrevSpeed : Real := 0.0;
mAcqTime : Real := 2.1;
mProdLt : Real := 0.0;
mSaveDeltaV : Real := 0.0;
mFillerTracked : Bool := FALSE;
mFillerTrackedTmrON : Bool := FALSE;
mFlrFlowDelayOnON : Bool := FALSE;
mFlrFlowDelayOffON : Bool := FALSE;
mFillerTrackedTmr : STRUCT
PT : Time := T#0MS;
ET : Time := T#0MS;
IN : Bool := FALSE;
Q : Bool := FALSE;
END_STRUCT;
mFlrFlowDelayOn : STRUCT
PT : Time;
ET : Time := T#0MS;
IN : Bool := FALSE;
Q : Bool := FALSE;
END_STRUCT;
mFlrFlowDelayOff : STRUCT
PT : Time;
ET : Time := T#0MS;
IN : Bool := FALSE;
Q : Bool := FALSE;
END_STRUCT;
mFillerDeltaVFilter : "LowPassFilter";
mFillerSpeedFilter : "LowPassFilter";
END_VAR
BEGIN
// Data Blocks have no executable code
END_DATA_BLOCK
```

View File

@ -0,0 +1,115 @@
```pascal
// Block Type: FC
// Block Number: 2040
// Original Network Languages: LAD
FUNCTION "BlenderRun_ProdTime" : Void
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR_TEMP
m1MinONS : Bool;
m1HourONS : Bool;
Buffer : Bool;
mRunMin : Bool;
mRunHr : Bool;
I_DIRunning_sec : DInt;
I_DIRunning_min : DInt;
MOD60 : DInt;
END_VAR
#_60 : Bool; // Auto-generated temporary
BEGIN
// Network 1: Seconds (Original Language: LAD)
IF "Procedure_Variables"."Blender_Run"."Running" AND "CLK_1.0S" THEN
"Blender_Variables_Pers"."gSLIM_Sec" := "Blender_Variables_Pers"."gSLIM_Sec" + 1;
END_IF;
// Network 2: Reset Hours (Original Language: LAD)
IF "SLIM_Variables"."ResetHour" THEN
"Blender_Variables_Pers"."gSLIM_Sec" := 0;
END_IF;
// Network 3: Seconds Counter (Original Language: LAD)
IF "CLK_1.0S" AND "gBlenderBlending" THEN
"Blender_Variables_Pers"."gProdSec" := "Blender_Variables_Pers"."gProdSec" + 1;
END_IF;
// Network 4: Minute (Original Language: LAD)
"m1MinONS" := Eq("Blender_Variables_Pers"."gProdSec", 60);
// Network 5: Minute Counter (Original Language: LAD)
IF "m1MinONS" THEN
"Blender_Variables_Pers"."gProdSec" := 0;
"Blender_Variables_Pers"."gProdMin" := "Blender_Variables_Pers"."gProdMin" + 1;
END_IF;
// Network 6: Hour (Original Language: LAD)
"m1HourONS" := Eq("Blender_Variables_Pers"."gProdMin", 60);
// Network 7: Hour Counter (Original Language: LAD)
IF "m1HourONS" THEN
"Blender_Variables_Pers"."gProdMin" := 0;
"Blender_Variables_Pers"."gProdHour" := "Blender_Variables_Pers"."gProdHour" + 1;
"Blender_Variables_Pers"."gBlendingMaintHour" := "Blender_Variables_Pers"."gBlendingMaintHour" + 1;
END_IF;
// Network 8: Counter reset (Original Language: LAD)
IF "gBlenderCIPMode" OR "gBlenderRinseMode" THEN
"Blender_Variables_Pers"."gProdSec" := 0;
"Blender_Variables_Pers"."gProdMin" := 0;
"Blender_Variables_Pers"."gProdHour" := 0;
END_IF;
// Network 9: Running Seconds (Original Language: LAD)
IF "Procedure_Variables"."Blender_Run"."Running" AND "CLK_1.0S" THEN
"Blender_Variables_Pers"."gRunningSeconds" := "Blender_Variables_Pers"."gRunningSeconds" + 1;
END_IF;
// Network 10: Running Minutes (Original Language: LAD)
"I_DIRunning_sec" := "Blender_Variables_Pers"."gRunningSeconds";
"MOD60" := "I_DIRunning_sec" MOD DINT#60;
IF "Procedure_Variables"."Blender_Run"."Running" AND "CLK_1.0S" AND Eq("MOD60", DINT) THEN
"Blender_Variables_Pers"."gRunningMinutes" := "Blender_Variables_Pers"."gRunningMinutes" + 1;
END_IF;
// Edge Logic handled by Coil 42
"M19012" := Eq("MOD60", DINT); // P_TRIG(Eq("MOD60", DINT)) - Mem: "M19012"
"mRunMin" := NOT "M19012" AND Eq("MOD60", DINT);
"M19012" := Eq("MOD60", DINT); // P_TRIG(Eq("MOD60", DINT)) - Mem: "M19012"
// Network 11: Running Hours for Maintenance (Original Language: LAD)
IF "mRunMin" THEN
"I_DIRunning_min" := "Blender_Variables_Pers"."gRunningMinutes";
END_IF;
IF "mRunMin" THEN
"MOD60" := "I_DIRunning_min" MOD DINT#60;
END_IF;
IF Eq("MOD60", DINT) THEN
"Blender_Variables_Pers"."gRunningMaintHour" := "Blender_Variables_Pers"."gRunningMaintHour" + 1;
END_IF;
// Network 12: Running Hours for Maintenance (Original Language: LAD)
"HMI_Variables_Status"."System"."BlendingMaintHour" := "Blender_Variables_Pers"."gRunningMaintHour";
END_FUNCTION
```

View File

@ -0,0 +1,212 @@
```pascal
FUNCTION "BlenderRun_SelectConstan" : Void
{ S7_Optimized_Access := 'FALSE' }
AUTHOR : 'Author'
FAMILY : TASK2
NAME : 'Name'
VERSION : 1.0
BEGIN
CASE "HMI_Blender_Parameters".Processor_Options.Blender_OPT._ModelNum OF
0: "Blender_Variables".gWaterVFM_DN := 25 ;
"Blender_Variables".gSyrupMFM_DN := 15 ;
"Blender_Variables".gWaterPipe_DN := 32 ;
(* classic code: "Blender_Variables".gSyrupMFMZeroStab := 0.325 ;*)
"Blender_Variables".gSyrupMFMZeroStab := REAL#0.325 ;
"Blender_Variables".gProdTankVolume := 550 ;
(* classic code: "Blender_Variables".gBlenderNomSpeed := 116.7 * "Blender_Constants".gBlenderNominalSpeedAdj ;*)
"Blender_Variables".gBlenderNomSpeed := REAL#116.7 * "Blender_Constants".gBlenderNominalSpeedAdj ;
"Blender_Variables".gProdTankBottomVol := 105 ;
(* classic code: "Blender_Variables".gFlowTronic := 1000.0 ;*)
"Blender_Variables".gFlowTronic := REAL#1000.0 ;
1: "Blender_Variables".gWaterVFM_DN := 25 ;
"Blender_Variables".gSyrupMFM_DN := 15 ;
"Blender_Variables".gWaterPipe_DN := 38 ;
(* classic code: "Blender_Variables".gSyrupMFMZeroStab := 0.325 ;*)
"Blender_Variables".gSyrupMFMZeroStab := REAL#0.325 ;
"Blender_Variables".gProdTankVolume := 550 ;
(* classic code: "Blender_Variables".gBlenderNomSpeed := 116.7 * "Blender_Constants".gBlenderNominalSpeedAdj ;*)
"Blender_Variables".gBlenderNomSpeed := REAL#116.7 * "Blender_Constants".gBlenderNominalSpeedAdj ;
"Blender_Variables".gProdTankBottomVol := 105 ;
(* classic code: "Blender_Variables".gFlowTronic := 1000.0 ;*)
"Blender_Variables".gFlowTronic := REAL#1000.0 ;
2: "Blender_Variables".gWaterVFM_DN := 25 ; // NOT Exists
"Blender_Variables".gSyrupMFM_DN := 15 ;
"Blender_Variables".gWaterPipe_DN := 50 ;
(* classic code: "Blender_Variables".gSyrupMFMZeroStab := 0.325 ;*)
"Blender_Variables".gSyrupMFMZeroStab := REAL#0.325 ;
"Blender_Variables".gProdTankVolume := 550 ;
(* classic code: "Blender_Variables".gBlenderNomSpeed := 150.0 * "Blender_Constants".gBlenderNominalSpeedAdj ;*)
"Blender_Variables".gBlenderNomSpeed := REAL#150.0 * "Blender_Constants".gBlenderNominalSpeedAdj ;
"Blender_Variables".gProdTankBottomVol := 105 ;
(* classic code: "Blender_Variables".gFlowTronic := 1000.0 ;*)
"Blender_Variables".gFlowTronic := REAL#1000.0 ;
3: "Blender_Variables".gWaterVFM_DN := 25 ;
"Blender_Variables".gSyrupMFM_DN := 15 ;
"Blender_Variables".gWaterPipe_DN := 50 ;
(* classic code: "Blender_Variables".gSyrupMFMZeroStab := 0.325 ;*)
"Blender_Variables".gSyrupMFMZeroStab := REAL#0.325 ;
"Blender_Variables".gProdTankVolume := 550 ;
"Blender_Variables".gDeairTankVolume := 550 ;
(* classic code: "Blender_Variables".gBlenderNomSpeed := 200.0 * "Blender_Constants".gBlenderNominalSpeedAdj ;*)
"Blender_Variables".gBlenderNomSpeed := REAL#200.0 * "Blender_Constants".gBlenderNominalSpeedAdj ;
"Blender_Variables".gProdTankBottomVol := 105 ;
(* classic code: "Blender_Variables".gFlowTronic := 1000.0 ;*)
"Blender_Variables".gFlowTronic := REAL#1000.0 ;
4: "Blender_Variables".gWaterVFM_DN := 40 ;
"Blender_Variables".gSyrupMFM_DN := 25 ;
"Blender_Variables".gWaterPipe_DN := 65 ;
(* classic code: "Blender_Variables".gSyrupMFMZeroStab := 0.9 ;*)
"Blender_Variables".gSyrupMFMZeroStab := REAL#0.9 ;
"Blender_Variables".gProdTankVolume := 1150 ;
"Blender_Variables".gDeairTankVolume := 550 ;
(* classic code: "Blender_Variables".gBlenderNomSpeed := 283.0 * "Blender_Constants".gBlenderNominalSpeedAdj ;*)
"Blender_Variables".gBlenderNomSpeed := REAL#283.0 * "Blender_Constants".gBlenderNominalSpeedAdj ;
"Blender_Variables".gProdTankBottomVol := 105 ;
(* classic code: "Blender_Variables".gFlowTronic := 1000.0 ;*)
"Blender_Variables".gFlowTronic := REAL#1000.0 ;
"Blender_Variables".gBufferTankProbeHeight := "Blender_Constants".gBufferTankProbeHtD4_5_6 ;
5: "Blender_Variables".gWaterVFM_DN := 40 ;
"Blender_Variables".gSyrupMFM_DN := 25 ;
"Blender_Variables".gWaterPipe_DN := 65 ;
(* classic code: "Blender_Variables".gSyrupMFMZeroStab := 0.9 ;*)
"Blender_Variables".gSyrupMFMZeroStab := REAL#0.9 ;
"Blender_Variables".gProdTankVolume := 1150 ;
"Blender_Variables".gDeairTankVolume := 550 ;
(* classic code: "Blender_Variables".gBlenderNomSpeed := 350.0 * "Blender_Constants".gBlenderNominalSpeedAdj ;*)
"Blender_Variables".gBlenderNomSpeed := REAL#350.0 * "Blender_Constants".gBlenderNominalSpeedAdj ;
"Blender_Variables".gProdTankBottomVol := 105 ;
(* classic code: "Blender_Variables".gFlowTronic := 1000.0 ;*)
"Blender_Variables".gFlowTronic := REAL#1000.0 ;
"Blender_Variables".gBufferTankProbeHeight := "Blender_Constants".gBufferTankProbeHtD4_5_6 ;
6: "Blender_Variables".gWaterVFM_DN := 40 ;
"Blender_Variables".gSyrupMFM_DN :=25 ;
"Blender_Variables".gWaterPipe_DN := 80 ;
(* classic code: "Blender_Variables".gSyrupMFMZeroStab := 0.9;*)
"Blender_Variables".gSyrupMFMZeroStab := REAL#0.9;
"Blender_Variables".gProdTankVolume := 1150 ;
"Blender_Variables".gDeairTankVolume := 1150 ;
(* classic code: "Blender_Variables".gBlenderNomSpeed := 450.0 * "Blender_Constants".gBlenderNominalSpeedAdj ;*)
"Blender_Variables".gBlenderNomSpeed := REAL#450.0 * "Blender_Constants".gBlenderNominalSpeedAdj ;
"Blender_Variables".gProdTankBottomVol := 105 ;
(* classic code: "Blender_Variables".gFlowTronic := 1000.0 ;*)
"Blender_Variables".gFlowTronic := REAL#1000.0 ;
"Blender_Variables".gBufferTankProbeHeight := "Blender_Constants".gBufferTankProbeHtD4_5_6 ;
7: "Blender_Variables".gWaterVFM_DN := 50 ;
"Blender_Variables".gSyrupMFM_DN := 40 ;
"Blender_Variables".gWaterPipe_DN := 80 ;
(* classic code: "Blender_Variables".gSyrupMFMZeroStab := 2.25 ;*)
"Blender_Variables".gSyrupMFMZeroStab := REAL#2.25 ;
"Blender_Variables".gProdTankVolume := 2170 ;
"Blender_Variables".gDeairTankVolume := 1150 ;
(* classic code: "Blender_Variables".gBlenderNomSpeed := 567.0 * "Blender_Constants".gBlenderNominalSpeedAdj ;*)
"Blender_Variables".gBlenderNomSpeed := REAL#600.0 * "Blender_Constants".gBlenderNominalSpeedAdj ;
"Blender_Variables".gProdTankBottomVol := 105 ;
(* classic code: "Blender_Variables".gFlowTronic := 1000.0 ;*)
"Blender_Variables".gFlowTronic := REAL#1000.0 ;
"Blender_Variables".gBufferTankProbeHeight := "Blender_Constants".gBufferTankProbeHtD7_8_9 ;
8: "Blender_Variables".gWaterVFM_DN := 50 ;
"Blender_Variables".gSyrupMFM_DN := 40 ;
"Blender_Variables".gWaterPipe_DN := 105 ;
(* classic code: "Blender_Variables".gSyrupMFMZeroStab := 2.25 ;*)
"Blender_Variables".gSyrupMFMZeroStab := REAL#2.25 ;
"Blender_Variables".gProdTankVolume := 2170 ;
"Blender_Variables".gDeairTankVolume := 1150 ;
(* classic code: "Blender_Variables".gBlenderNomSpeed := 700.0 * "Blender_Constants".gBlenderNominalSpeedAdj ;*)
"Blender_Variables".gBlenderNomSpeed := REAL#700.0 * "Blender_Constants".gBlenderNominalSpeedAdj ;
"Blender_Variables".gProdTankBottomVol := 100 ;
(* classic code: "Blender_Variables".gFlowTronic := 1000.0 ;*)
"Blender_Variables".gFlowTronic := REAL#1000.0 ;
"Blender_Variables".gBufferTankProbeHeight := "Blender_Constants".gBufferTankProbeHtD7_8_9 ;
9: "Blender_Variables".gWaterVFM_DN := 50 ;
"Blender_Variables".gSyrupMFM_DN := 40 ;
"Blender_Variables".gWaterPipe_DN := 100 ;
(* classic code: "Blender_Variables".gSyrupMFMZeroStab := 2.25 ;*)
"Blender_Variables".gSyrupMFMZeroStab := REAL#2.25 ;
"Blender_Variables".gProdTankVolume := 2170 ;
"Blender_Variables".gDeairTankVolume := 1150 ;
(* classic code: "Blender_Variables".gBlenderNomSpeed := 900.0 * "Blender_Constants".gBlenderNominalSpeedAdj ;*)
"Blender_Variables".gBlenderNomSpeed := REAL#900.0 * "Blender_Constants".gBlenderNominalSpeedAdj ;
"Blender_Variables".gProdTankBottomVol := 105 ;
(* classic code: "Blender_Variables".gFlowTronic := 1000.0 ;*)
"Blender_Variables".gFlowTronic := REAL#1000.0 ;
"Blender_Variables".gBufferTankProbeHeight := "Blender_Constants".gBufferTankProbeHtD7_8_9 ;
10: "Blender_Variables".gWaterVFM_DN := 65 ;
"Blender_Variables".gSyrupMFM_DN := 50 ;
"Blender_Variables".gWaterPipe_DN := 100 ;
(* classic code: "Blender_Variables".gSyrupMFMZeroStab := 2.25 ;*)
"Blender_Variables".gSyrupMFMZeroStab := REAL#2.25 ;
"Blender_Variables".gProdTankVolume := 2170 ;
"Blender_Variables".gDeairTankVolume := 1150 ;
(* classic code: "Blender_Variables".gBlenderNomSpeed := 1100.0 * "Blender_Constants".gBlenderNominalSpeedAdj ;*)
"Blender_Variables".gBlenderNomSpeed := REAL#1100.0 * "Blender_Constants".gBlenderNominalSpeedAdj ;
"Blender_Variables".gProdTankBottomVol := 105 ;
(* classic code: "Blender_Variables".gFlowTronic := 1000.0 ;*)
"Blender_Variables".gFlowTronic := REAL#666.66 ;
ELSE:
;
END_CASE;
(* classic code: "HMI_Variables_Status".Analog_Values.BlenderSlowProd := "Blender_Variables".gBlenderNomSpeed * 0.5;*)
"HMI_Variables_Status".Analog_Values.BlenderSlowProd := "Blender_Variables".gBlenderNomSpeed * REAL#0.5;
IF "HMI_Blender_Parameters".Actual_Recipe_Parameters._ProductionRate >= "HMI_Variables_Status".Analog_Values.BlenderSlowProd THEN
"Blender_Variables".gMinProduction := "Blender_Variables".gBlenderNomSpeed * "HMI_Blender_Parameters".ProcessSetup._MinSpeedNominalProd;
ELSE
"Blender_Variables".gMinProduction := "Blender_Variables".gBlenderNomSpeed * "HMI_Blender_Parameters".ProcessSetup._MinSpeedSlowProd;
END_IF;
"Blender_Variables".gCarboCO2MFM_DN := 15 ;
"Blender_Variables".gWaterVFM_Area := "Blender_Constants".gP_Greek * "Blender_Variables".gWaterVFM_DN / 2 / 100 * "Blender_Variables".gWaterVFM_DN / 2 / 100 ;
"Blender_Variables".gWaterPipe_Area := "Blender_Constants".gP_Greek * "Blender_Variables".gWaterPipe_DN / 2 / 100 * "Blender_Variables".gWaterPipe_DN / 2 / 100 ;
(* classic code: "Blender_Variables".gWaterVFMMeasError := 0.2 ;*)
"Blender_Variables".gWaterVFMMeasError := REAL#0.2 ;
(* classic code: "Blender_Variables".gWaterVFMRepeatibility := 0.1 ;*)
"Blender_Variables".gWaterVFMRepeatibility := REAL#0.1 ;
(* classic code: "Blender_Variables".gSyrupMFMMeasError := 0.1 ;*)
"Blender_Variables".gSyrupMFMMeasError := REAL#0.1 ;
(* classic code: "Blender_Variables".gSyrupMFMRepeatibility := 0.05 ;*)
"Blender_Variables".gSyrupMFMRepeatibility := REAL#0.05 ;
(* classic code: "Blender_Variables".gCO2MFMMeasError := 0.5 ;*)
"Blender_Variables".gCO2MFMMeasError := REAL#0.5 ;
(* classic code: "Blender_Variables".gCO2MFMRepeatibility := 0.25 ;*)
"Blender_Variables".gCO2MFMRepeatibility := REAL#0.25 ;
(* classic code: "Blender_Variables".gCO2MFMZeroStab := 0.325 ;*)
"Blender_Variables".gCO2MFMZeroStab := REAL#0.325 ;
"Blender_Variables".gFirstProdExtraBrix := "HMI_Blender_Parameters".ProcessSetup._FirstProdExtraBrix ;
"Blender_Variables".gFirstProdDietExtraSyr := "HMI_Blender_Parameters".ProcessSetup._FirstProdDietExtraSyr ;
"Blender_Variables".gFirstProdExtraCO2Fact := "HMI_Blender_Parameters".Actual_Recipe_Parameters._FirstProdExtraCO2Fact ;
"System_RunOut_Variables".TM301_Drain.Time_Preset.Step0 := DINT_TO_INT(WORD_TO_DINT("HMI_Blender_Parameters".ProcessSetup._TM301DrainSt0Time));
"System_RunOut_Variables".TM301_Drain.Time_Preset.Step1 := DINT_TO_INT(WORD_TO_DINT("HMI_Blender_Parameters".ProcessSetup._TM301DrainSt1Time));
"System_RunOut_Variables".TM301_Drain.Time_Preset.Step2 := DINT_TO_INT(WORD_TO_DINT("HMI_Blender_Parameters".ProcessSetup._TM301DrainSt2Time));
"System_RunOut_Variables".TM301_Drain.Time_Preset.Step3 := DINT_TO_INT(WORD_TO_DINT("HMI_Blender_Parameters".ProcessSetup._TM301DrainSt3Time));
"System_RunOut_Variables".Prod_Pipe_RunOut.Time_Preset.Step0 := DINT_TO_INT(WORD_TO_DINT("HMI_Blender_Parameters".ProcessSetup._ProdPipeRunOutSt0Time));
"System_RunOut_Variables".RMM301_OV_ProdPipeRunOut := "HMI_Blender_Parameters".ProcessSetup._RMM301ProdPipeRunOu ;
"System_RunOut_Variables".RMP302_OV_ProdPipeRunOut := "HMI_Blender_Parameters".ProcessSetup._RMP302ProdPipeRunOu;
"System_RunOut_Variables".ProdPipeRunOutProdAmount := "HMI_Blender_Parameters".ProcessSetup._ProdPipeRunOutAmount ;
"System_RunOut_Variables".TM301RunOutChillerAm := "HMI_Blender_Parameters".ProcessSetup._TM301RunOutChiller;
END_FUNCTION
```

View File

@ -0,0 +1,48 @@
```pascal
// Block Type: FC
// Block Number: 2041
// Original Network Languages: LAD
FUNCTION "BlenderRun_Stopping" : Void
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
BEGIN
// Network 1: Request (Original Language: LAD)
"Procedure_Variables"."Blender_Stop"."Request" := "gIN_StopBtn" OR "gBlenderAlarm";
// Network 2: Latch (Original Language: LAD)
"Procedure_Variables"."Blender_Stop"."Latch" := ("Procedure_Variables"."Blender_Stop"."Request" AND "Procedure_Variables"."Blender_Run"."Latch" AND "Procedure_Variables"."Blender_Stop"."Done" AND "gBlenderSuppliesOk") OR ("Procedure_Variables"."Blender_Stop"."Latch" AND "Procedure_Variables"."Blender_Run"."Latch" AND "Procedure_Variables"."Blender_Stop"."Done" AND "gBlenderSuppliesOk");
// Network 3: OperatorStop (Original Language: LAD)
// Network 3 did not produce printable SCL code.
// Network 4: Stop Done Reset (Original Language: LAD)
IF "Procedure_Variables"."Blender_Stop"."Done" THEN
"Procedure_Variables"."Blender_Stop"."Done" := FALSE;
END_IF;
// Network 5: Stop (Original Language: LAD)
"gEnRampDownToStop" := ("Blender_Variables_Pers"."gWaterRecipe" AND "HMI_PID"."RMM303"."ManualControl"."ManOut" AND "HMI_PID"."RMM301"."ManualControl"."ManOut") OR ("Blender_Variables_Pers"."gWaterRecipe" AND "Blender_Variables_Pers"."gCarboStillProduct" AND "HMI_PID"."RMM301"."ManualControl"."ManOut") OR ("HMI_PID"."RMM303"."ManualControl"."ManOut" AND "HMI_PID"."RMM301"."ManualControl"."ManOut" AND "HMI_PID"."RMP302"."ManualControl"."ManOut") OR ("Blender_Variables_Pers"."gCarboStillProduct" AND "HMI_PID"."RMM301"."ManualControl"."ManOut" AND "HMI_PID"."RMP302"."ManualControl"."ManOut");
// Network 6: Stop Done (Original Language: LAD)
IF "gBlenderStopping" AND "gEnRampDownToStop" AND "gFTN301_SpeedToStop" THEN
"Procedure_Variables"."Blender_Stop"."Done" := TRUE;
END_IF;
// Network 7: Stop Done (Original Language: LAD)
IF "gBlenderStopping" AND "gEnRampDownToStop" THEN
"Procedure_Variables"."Blender_Stop"."Done" := TRUE;
END_IF;
END_FUNCTION
```

View File

@ -0,0 +1,247 @@
```pascal
// Block Type: FC
// Block Number: 2015
// Original Network Languages: LAD, STL
FUNCTION "BlenderRun__Control" : Void
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR_TEMP
Buffer : Bool;
mInitBlendError : Bool;
gRunningMaintHour : DInt;
MOD_DI_OUT_Seg31 : DInt;
gCheckOilModValves : DInt;
gCheckOilWaterPumpMotor : DInt;
MOD_DI_OUT_Seg33 : DInt;
mRealEnRecPHE01 : Real;
mRealEnRecPHE02 : Real;
__PlcmigTempFillBits_30B0 : Array[0..7] of Bool;
END_VAR
#_2S : Bool; // Auto-generated temporary
#_2m : Bool; // Auto-generated temporary
#_3S : Bool; // Auto-generated temporary
#_4M : Bool; // Auto-generated temporary
#_5M : Bool; // Auto-generated temporary
#_5m : Bool; // Auto-generated temporary
BEGIN
// Network 1: Buffer (Original Language: LAD)
BlenderRun_SelectConstan();
BlenderRun_ProdTime();
"Buffer" := TRUE;
// Network 2: Qualifier (Original Language: LAD)
"Procedure_Variables"."Blender_Run"."Qualifier" := ("gBlenderProdMode" AND "gProductionONS" AND "gHighPriorityAlarm" AND "Procedure_Variables"."Blender_Rinse"."ONS_Done") OR ("gBlenderProdMode" AND "gProductionONS" AND "gHighPriorityAlarm" AND "System_RunOut_Variables"."FastChangeOverActivated") OR ("gBlenderCIPMode" AND "gCIPONS" AND "gHighPriorityAlarm" AND "Procedure_Variables"."Blender_Rinse"."ONS_Done") OR ("gBlenderCIPMode" AND "gCIPONS" AND "gHighPriorityAlarm" AND "System_RunOut_Variables"."FastChangeOverActivated");
// Network 3: Blender Run Stopping (Original Language: LAD)
BlenderRun_Stopping();
// Network 4: Reset (Original Language: LAD)
"Procedure_Variables"."Blender_Run"."Reset" := ("gBlenderProdMode" AND "Procedure_Variables"."TM301_RunOut"."Done" AND "HMI_Variables_Status"."System_Run_Out"."SystemRunOutEnabled" AND "System_RunOut_Variables"."System_RunOut"."Reset" AND "gBlenderRinseMode") OR ("gBlenderProdMode" AND "Procedure_Variables"."TM301_RunOut"."Done" AND "HMI_Variables_Status"."System_Run_Out"."SystemRunOutEnabled" AND "gBlenderRinseMode" AND "System_RunOut_Variables"."FastChangeOverActivated") OR ("gBlenderProdMode" AND "HMI_Variables_Status"."System_Run_Out"."SystemRunOutEnabled" AND "System_RunOut_Variables"."System_RunOut"."Reset" AND "gBlenderRinseMode" AND "Procedure_Variables"."TM301_RunOut"."Latch") OR ("gBlenderProdMode" AND "HMI_Variables_Status"."System_Run_Out"."SystemRunOutEnabled" AND "gBlenderRinseMode" AND "System_RunOut_Variables"."FastChangeOverActivated" AND "Procedure_Variables"."TM301_RunOut"."Latch");
// Network 5: Request (Original Language: LAD)
// PBox SymPy processed, logic in consumer
"M19007" := "gIN_StartBtn" AND "mEnableStartTmr"; // P_TRIG("gIN_StartBtn" AND "mEnableStartTmr") - Mem: "M19007"
"Procedure_Variables"."Blender_Run"."Request" := "gIN_StartBtn" AND "mEnableStartTmr" AND "Procedure_Variables"."Blender_Run"."Qualifier" AND NOT "M19007";
// Network 6: Running (Original Language: LAD)
"Procedure_Variables"."Blender_Run"."Latch" := ("Procedure_Variables"."Blender_Run"."Qualifier" AND "Procedure_Variables"."Blender_Run"."Request" AND "FirstScan" AND "Procedure_Variables"."Blender_Run"."Reset" AND "Procedure_Variables"."Blender_Run"."Done") OR ("Procedure_Variables"."Blender_Run"."Qualifier" AND "DI_PB_Machine_Start" AND "FirstScan" AND "Procedure_Variables"."Blender_Run"."Reset" AND "Procedure_Variables"."Blender_Run"."Done");
"HMI_Variables_Status"."System"."Blender_Running" := ("Procedure_Variables"."Blender_Run"."Qualifier" AND "Procedure_Variables"."Blender_Run"."Request" AND "FirstScan" AND "Procedure_Variables"."Blender_Run"."Reset" AND "Procedure_Variables"."Blender_Run"."Done") OR ("Procedure_Variables"."Blender_Run"."Qualifier" AND "DI_PB_Machine_Start" AND "FirstScan" AND "Procedure_Variables"."Blender_Run"."Reset" AND "Procedure_Variables"."Blender_Run"."Done");
// Network 7: EnableStart (Original Language: LAD)
// Network 7 did not produce printable SCL code.
// Network 8: Blender Stopping (Original Language: LAD)
// Network 8 did not produce printable SCL code.
// Network 9: Wait (Original Language: LAD)
"Procedure_Variables"."Blender_Run"."Wait" := ("gBlenderProdMode" AND "Blender_Variables_Pers"."gWaterRecipe" AND "Procedure_Variables"."FTP302Line_Preparation"."Done" AND "gBlenderRinseMode") OR ("gBlenderProdMode" AND "Procedure_Variables"."First_Production"."Latch" AND "gPTM304_OkToRun" AND "gEqPressSelected" AND "gBlenderRinseMode") OR ("gBlenderProdMode" AND "Procedure_Variables"."First_Production"."Latch" AND "gEqPressOk" AND "gEqPressSelected" AND "gBlenderRinseMode");
// Network 10: Running (Original Language: LAD)
"Procedure_Variables"."Blender_Run"."Running" := "Procedure_Variables"."Blender_Run"."Latch" AND "Procedure_Variables"."Blender_Run"."Wait";
// Network 11: Pumps Start (Original Language: LAD)
"gBlenderStartPumps" := "Procedure_Variables"."Blender_Run"."Running";
// Network 12: Pumps Start ONS (Original Language: LAD)
// Edge Logic handled by Coil 26
"M19010" := "gBlenderStartPumps"; // P_TRIG("gBlenderStartPumps") - Mem: "M19010"
"gBlenderStartPumpsONS" := "gBlenderStartPumps" AND NOT "M19010";
"M19010" := "gBlenderStartPumps"; // P_TRIG("gBlenderStartPumps") - Mem: "M19010"
// Network 13: Blend Error Reset (Original Language: LAD)
IF "Procedure_Variables"."First_Production"."Latch" AND "gBlenderStartPumpsONS" AND "gProductChillerEn" THEN
"HMI_Variables_Status"."Analog_Values"."BlendError" := 0.0;
END_IF;
// Network 14: Carbo Co2 Error Reset (Original Language: LAD)
IF "Procedure_Variables"."First_Production"."Latch" AND "gBlenderStartPumpsONS" AND "gProductChillerEn" AND "AUX FALSE" THEN
"Blender_Variables"."gCarboCO2Error" := 0.0;
END_IF;
// Network 15: Blend Error (Original Language: LAD)
"mInitBlendError" := "gBlenderBlending" AND "gHighPriorityAlarm";
// Network 16: Blend Error (Original Language: LAD)
IF "mInitBlendError" AND "gStopBlendCarboError" THEN
"Blender_Variables"."gBlendError" := "Blender_Variables"."gBlendError" + "Blender_Constants"."gBlendErrorAfterAlarm";
END_IF;
// Network 17: Reset Started (Original Language: LAD)
IF "gBlenderCIPMode" OR "gBlenderRinseMode" THEN
"Blender_Variables_Pers"."gBlenderStarted" := FALSE;
END_IF;
// Network 18: Started (Original Language: LAD)
IF "gBlenderProdMode" AND "gBlenderCIPMode" AND "gBlenderRinseMode" AND "Blender_Variables_Pers"."gFirstProdLatched" THEN
"Blender_Variables_Pers"."gBlenderStarted" := TRUE;
END_IF;
// Network 19: DelayBlendEn (Original Language: LAD)
// Water Pump Rise Pressure TIME = 2.6 sec
"mDelayBlendEn"(IN := "gBlenderProdMode" AND "gBlenderRinseMode" AND "gBlenderStartPumps", PT := S5T#3S); // TODO: Declarar "mDelayBlendEn" : TON;
"gBlenderBlending" := "mDelayBlendEn".Q;
// Network 20: Stable Flow (Original Language: LAD)
"mWaitStableFlow"(IN := "gBlenderBlending", PT := S5T#2S); // TODO: Declarar "mWaitStableFlow" : TON;
"gBlenderStableFlow" := "mWaitStableFlow".Q;
// Network 21: Flow Filter Enable (Original Language: LAD)
// gBlenderFlowFltEn: Enables the Product Flow Filter, in order TO disable the
// filter itself during product ramp-up AND down
"gBlenderFlowFltEn" := "gBlenderStableFlow" OR ("Procedure_Variables"."Blender_Stop"."Latch" AND "gBlenderStopping" AND "gBlenderFlowFltEn");
// Network 22: EnToRamp (Original Language: LAD)
"mEnToRamp"(IN := "gBlenderStableFlow", PT := S5T#3S); // TODO: Declarar "mEnToRamp" : TON;
"gBlenderEnToRamp" := "mEnToRamp".Q;
// Network 23: EnCooler (Original Language: LAD)
"mEnCooler"(IN := "gBlenderProdMode" AND "gBlenderStartPumps", PT := S5T#2m); // TODO: Declarar "mEnCooler" : TON;
"PID_Variables"."PID_RVM319_H2O_EnInt" := "mEnCooler".Q;
"PID_Variables"."PID_RVM319_PRD_EnInt" := "mEnCooler".Q;
// Network 24: DlyOffRecirc (Original Language: LAD)
// Network 24 did not produce printable SCL code.
// Network 25: EnRecircPHE (Original Language: LAD)
"m_StartRecircPHE"(IN := "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_CoolerControl" >= 2, PT := S5T#5M); // TODO: Declarar "m_StartRecircPHE" : TON;
IF "m_StartRecircPHE".Q THEN
"gEnRecircPHE" := TRUE;
END_IF;
// Network 26: EnRecircPHE01 (Original Language: STL)
// --- BEGIN STL Network 26 ---
L "HMI_PID".RVM319_PRD.KP
L 0.0
NE_R
= "__PlcmigTempFillBits_30B0"[0]
A "__PlcmigTempFillBits_30B0"[0]
JNB _004
L "HMI_PID".RVM319_PRD.KP
T "mRealEnRecPHE01"
_004: NOP_0
A "__PlcmigTempFillBits_30B0"[0]
NEG
JNB _005
L 1
T "mRealEnRecPHE01"
_005: NOP_0
// --- END STL Network 26 ---
// Network 27: EnRecircPHE02 (Original Language: LAD)
"mRealEnRecPHE02" := "HMI_PID.RVM319.Error" / "mRealEnRecPHE01";
// Network 28: EnRecircPHE Reset (Original Language: LAD)
"m_StopRecircPHE"(IN := "gEnRecircPHE", PT := S5T#5M); // TODO: Declarar "m_StopRecircPHE" : TON;
"mTON_Reset_RecircPHE_Goo"(IN := "mRealEnRecPHE02" <= 1.0, PT := S5T#4M); // TODO: Declarar "mTON_Reset_RecircPHE_Goo" : TON;
IF "HMI_Device"."AVM381"."Config" OR ("HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_CoolerControl" <= 1) THEN
"gEnRecircPHE" := FALSE;
END_IF;
// Network 29: EnStopFromFiller (Original Language: LAD)
"mEnStopFromFillerTmr"(IN := "gBlenderBlending", PT := S5T#5m); // TODO: Declarar "mEnStopFromFillerTmr" : TON;
// Network 30: DelayToRestart (Original Language: LAD)
// Network 30 did not produce printable SCL code.
// Network 31: Check Oil in Modulating Valve (Original Language: LAD)
// Check Oil in Modulating Valve Recirculating Balls Screw
"gRunningMaintHour" := "Blender_Variables_Pers"."gRunningMaintHour";
"gCheckOilModValves" := "Blender_Constants"."gCheckOilModValves";
"MOD_DI_OUT_Seg31" := "gRunningMaintHour" MOD "gCheckOilModValves";
// Network 32: Check Oil in Modulating Valve (Original Language: LAD)
// Check Oil in Modulating Valve Recirculating Balls Screw
"HMI_Alarms"."gH_Message" := Ne(0, "Blender_Variables_Pers"."gRunningMaintHour");
// Network 33: Check Oil in Water Pump Motor (Original Language: LAD)
// Check Oil in Water Pump Motor
"gCheckOilWaterPumpMotor" := "Blender_Constants"."gCheckOilWaterPumpMotor";
"MOD_DI_OUT_Seg33" := "gRunningMaintHour" MOD "gCheckOilWaterPumpMotor";
// Network 34: Check Oil in Water Pump Motor (Original Language: LAD)
// Check Oil in Water Pump Motor
"HMI_Alarms"."gH_Message" := Ne(0, "Blender_Variables_Pers"."gRunningMaintHour");
// Network 35: Done (Original Language: LAD)
"Procedure_Variables"."Blender_Run"."Done" := ("Procedure_Variables"."Blender_Run"."Latch" AND "Procedure_Variables"."Blender_Stop"."Done" AND "Procedure_Variables"."Blender_Stop"."Latch") OR ("Procedure_Variables"."Blender_Run"."Latch" AND "Procedure_Variables"."Blender_Stop"."Request" AND "Procedure_Variables"."Blender_Stop"."Done" AND "gBlenderStopping") OR ("Procedure_Variables"."Blender_Run"."Latch" AND "Procedure_Variables"."Blender_Stop"."Request" AND "Procedure_Variables"."Blender_Stop"."Latch" AND "gBlenderCIPMode") OR ("Procedure_Variables"."Blender_Run"."Latch" AND "Procedure_Variables"."Blender_Stop"."Request" AND "gBlenderCIPMode" AND "gBlenderStopping");
END_FUNCTION
```

View File

@ -0,0 +1,102 @@
```pascal
// Block Type: GlobalDB
// Block Number: 972
DATA_BLOCK "Blender_Constants"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR
gP_Greek : Real := 3.141593;
gH2O_Density : Real := 1.0;
gCO2_Density : Real := 1.98;
gRMM303ValveCv : Real := 0.022;
gDens_Sucrose_1 : Real := 1.6055;
gDens_Sucrose : Real := 1.589;
gDens_Fructose : Real := 1.6055;
gCpSyrup : Real := 0.2145;
gCpH2O : Real := 1.0;
gAnalogMaxValue : Int := 27648;
gAnalogMaxValue_VFC : Int := 16384;
gZeroAbsolute : Real := 273.15;
gBlenderNominalSpeedAdj : Real := 1.05;
gFirstProdRinseTempSP : Real := 5.0;
gFirstProdSpeedGain : Real := 1.0;
gGoodSyrupDensThrsd : Real := 0.9999;
gGoodSyrupDensOffset : Real := 0.0014;
gSugaredSyrupBrixThrsd : Real := 20.548;
gBlendErrorAfterAlarm : Real := 0.0;
gRinseDrainOpPressValve : Real := 20.0;
gProdAmountInSerpentine : Real := 30.0;
gCIP_SP_DeltaT : Real := 5.0;
gCIP_CO2_DeareationValue : Real := 0.0;
gCIP_CO2_InjectionValue : Real := 15.0;
gPressCO2StartUpValue : Real := 0.25;
gMinProdAvailAmount : Real := 200.0;
gMaxProdAvailAmount : Real := 800.0;
gWaterLineTime : Int := 4;
gTP301PrepStep1Time : Int := 4;
gTP301PrepStep2Time : Int := 6;
gBlendFillStartUp_Step1 : Int := 16;
gBlendFillStartUp_Step2 : Int := 6;
gBlendFillStartUp_Step3 : Int := 2;
gBlendFillStartUp_Step4 : Int := 10;
gBlendFillStartUp_Step5 : Int := 10;
gBlendFillStartUp_Step6 : Int := 10;
gFoamCipEnable : Bool := FALSE;
gAir_Density : Real := 1.295;
gN2_Density : Real := 1.252;
Delta_Press_CO2_Test : Real := 2.0;
gSpare07 : Int := 0;
gSpare08 : Int := 0;
gTN301Pressure : Real := 0.05;
gTN301Efficiency : Real := 0.7;
gTN301VacuumPress : Real := -0.7;
gRVN304_Min : Real := 5.5;
gTN301VacuumIst : Real := 0.3;
gTM301PressIst : Real := 0.1;
gStopLvl_OnlyBlend : Real := 80.0;
gTargetLvl_OnlyBlend : Real := 60.0;
gStopLvl_BlendFill : Real := 60.0;
gTargetLvl_BlendFill : Real := 40.0;
gStartLvl_NormalSpeed : Real := 20.0;
gStartLvl_VeryLowSpeed : Real := 30.0;
gTM301PressWaitLvl : Real := 10.0;
gStartMeasFillerSpeedLvl : Real := 4.0;
gTM301TargetL_Ist : Real := 20.0;
gTM301LvlPercRange : Real := 18.0;
gTM301MinLvl : Real := 5.0;
gTP301ProdLvl : Real := 60.0;
gTP301FirstProdLvl : Real := 25.0;
gTP301CIPLvl : Real := 5.0;
gRVP303_Load : Real := 50.0;
gTP301_LvlSlewRate : Real := 2.0;
gTP301_FirstProdRate : Real := 40.0;
gFTN301_MinVel : Real := 0.8;
gWater_MinVel : Real := 1.4;
gModValveFullStrokeTime : Real := 12.0;
gProductionSlewRate : Real := 8.0;
gFillerSpeedTrackSlew : Real := 12.0;
gBrixTrackingMinCorr : Real := 0.01;
gBrixTrackingMaxCorr : Real := 0.2;
gTestSyrBrix : Real := 54.85;
gCheckOilModValves : Int := 2000;
gCheckOilWaterPumpMotor : Int := 2880;
gCO2TrackingMinCorr : Real := 0.01;
gCO2TrackingMaxCorr : Real := 0.2;
gBufferTankProbeHtD4_5_6 : Real := 1850.0;
gBufferTankProbeHtD7_8_9 : Real := 2000.0;
gSyrupSPRecFact : Real := 1.5;
gCO2SPRecFact : Real := 1.5;
gTN301ProdLvl : Real := 35.0;
gTN301_LvlSlewRate : Real := 2.0;
gBalaiageFlowIts : Real := 0.2;
gTM301_LvlSlewRate : Real := 2.0;
gTP301_RinseRate : Real := 40.0;
END_VAR
BEGIN
// Data Blocks have no executable code
END_DATA_BLOCK
```

View File

@ -0,0 +1,27 @@
```pascal
// Block Type: InstanceDB
// Block Name (Original): Blender_Procedure Data
// Block Number: 930
DATA_BLOCK "Blender_Procedure_Data"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR
Deaireator_StartUp : "ProcedureDeaireator StartUp";
CarboWaterLine : "ProcedureCarboWaterLine";
Syrup_RunOut : "ProcedureSyrup RunOut";
SyrBrix_Autocorrection : "SyrBrix Autocorrection";
ProdBrixRecovery : "ProcedureProdBrixRecovery";
Syrup_MFM_StartUp : "ProcedureSyrupMFMStartUp";
ProdTankDrain : "ProcedureProdTankDrain";
ProdTank_RunOut : "ProcedureProdTankRunOut";
Syrup_Line_MFM_Prep : "ProcedureSyrupLineMFMPrep";
BlendFill_StartUp : "ProcedureBlendFill StartUp";
END_VAR
BEGIN
// Data Blocks have no executable code
END_DATA_BLOCK
```

View File

@ -0,0 +1,185 @@
```pascal
// Block Type: GlobalDB
// Block Number: 971
DATA_BLOCK "Blender_Variables"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR
gProdTankStopLvl : Real := 40.0;
gProdTankTargetLvl : Real := 25.0;
gProdTankStartLvl : Real := 20.0;
gSyrupMFMBrixSlope : Real := 0.0;
gH2O_Flow_Meas : Real := 0.0;
gSYR_Flow_Meas : Real := 0.0;
gSYR_Vol_Flow_Meas : Real := 0.0;
gCO2_Flow_Meas : Real := 0.0;
gProd_Flow_Meas : Real := 0.0;
gCO2Solubility : Real := 0.5889701;
gDeairCO2Vol : Real := 0.6569746;
gFillerCO2Loss : Real := 0.15;
gCO2EqPressure : Real := 2.755885;
gCO2InjPressureCalc : Real := 10.0;
gProductLiters : Real := 87.11034;
gProductTemperature : Real := 0.0;
gBlendError : Real := 10.0;
gCarboCO2Error : Real := 87.14999;
gK_RecBlendError : Real := 5.0;
gK_RecCarboCO2Error : Real := 5.0;
gMaxCarboCO2_V : Real := 7.92015;
gWaterFlowSlewValve : Real := 0.0;
gWaterFlowSlewMFM : Real := 0.0;
gDeairCO2Comp : Real := 0.5069746;
gWaterO2 : Real := 9.074822;
gDeairWaterO2 : Real := 0.0;
gSyrupO2 : Real := 4.556799;
gProductO2 : Real := 0.8366871;
gProductDensity : Real := 1.075568;
gProdDensFromMeter : Real := 1.0;
gTankProdAmount : Real := 108.361;
gPrdTankPressError : Real := -0.0853588;
gH2OValveRiseUpTime : Int := 2;
gFillerProductFlow : Real := 0.0;
gWaterVFM_DN : Int := 50;
gWaterPipe_DN : Int := 80;
gSyrupMFM_DN : Int := 40;
gCarboCO2MFM_DN : Int := 15;
gWaterVFMMeasError : Real := 0.2;
gWaterVFMRepeatibility : Real := 0.1;
gWaterVFMCalcError : Real := 0.4721645;
gSyrupMFMMeasError : Real := 0.1;
gSyrupMFMRepeatibility : Real := 0.05;
gSyrupMFMZeroStab : Real := 2.25;
gSyrupMFMCalcError : Real := 0.2303126;
gCO2MFMMeasError : Real := 0.5;
gCO2MFMRepeatibility : Real := 0.25;
gCO2MFMZeroStab : Real := 0.325;
gCO2MFMCalcError : Real := 6.144543;
gFirstProdExtraBrix : Real := 0.15;
gFirstProdDietExtraSyr : Real := 0.002;
gFirstProdExtraCO2Fact : Real := 1.05;
gBlenderBlendMaxError : Real := 0.0;
gWaterVFM_Area : Real := 0.1963496;
gWaterVFM_Vel : Real := 0.0;
gWaterPipe_Area : Real := 0.5026549;
gWaterPipe_Vel : Real := 1.652169;
gWaterSpeedToStopError : Real := 4.229551;
gProdTankVolume : Real := 2170.0;
gProdTankBottomVol : Real := 105.0;
gDeairTankVolume : Real := 1150.0;
gBlenderNomSpeed : Real := 630.0;
gBlenderProdSlewMax : Real := 52.5;
gProductLitTank : Real := 108.4153;
gProductO2Conc : Real := 0.0;
gBlenderFillerDeltaV : Real := 0.0;
gSP_ProdTrackFiller : Real := 350.0;
gEstimateFillerSpeed : Real := 0.0;
gFlowTronic : Real := 1000.0;
gFlowTronicFullScale : Real := 100.0;
gActualGasFactor : Real := 1.235718;
gWaterStat_MeanValue : Real := 0.0;
gWaterStat_Variance : Real := 0.0;
gWaterStat_DevStd : Real := 0.1527207;
gSyrupStat_MeanValue : Real := 0.0;
gSyrupStat_Variance : Real := 0.0;
gSyrupStat_DevStd : Real := 0.3818018;
gCarboCO2Stat_MeanValue : Real := 0.0;
gCarboCO2Stat_Variance : Real := 0.0;
gCarboCO2Stat_DevStd : Real := 0.8522521;
gProdBxStat_MeanValue : Real := 0.0;
gProdBxStat_Variance : Real := 0.0;
gProdBxStat_DevStd : Real := 0.0;
gProdCO2Stat_MeanValue : Real := 0.0;
gProdCO2Stat_Variance : Real := 0.0;
gProdCO2Stat_DevStd : Real := 0.0;
gProdTankBrix : Real := 0.0;
gFlowProdBrix : Real := 12.47313;
gBrixTrackingCorr : Real := 0.0;
gCO2TrackingCorr : Real := 0.0;
gProdRunSyrFact : Real := 1.0;
gProdRunSyrMFMFact : Real := 1.0;
gActualSyrupDens : Real := 1.237;
gActualSyrupBrix : Real := 51.37;
gActualSyrupPerc : Real := 0.1836129;
gActualWaterPerc : Real := 0.8163871;
gSyrupVolFlow_PV : Real := 129.1715;
gProductRecipeNum : Int := 0;
gProductBrix : Real := 0.0;
gProductDens : Real := 0.0;
gProductCO2 : Real := 0.0;
gProductTemp : Real := 0.0;
gProductLinePress : Real := 0.0;
gMeterSyrBrix : Real := 5.0;
gMeterSyrDens : Real := 0.8;
gMeterSyrTemp : Real := 18.69626;
gSP_H2O : Real := 0.0;
gSP_SYR : Real := 0.0;
gSP_CO2 : Real := 0.0;
gSP_SYR_Level : Real := 25.0;
gSP_Prod_Temperature : Real := 0.0;
gSP_H2O_Temperature : Real := 0.0;
gActual_Prod_SP : Real := 0.0;
gActual_SP_CO2 : Real := 3.464378;
gActual_Prod_Flow : Real := 0.0;
gActual_Ratio : Real := 3.857526;
gActual_RatioM : Real := 4.446241;
gActual_CO2_Vol : Real := 0.0;
gInUVLampReady : Bool := TRUE;
gInUVLampAlarm : Bool := FALSE;
gBufferTankProbeHeight : Real := 2000.0;
gMinProduction : Real := 315.0;
gSyrSPRef : Real := 135.8833;
gSyrSPTemp : Real := 50.0;
gCO2SPRef : Real := 0.0;
gCO2SPTemp : Real := 0.0;
gCO2SPTemp2 : Real := 0.0;
gSP_DEAIR_Level : Real := 15.0;
gActual_SP_GAS2 : Real := 0.0;
gSP_GAS2 : Real := 0.0;
gGAS2Stat_MeanValue : Real := 0.0;
gGAS2Stat_Variance : Real := 0.0;
gGAS2Stat_DevStd : Real := 0.0;
gBalaiageFlowError : Real := 3.5;
gSP_STORAGE_Level : Real := 25.0;
Aux_RVN302_PID : STRUCT
ConfigPID : Bool := FALSE;
Hold_Int : Bool := FALSE;
I_ITL : Bool := FALSE;
Alarm : Bool := FALSE;
Spare0_4 : Bool := FALSE;
Spare0_5 : Bool := FALSE;
Spare0_6 : Bool := FALSE;
Config : Bool := FALSE;
PID_FIX : Bool := FALSE;
Spare1_1 : Bool := FALSE;
High_Limit : Bool := FALSE;
Low_Limit : Bool := FALSE;
ManualControl : "Struct";
Bp : Real := 0.0;
Ti : Real := 0.0;
Td : Real := 0.0;
Ff : Real := 0.0;
KP : Real := 0.0;
Pv : Real := 0.0;
OutMan : Real := 0.0;
Lsp : Real := 0.0;
OutMaxHmi : Real := 0.0;
OutMin : Real := 0.0;
OutMax : Real := 100.0;
Spare52 : Real := 0.0;
FfOut : Real := 0.0;
Sp : Real := 0.0;
Out : Real := 0.0;
Cycle_Time : Real := 0.0;
I_ITLVAL : Real := 0.0;
Dead_Band : Real := 0.0;
END_STRUCT;
END_VAR
BEGIN
// Data Blocks have no executable code
END_DATA_BLOCK
```

View File

@ -0,0 +1,51 @@
```pascal
// Block Type: GlobalDB
// Block Number: 970
DATA_BLOCK "Blender_Variables_Pers"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR
gBlenderStarted : Bool := FALSE;
gWaterRecipe : Bool := FALSE;
gSugarBeverage : Bool := TRUE;
gCarboStillProduct : Bool := TRUE;
gCarboStillRecipe : Bool := TRUE;
gSkipDeaireation : Bool := FALSE;
gCoolerEnabled : Bool := TRUE;
gWaterTotal : Real := 0.0;
gSyrupTotal : Real := 0.0;
gCO2Total : Real := 0.0;
gProductVFMTotal : Real := 0.0;
gWaterTempTot : Real := 0.0;
gSyrupTempTot : Real := 0.0;
gCO2TempTot : Real := 0.0;
gProductVFMTempTot : Real := 0.0;
gSyrRunOutCountInit : Real := 0.0;
gSyrLinePrepCountInit : Real := 712.3425;
gSyrupRoomTankLiter : Array[1..15] of Real := [20.0, 320.0, 320.0, 0.0, 0.0, 305.0, 300.0, 310.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0];
gProdSec : Int := 0;
gProdMin : Int := 0;
gProdHour : Int := 0;
gBlendingMaintHour : Int := 598;
gRunningSeconds : Int := -11410;
gRunningMinutes : Int := -16542;
gRunningMaintHour : Int := 820;
gSLIM_Sec : Int := -11410;
gSLIM_Min : Int := 0;
gSLIM_Hour : Int := 0;
gFillerRinse_DoneLatch : Bool := FALSE;
gFirstProdLatched : Bool := FALSE;
Spare00 : Int := 0;
Spare01 : Int := 0;
Procedure_DONE : "Struct";
SystemRunOut : "Struct";
SyrupBrix_Aux : Real := 51.37;
END_VAR
BEGIN
// Data Blocks have no executable code
END_DATA_BLOCK
```

View File

@ -0,0 +1,20 @@
```pascal
// Block Type: FC
// Block Number: 1
// Original Network Languages: LAD
FUNCTION "Blocco_1" : Void
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
BEGIN
// Network 1: (Original Language: LAD)
// Network 1 has no logic elements.
// No executable logic generated by script.
END_FUNCTION
```

View File

@ -0,0 +1,46 @@
```pascal
// Block Type: GlobalDB
// Block Number: 5000
DATA_BLOCK "Blocco_dati_Test"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR
Test_1 : STRUCT
_LinkName : String[32];
CIP_Simple_Prog : STRUCT
CIP_SimpleCode : Int;
CIP_SetPoint_Temp : Real;
CIP_SetPoint_Cond : Real;
CIP_SetPoint_Time : Int;
CIP_Chemical : "Struct";
CIP_HotWaterPreLoad : Bool;
CIP_ChemicalRecovery : Bool;
CIP_WaterRecovery : Bool;
END_STRUCT;
END_STRUCT;
Static_1 : STRUCT
Raw : Bool := FALSE;
Filtered : Bool := FALSE;
Wait : Bool := FALSE;
Spare03 : Bool := FALSE;
Spare04 : Bool := FALSE;
Spare05 : Bool := FALSE;
Spare06 : Bool := FALSE;
Config : Bool := FALSE;
DelayOnSP : Int := 0;
DelayOffSP : Int := 0;
DelayOn : Int := 0;
DelayOff : Int := 0;
END_STRUCT;
END_VAR
BEGIN
// Data Blocks have no executable code
END_DATA_BLOCK
```

View File

@ -0,0 +1,79 @@
```pascal
// Block Type: FC
// Block Number: 61
// Original Network Languages: STL
FUNCTION "Block_compare" : Void
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR_INPUT
DB_source : Int;
DB_dest : Int;
Start_source : Int;
Start_dest : Int;
Nr_byte : Int;
END_VAR
VAR_OUTPUT
mDifference : Bool;
END_VAR
VAR_TEMP
DBNUM_Source : Word;
DBNUM_Dest : Word;
Pointer_Source : DWord;
Pointer_Dest : DWord;
Loop_Count : Int;
END_VAR
BEGIN
// Network 1: Byte Compare (Original Language: STL)
// --- BEGIN STL Network 1 ---
CLR
= "mDifference"
L "DB_source"
T "DBNUM_Source"
L "DB_dest"
T "DBNUM_Dest"
L P#0.0
L "Start_source"
SLD 3
ADD_D
T "Pointer_Source"
L P#0.0
L "Start_dest"
SLD 3
ADD_D
T "Pointer_Dest"
LAR1 "Pointer_Source"
LAR2 "Pointer_Dest"
L "Nr_byte"
m001: T "Loop_Count"
AUF DBB[AR?,P#0.0]
L DBB[AR1,P#0.0]
AUF DBB[AR?,P#0.0]
L DBB[AR2,P#0.0]
NE_I
ADDAR1 P#1.0
ADDAR2 P#1.0
JC diff
L "Loop_Count"
LOOP m001
JU end
diff: SET
= "mDifference"
end: NOP_0
// --- END STL Network 1 ---
END_FUNCTION
```

View File

@ -0,0 +1,77 @@
```pascal
// Block Type: FC
// Block Number: 60
// Original Network Languages: STL
FUNCTION "Block_move" : Void
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR_INPUT
DB_source : Int;
DB_dest : Int;
Start_source : Int;
Start_dest : Int;
Nr_byte : Int;
END_VAR
VAR_TEMP
DBNUM_Source : Word;
DBNUM_Dest : Word;
Pointer_Source : DWord;
Pointer_Dest : DWord;
mSource_Dint : DInt;
mDest_Dint : DInt;
Loop_Count : Int;
END_VAR
BEGIN
// Network 1: Byte Transfert (Original Language: STL)
// --- BEGIN STL Network 1 ---
L "Start_source"
T "mSource_Dint"
L "Start_dest"
T "mDest_Dint"
L 0
T "Loop_Count"
L "DB_source"
T "DBNUM_Source"
L "DB_dest"
T "DBNUM_Dest"
L P#0.0
L "mSource_Dint"
SLD 3
ADD_D
T "Pointer_Source"
L P#0.0
L "mDest_Dint"
SLD 3
ADD_D
T "Pointer_Dest"
LAR1 "Pointer_Source"
LAR2 "Pointer_Dest"
L "Nr_byte"
m001: T "Loop_Count"
AUF DBB[AR?,P#0.0]
L DBB[AR1,P#0.0]
AUF DBB[AR?,P#0.0]
T DBB[AR2,P#0.0]
ADDAR1 P#1.0
ADDAR2 P#1.0
L "Loop_Count"
LOOP m001
// --- END STL Network 1 ---
END_FUNCTION
```

View File

@ -0,0 +1,26 @@
```pascal
// Block Type: InstanceDB
// Block Number: 975
DATA_BLOCK "BrixTracking_Data"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR
mTakeSample : Bool := FALSE;
mTakeProdSample : Bool := FALSE;
mProdBrixSample : Int := 35;
mAuxProdBrixCorr : Real := 0.0;
mLocalProdLevel : Real := 0.1627604;
mProdBrixStat : "Statistical_Analisys";
mProdSamples : "BrixTracking_ProdSamples";
mSampleTimeCalc : "BrixTracking_SampleTime";
mAuxONS : Bool := FALSE;
mAuxONS1 : Bool := FALSE;
END_VAR
BEGIN
// Data Blocks have no executable code
END_DATA_BLOCK
```

View File

@ -0,0 +1,45 @@
```pascal
FUNCTION_BLOCK "BrixTracking_ProdSamples"
{ S7_Optimized_Access := 'FALSE' }
AUTHOR : 'Author'
FAMILY : TASK2
NAME : 'Name'
VERSION : 1.0
VAR_IN_OUT
mTakeProdSample : Bool;
END_VAR
VAR
gProductTotalizerLt : "Integral";
mProdInit : Real;
END_VAR
BEGIN
(* Calculates the product liters during blending. Every 60 Liters of product take a sample for the statistical analisys
in order to correct the product brix *)
IF "gBlenderBlending" THEN
#gProductTotalizerLt.i_NewValue := "Blender_Variables".gActual_Prod_Flow ;
#gProductTotalizerLt.i_IntCycle := "Time_250ms" ;
#gProductTotalizerLt(Out_Integral := "Blender_Variables".gProductLiters) ;
END_IF;
IF "gBlenderRinseMode" OR "gBlenderCIPMode" THEN
(* classic code: "Blender_Variables".gProductLiters := 0.0 ;*)
"Blender_Variables".gProductLiters := REAL#0.0 ;
#gProductTotalizerLt(Out_Integral := "Blender_Variables".gProductLiters) ;
END_IF;
IF ("Blender_Variables".gProductLiters - #mProdInit) > 60 THEN
#mTakeProdSample := TRUE ;
#mProdInit := "Blender_Variables".gProductLiters ;
END_IF;
END_FUNCTION_BLOCK
```

Some files were not shown because too many files have changed in this diff Show More