WAGO PLC Programming Tutorial: Complete Guide to PFC Controllers and Building Automation
Master WAGO PLC programming with this comprehensive tutorial covering PFC controllers, e!COCKPIT, BACnet, web visualization, IIoT, and building automation.
🎯 Master PLC Programming Like a Pro
Preorder our comprehensive 500+ page guide with real-world examples, step-by-step tutorials, and industry best practices. Everything you need to become a PLC programming expert.
- ✓ Complete Ladder Logic Programming Guide
- ✓ Advanced Function Block Techniques
- ✓ Real Industrial Applications & Examples
- ✓ Troubleshooting & Debugging Strategies
📋 Table of Contents
This comprehensive guide covers:
- Introduction to PLC Programming Fundamentals
- Understanding Ladder Logic Programming
- Function Block Diagrams and Structured Text
- Advanced Programming Techniques
- Real-World Application Examples
- Troubleshooting and Best Practices
- Industry Standards and Compliance
- Career Development and Certification Paths
WAGO PLC programming has become essential knowledge for building automation engineers and IIoT developers. This comprehensive tutorial guides you through programming WAGO PFC (Programmable Fieldbus Controller) systems using e!COCKPIT software, from basic ladder logic to advanced building automation integration with BACnet protocols and cloud connectivity.
Whether you're an electrical engineer transitioning to building automation, a controls specialist exploring IIoT solutions, or a systems integrator implementing energy management projects, this guide provides hands-on instruction for creating professional WAGO automation solutions. You'll master PFC controller configuration, web-based programming, building protocol integration, and modern visualization techniques.
Industry-Leading Building Automation: WAGO controllers power millions of installations worldwide in commercial buildings, renewable energy systems, water treatment facilities, and smart infrastructure, offering unique advantages in compact design, spring cage terminal technology, and integrated web visualization.
Table of Contents
- Introduction to WAGO PLC Programming
- WAGO Controller Product Lines
- e!COCKPIT Programming Software
- Ladder Logic and Structured Text Programming
- Building Automation Integration
- IIoT and Cloud Connectivity
- Web-Based Visualization
- Practical Application Example
- Best Practices for WAGO Development
- FAQ with Schema Markup
Introduction to WAGO PLC Programming
WAGO, founded in 1951 in Minden, Germany, revolutionized industrial connectivity with spring cage terminal technology and has become a leader in compact controller solutions for building automation and Industrial Internet of Things (IIoT) applications.
WAGO's Unique Position in Industrial Automation
PFC vs Traditional PLC Architecture: WAGO uses the term PFC (Programmable Fieldbus Controller) instead of traditional PLC terminology, reflecting the product's emphasis on communication capabilities and distributed system architecture. PFC controllers excel at integrating multiple industrial protocols while maintaining compact footprints ideal for space-constrained installations.
Spring Cage Terminal Technology: WAGO pioneered spring pressure connection technology, eliminating screws for faster, more reliable wiring connections. This innovation reduces installation time by up to 50% compared to screw terminals while ensuring vibration-resistant connections that maintain integrity throughout the system lifetime.
Web-Based Programming and Visualization: Unlike traditional PLCs requiring dedicated software installations, WAGO controllers offer web-based programming and visualization capabilities. This allows engineers to develop, monitor, and troubleshoot automation systems from any device with a web browser, dramatically improving accessibility and maintenance efficiency.
Why Choose WAGO for Your Projects?
Building Automation Excellence: WAGO controllers provide native BACnet/IP support, making them ideal for HVAC integration, lighting control, and energy management systems. The combination of compact design, multiple protocol support, and web visualization creates an unmatched solution for commercial building automation.
Renewable Energy Applications: Solar inverter monitoring, wind turbine control, and energy storage management benefit from WAGO's robust communication capabilities and environmental ratings. WAGO controllers operate reliably in harsh conditions while maintaining connectivity to SCADA systems and cloud platforms.
Water and Wastewater Treatment: Municipal water systems, pumping stations, and treatment facilities require distributed control with remote monitoring capabilities. WAGO's compact PFC controllers with cellular communication options and web-based HMI provide cost-effective solutions for infrastructure applications.
Industrial IoT Gateway Functionality: Modern WAGO Edge Controllers combine traditional PLC functionality with Docker container support, Node-RED integration, and cloud connectivity protocols including MQTT and OPC UA. This positions WAGO uniquely at the intersection of operational technology (OT) and information technology (IT).
What You'll Learn in This Tutorial
This comprehensive guide covers everything needed to successfully program WAGO PFC controllers:
- Controller Selection: Understanding PFC100, PFC200, Touch Panel 600, and Edge Controller capabilities and specifications
- e!COCKPIT Software: Installation, project configuration, and leveraging CODESYS V3 programming environment
- Programming Languages: Implementing ladder logic and structured text for automation applications
- Building Protocols: BACnet/IP, Modbus TCP, KNX, and DALI integration techniques
- IIoT Connectivity: MQTT, OPC UA, and cloud platform integration
- Web Visualization: Creating professional operator interfaces accessible from any browser
- Real-World Applications: Complete building energy management system implementation
By mastering these skills, you'll be prepared to tackle modern building automation and IIoT projects using WAGO's powerful platform.
WAGO Controller Product Lines
WAGO offers several PFC controller families, each optimized for specific applications and system requirements. Understanding the differences helps you select the right platform for your projects.
PFC100: Entry-Level Compact Controller
The PFC100 series provides essential PLC functionality in an ultra-compact package measuring just 62mm x 100mm x 75mm.
Key Specifications:
- Processor: 600 MHz ARM Cortex-A8
- Memory: 256 MB RAM, 512 MB Flash
- Interfaces: 2x Ethernet, 1x USB, RS-232/RS-485
- I/O Capacity: Up to 250 I/O points
- Operating Temperature: -25°C to +60°C
- Programming: e!COCKPIT with all IEC 61131-3 languages
- Price Range: $350-$500
Best Applications:
- Small machine control
- Remote monitoring stations
- Protocol gateways (Modbus to BACnet conversion)
- Compact building automation panels
Advantages: Lowest cost entry point, minimal space requirements, built-in web server for monitoring
Limitations: Reduced processing power for complex calculations, limited I/O expansion compared to PFC200
PFC200: Most Popular Modular Controller
The PFC200 series represents WAGO's mainstream controller platform, offering exceptional flexibility through modular I/O expansion and comprehensive protocol support.
Key Specifications:
- Processor: 600 MHz ARM Cortex-A8 (G2 models: 1 GHz dual-core)
- Memory: 512 MB RAM, 4 GB Flash (expandable)
- Interfaces: 2x Ethernet (some models 4x), USB, RS-232/RS-485, SD card slot
- I/O Capacity: Up to 1000 I/O points with modular expansion
- Operating Temperature: -25°C to +60°C (extended models: -40°C to +70°C)
- Programming: e!COCKPIT, web-based programming
- Price Range: $600-$1,200 (controller only)
Modular I/O System: The PFC200's greatest strength lies in its spring cage terminal I/O modules:
- Digital input modules (2, 4, 8, 16 channels)
- Digital output modules (relay, transistor, solid-state)
- Analog input modules (2, 4, 8 channels, various ranges)
- Analog output modules (2, 4 channels, voltage/current)
- Specialty modules (RTD, thermocouple, counter, PWM)
- Communication modules (Profibus, CANopen, DeviceNet)
Best Applications:
- Multi-zone HVAC systems
- Industrial machine control
- Building management systems
- Water treatment facilities
- Solar farm monitoring
Advantages: Excellent scalability, comprehensive protocol support, proven reliability, extensive I/O module selection
Touch Panel 600: Integrated HMI Controller
The Touch Panel 600 series combines PFC200 controller functionality with integrated touchscreen displays from 7" to 21.5".
Key Specifications:
- Display Sizes: 7", 10.1", 12.1", 15.6", 21.5"
- Resolution: 1280x800 (smaller models), 1920x1080 (larger models)
- Touch Technology: Projected capacitive (PCAP)
- Controller: Same PFC200 specifications
- Mounting: Panel mount or VESA mount
- Price Range: $1,500-$4,000 (varies by size)
Best Applications:
- Machine operator stations
- Building automation local panels
- Process control visualization
- Standalone control/HMI combo units
Advantages: Single device reduces wiring and cost, consistent programming environment, professional industrial displays
Considerations: Higher upfront cost than separate controller + HMI, screen replacement requires full unit replacement
Edge Controller: IIoT Gateway Platform
The WAGO Edge Controller represents the latest evolution, specifically designed for Industry 4.0 and IIoT applications.
Key Specifications:
- Processor: 1.5 GHz dual-core ARM Cortex-A9
- Memory: 1 GB RAM, 8 GB eMMC Flash
- Interfaces: 2x Ethernet, USB, HDMI, SD card slot
- Container Support: Docker for running custom applications
- Programming: e!COCKPIT + Node-RED + custom containers
- Security: TPM 2.0, secure boot, encrypted storage
- Price Range: $800-$1,200
Advanced Features:
- Docker Containers: Run Node-RED, databases, custom web applications alongside PLC logic
- Cloud Connectivity: Native MQTT, AWS IoT, Azure IoT Hub, and custom cloud platform support
- OPC UA Server/Client: Industry 4.0 standard communication
- Cybersecurity: Advanced security features meeting IEC 62443 requirements
- Remote Management: VPN, secure remote access, OTA updates
Best Applications:
- IIoT edge computing
- Predictive maintenance platforms
- Cloud-connected automation
- Data analytics at the edge
- Smart building gateway systems
Advantages: Future-proof architecture, application flexibility, strong security, cloud-native design
Controller Comparison Table
| Feature | PFC100 | PFC200 | Touch Panel 600 | Edge Controller | |---------|---------|---------|-----------------|-----------------| | CPU Speed | 600 MHz | 600 MHz - 1 GHz | 600 MHz - 1 GHz | 1.5 GHz dual-core | | RAM | 256 MB | 512 MB | 512 MB | 1 GB | | Flash Storage | 512 MB | 4 GB | 4 GB | 8 GB | | Max I/O Points | 250 | 1000 | 1000 | 1000 | | Ethernet Ports | 2 | 2-4 | 2-4 | 2 | | Display | None | None | 7"-21.5" | None (HDMI out) | | Docker Support | No | No | No | Yes | | Price Range | $350-$500 | $600-$1,200 | $1,500-$4,000 | $800-$1,200 | | Best For | Small systems | General purpose | Operator interface | IIoT applications |
Spring Cage Terminal Technology Advantages
All WAGO PFC controllers use the company's patented spring cage terminal technology:
Installation Speed: Wire stripping and insertion takes seconds compared to screw terminal preparation. Large projects can save hundreds of installation hours.
Connection Reliability: Spring pressure maintains constant contact force regardless of vibration, thermal cycling, or wire movement. This eliminates loose connections that plague screw terminals.
Wire Range Flexibility: Accept solid or stranded wire from 0.08 mm² to 4 mm² without ferrules (ferrules optional for stranded wire identification).
Maintenance Simplicity: Release tool or screwdriver push-button operation allows quick wire changes without removing adjacent wiring.
International Acceptance: UL, CSA, IEC, and other global certifications ensure worldwide project acceptance.
Price Positioning and Value Proposition
WAGO controllers typically price 15-30% lower than equivalent Siemens or Allen-Bradley solutions while offering:
- Comparable or superior processing power
- More comprehensive building automation protocol support
- Included web-based programming and visualization
- Lower installation costs through spring cage terminals
- Free e!COCKPIT programming software
This combination makes WAGO extremely competitive for building automation, renewable energy, and infrastructure projects where traditional PLC vendors may be overspecified and overpriced.
e!COCKPIT Programming Software
WAGO's e!COCKPIT programming software provides a professional development environment based on CODESYS V3, offering powerful programming capabilities with unique web-based features.
CODESYS V3 Foundation
e!COCKPIT builds on the industry-standard CODESYS programming platform, providing:
IEC 61131-3 Compliance: All five standard PLC programming languages—Ladder Logic (LD), Function Block Diagram (FBD), Structured Text (ST), Sequential Function Chart (SFC), and Instruction List (IL)—enable engineers to choose the most appropriate language for each programming task.
Hardware Independence Benefits: While e!COCKPIT targets WAGO controllers, the underlying CODESYS architecture means programs can potentially port to other CODESYS-compatible controllers with minimal modifications. Your programming knowledge transfers across multiple controller brands.
Extensive Library Support: Pre-built function block libraries for building automation (BACnet, KNX, DALI), industrial communication (Modbus, CANopen, Profibus), and mathematical operations accelerate development and reduce debugging time.
Professional Development Features: Project version control integration, team development capabilities, code refactoring tools, and advanced debugging provide enterprise-grade development capabilities.
Software Download and Installation
System Requirements:
- Windows 10 or 11 (64-bit)
- 4 GB RAM minimum (8 GB recommended)
- 2 GB available disk space
- 1280x1024 minimum screen resolution
- Ethernet network interface for controller communication
Installation Process:
-
Download e!COCKPIT: Visit www.wago.com/ecockpit and download the latest version (currently 1.11.x). The software is completely free with no license fees.
-
Run Installer: Execute the downloaded installer with administrator privileges. The installation wizard guides you through component selection.
-
Select Components:
- Core e!COCKPIT development environment (required)
- Web-Based Management visualization tools (recommended)
- Device description files for all PFC models (recommended)
- Communication driver packages (select protocols you'll use)
- Sample projects and documentation (helpful for learning)
-
Complete Installation: Installation typically takes 5-10 minutes. Launch e!COCKPIT after completion to verify successful installation.
-
First Launch Configuration: On first launch, e!COCKPIT prompts for workspace directory selection and basic preferences configuration.
Project Creation and Configuration
Creating a New WAGO Project:
Step 1: Start New Project
- Launch e!COCKPIT
- Select File → New Project
- Choose template: Standard Project (most common) or Pre-configured Application Template
- Enter project name and description
Step 2: Select Target Device
- Device catalog displays all WAGO controller models
- Select your PFC model (e.g., PFC200 750-8212)
- Software automatically configures device-specific settings
Step 3: Configure Fieldbus I/O
- Right-click PLC Configuration → Append Module
- Select I/O modules matching your physical installation
- Drag and drop modules to match physical positions
- Configure module parameters (input ranges, diagnostic settings)
Step 4: Network Configuration
- Configure Ethernet interfaces (X1, X2)
- Assign IP addresses for programming and runtime communication
- Configure gateway and subnet mask settings
Project Structure Overview:
e!COCKPIT organizes projects in a logical tree structure:
Application Tree:
- PLC_PRG: Main program organization unit (program, function blocks, variables)
- Library Manager: External library references and versioning
- Task Configuration: Cyclic, event-driven, and freewheeling task definitions
- POUs (Program Organization Units): Programs, function blocks, functions
Device Tree:
- PLC Configuration: Controller hardware configuration and I/O modules
- PLC Settings: Communication parameters, memory allocation, diagnostic settings
- Symbol Configuration: Variable mapping for external access
- Web Visualization: Built-in HMI development
IEC 61131-3 Programming Languages in e!COCKPIT
Ladder Logic (LD): Graphical programming using relay logic symbols. Best for discrete control, sequential operations, and engineers familiar with electrical schematics.
Function Block Diagram (FBD): Graphical programming using interconnected function blocks. Ideal for process control, mathematical operations, and continuous control applications.
Structured Text (ST): High-level text language similar to Pascal. Excellent for complex algorithms, mathematical calculations, and engineers with programming backgrounds.
Sequential Function Chart (SFC): High-level graphical language for sequential operations. Perfect for batch processes, machine states, and procedural operations.
Instruction List (IL): Low-level text language similar to assembly. Rarely used in modern projects but available for legacy code compatibility.
Most WAGO projects combine Ladder Logic for discrete I/O control with Structured Text for complex calculations and communication protocol handling.
Built-In Web Visualization
WAGO's Web-Based Management (WBM) provides integrated web visualization capabilities:
Automatic HMI Generation: e!COCKPIT includes a web visualization editor that generates HTML5-based operator interfaces accessible from any web browser without additional software.
Responsive Design: Web visualizations automatically adapt to desktop monitors, tablets, and smartphones, ensuring consistent operator experience across devices.
Security Integration: User authentication, role-based access control, and HTTPS encryption protect web-based HMIs from unauthorized access.
Live Variable Monitoring: View and modify controller variables directly from web browsers for commissioning, diagnostics, and operator control.
This built-in capability eliminates separate HMI software costs and simplifies system architecture, particularly valuable for building automation and remote monitoring applications.
Cloud Connectivity Setup
Modern WAGO controllers support cloud platform connectivity through multiple protocols:
MQTT Client: Configure MQTT connections to AWS IoT, Azure IoT Hub, or custom MQTT brokers directly within e!COCKPIT. No additional programming required for basic telemetry.
OPC UA Server/Client: Edge Controllers provide native OPC UA support for Industry 4.0 data exchange with MES and ERP systems.
RESTful API: Built-in web server supports custom REST APIs for integration with enterprise systems and custom applications.
Docker Integration (Edge Controller): Deploy custom containers running Node-RED, databases, or application-specific software alongside PLC logic.
Cloud connectivity transforms traditional PLCs into intelligent edge devices, enabling predictive maintenance, energy analytics, and real-time visibility into distributed assets.
Ladder Logic and Structured Text Programming
WAGO PFC programming combines traditional ladder logic for discrete control with structured text for complex operations and protocol communications.
Programming in e!COCKPIT
Creating Program Organization Units (POUs):
Right-click Application → Add Object → POU to create new programs, function blocks, or functions.
POU Types:
- Program: Main logic container, called from tasks
- Function Block: Reusable code with instance memory (maintains state between calls)
- Function: Reusable code without instance memory (pure input → output)
Best Practice: Organize complex applications using multiple POUs rather than monolithic programs. This improves code readability, testing, and reuse across projects.
Basic Ladder Logic Instructions
Standard Contact and Coil Instructions:
(Ladder Logic representation)
| Start_PB Stop_PB Motor_Run Motor_Run
|-----| |--------|\|----------| |----------------( )
| |
| Motor_Run |
|-----| |---------------------------+
Common Ladder Instructions:
- Normally Open Contact (| |): Conducts when variable is TRUE
- Normally Closed Contact (||): Conducts when variable is FALSE
- Output Coil ( ): Sets variable TRUE when energized
- Set Coil (S): Latches variable TRUE
- Reset Coil (R): Forces variable FALSE
Timer Instructions:
(Ladder Logic)
| Input_Trigger TON
|-----| |-----------------------| |
| | TON Instance |
| | IN Q |-----(Output)
| | PT:=T#5s ET |
TON (On-Delay Timer): Output turns TRUE after specified time when input TRUE TOF (Off-Delay Timer): Output turns FALSE after specified time when input FALSE TP (Pulse Timer): Output pulse for specified duration on input rising edge
Counter Instructions:
| Count_Input CTU
|-----| |---------------------| |
| | CTU Instance |
| Reset_Input | CU Q |----(Max_Reached)
|-----| |-------------------R | PV:=100 CV |
CTU (Count Up): Increments on rising edge of CU input CTD (Count Down): Decrements on rising edge of CD input CTUD (Count Up/Down): Bidirectional counter
Structured Text for Complex Logic
Structured text excels at mathematical operations, data manipulation, and communication protocol handling:
Variable Declarations:
VAR
Temperature : REAL;
Setpoint : REAL := 72.0;
HeaterOutput : REAL;
PID_Error : REAL;
Integral : REAL;
Derivative : REAL;
LastError : REAL;
(* PID Constants *)
Kp : REAL := 1.5;
Ki : REAL := 0.2;
Kd : REAL := 0.1;
END_VAR
PID Temperature Control Example:
(* Calculate PID control output *)
PID_Error := Setpoint - Temperature;
Integral := Integral + (PID_Error * 0.1); (* 0.1s scan time *)
Derivative := (PID_Error - LastError) / 0.1;
HeaterOutput := (Kp * PID_Error) + (Ki * Integral) + (Kd * Derivative);
(* Limit output to 0-100% *)
IF HeaterOutput > 100.0 THEN
HeaterOutput := 100.0;
Integral := Integral - (PID_Error * 0.1); (* Anti-windup *)
ELSIF HeaterOutput < 0.0 THEN
HeaterOutput := 0.0;
Integral := Integral - (PID_Error * 0.1);
END_IF
LastError := PID_Error;
Array Processing:
VAR
TempSensors : ARRAY[1..10] OF REAL;
AverageTemp : REAL;
MaxTemp : REAL;
MinTemp : REAL;
i : INT;
Sum : REAL;
END_VAR
(* Calculate statistics *)
Sum := 0.0;
MaxTemp := -999.0;
MinTemp := 999.0;
FOR i := 1 TO 10 DO
Sum := Sum + TempSensors[i];
IF TempSensors[i] > MaxTemp THEN
MaxTemp := TempSensors[i];
END_IF
IF TempSensors[i] < MinTemp THEN
MinTemp := TempSensors[i];
END_IF
END_FOR
AverageTemp := Sum / 10.0;
Complete Example: HVAC Control System
System Requirements:
- Control supply air temperature for multi-zone VAV system
- Monitor zone temperatures and adjust dampers
- Integrate with BACnet building management system
- Maintain optimal energy efficiency
Variable Declarations:
VAR
(* Zone Inputs *)
Zone1_Temp : REAL;
Zone2_Temp : REAL;
Zone3_Temp : REAL;
Zone4_Temp : REAL;
(* Zone Setpoints *)
Zone1_SP : REAL := 72.0;
Zone2_SP : REAL := 72.0;
Zone3_SP : REAL := 72.0;
Zone4_SP : REAL := 72.0;
(* Zone Damper Outputs *)
Zone1_Damper : REAL; (* 0-100% *)
Zone2_Damper : REAL;
Zone3_Damper : REAL;
Zone4_Damper : REAL;
(* Supply Air *)
SupplyAir_Temp : REAL;
SupplyAir_SP : REAL := 55.0;
(* Cooling Valve *)
CoolingValve_Output : REAL;
(* System Status *)
System_Enable : BOOL;
Occupied_Mode : BOOL;
END_VAR
Control Logic (Structured Text):
IF System_Enable AND Occupied_Mode THEN
(* Zone 1 Damper Control *)
IF Zone1_Temp > (Zone1_SP + 1.0) THEN
Zone1_Damper := Zone1_Damper + 5.0;
ELSIF Zone1_Temp < (Zone1_SP - 1.0) THEN
Zone1_Damper := Zone1_Damper - 5.0;
END_IF
(* Limit damper position *)
Zone1_Damper := LIMIT(20.0, Zone1_Damper, 100.0);
(* Repeat for other zones *)
IF Zone2_Temp > (Zone2_SP + 1.0) THEN
Zone2_Damper := Zone2_Damper + 5.0;
ELSIF Zone2_Temp < (Zone2_SP - 1.0) THEN
Zone2_Damper := Zone2_Damper - 5.0;
END_IF
Zone2_Damper := LIMIT(20.0, Zone2_Damper, 100.0);
(* Supply air temperature control *)
IF SupplyAir_Temp > SupplyAir_SP THEN
CoolingValve_Output := CoolingValve_Output + 2.0;
ELSIF SupplyAir_Temp < (SupplyAir_SP - 0.5) THEN
CoolingValve_Output := CoolingValve_Output - 2.0;
END_IF
CoolingValve_Output := LIMIT(0.0, CoolingValve_Output, 100.0);
ELSE
(* System disabled - close dampers *)
Zone1_Damper := 0.0;
Zone2_Damper := 0.0;
Zone3_Damper := 0.0;
Zone4_Damper := 0.0;
CoolingValve_Output := 0.0;
END_IF
BACnet Integration for Building Automation
WAGO controllers include built-in BACnet/IP protocol support through the WagoAppBACnet library.
BACnet Configuration:
- Add WagoAppBACnet library to project via Library Manager
- Instantiate BACnet device object in main program
- Map PLC variables to BACnet objects (Analog Input, Analog Output, Binary Input, Binary Output, Analog Value)
- Configure BACnet network parameters (device instance, UDP port)
Example BACnet Object Mapping:
VAR
BACnet_Device : WagoAppBACnet.BACnetDevice;
(* BACnet Analog Input Objects *)
AI_Zone1Temp : WagoAppBACnet.AnalogInput;
AI_Zone2Temp : WagoAppBACnet.AnalogInput;
(* BACnet Analog Output Objects *)
AO_Zone1Damper : WagoAppBACnet.AnalogOutput;
AO_CoolingValve : WagoAppBACnet.AnalogOutput;
(* BACnet Binary Input Objects *)
BI_SystemEnable : WagoAppBACnet.BinaryInput;
BI_OccupiedMode : WagoAppBACnet.BinaryInput;
END_VAR
(* Map variables to BACnet objects *)
AI_Zone1Temp.PresentValue := Zone1_Temp;
AI_Zone1Temp.ObjectName := 'Zone 1 Temperature';
AI_Zone1Temp.Units := 62; (* Degrees Fahrenheit *)
AO_Zone1Damper.PresentValue := Zone1_Damper;
AO_Zone1Damper.ObjectName := 'Zone 1 Damper Position';
AO_Zone1Damper.Units := 98; (* Percent *)
This BACnet integration allows building management systems to read zone temperatures, adjust setpoints, and monitor system status through standard BACnet protocols.
Memory and Variable Management
Variable Scopes:
- VAR: Local variables (function/program/function block scope)
- VAR_GLOBAL: Global variables accessible throughout project
- VAR_INPUT: Input parameters for function blocks
- VAR_OUTPUT: Output parameters for function blocks
- VAR_IN_OUT: Reference parameters (passed by reference, not value)
Persistent Variables:
WAGO controllers support persistent variables that retain values through power cycles:
VAR PERSISTENT
TotalRuntime_Hours : UDINT;
MaintenanceCounter : UINT;
LastMaintenanceDate : STRING[20];
END_VAR
Memory Optimization:
- Use appropriate data types (BOOL for binary, USINT for 0-255 values instead of INT)
- Minimize global variable usage
- Group related variables into structures
- Use function blocks for repeated code patterns
Building Automation Integration
WAGO's comprehensive building automation protocol support makes PFC controllers ideal for HVAC, lighting, and energy management applications.
BACnet/IP Native Support
BACnet (Building Automation and Control Network) is the dominant protocol in commercial building automation, and WAGO provides native BACnet/IP support without additional hardware.
BACnet/IP Advantages:
- Industry-standard protocol supported by all major building automation manufacturers
- Direct integration with Johnson Controls, Honeywell, Siemens, and Trane building management systems
- Standardized object models ensure interoperability
- UDP/IP communication eliminates dedicated fieldbus wiring
WAGO BACnet Implementation:
The WagoAppBACnet library provides comprehensive BACnet functionality:
Supported BACnet Objects:
- Analog Input (AI): Temperature sensors, pressure transducers, flow meters
- Analog Output (AO): Valve positions, damper commands, VFD speed references
- Analog Value (AV): Setpoints, calculated values, soft points
- Binary Input (BI): Status switches, alarm conditions, occupancy sensors
- Binary Output (BO): Equipment start/stop, enable/disable commands
- Binary Value (BV): Mode selections, soft binary points
- Multi-State Input/Output/Value: Equipment states, mode selections
BACnet Services Supported:
- ReadProperty / WriteProperty: Basic data access
- ReadPropertyMultiple: Efficient bulk data reads
- SubscribeCOV: Change-of-value notifications
- WhoIs / I-Am: Device discovery
- GetAlarmSummary: Alarm management
- GetEventInformation: Event notifications
Configuration Example:
VAR_GLOBAL
(* BACnet Device Configuration *)
BACnet_Device : WagoAppBACnet.FbBACnetDevice;
BACnet_DeviceID : UDINT := 123456;
BACnet_Port : UINT := 47808;
BACnet_NetworkNumber : UINT := 0;
END_VAR
(* Initialize BACnet device *)
BACnet_Device(
udiDeviceID := BACnet_DeviceID,
uiPort := BACnet_Port,
sDeviceName := 'WAGO_PFC200_Building_A',
sDescription := 'HVAC Controller - Rooftop Unit 1'
);
Modbus TCP for Equipment Integration
Modbus TCP provides simple, reliable communication with chillers, boilers, energy meters, and variable frequency drives.
WAGO Modbus TCP Implementation:
WAGO controllers support both Modbus TCP client (master) and server (slave) modes:
Modbus Client Example (Reading Energy Meter):
VAR
ModbusTCP_Client : WagoAppModbus.FbMBMasterTCP;
EnergyMeter_IP : STRING := '192.168.1.100';
EnergyMeter_Port : UINT := 502;
(* Energy meter data *)
Voltage_L1 : REAL;
Current_L1 : REAL;
ActivePower_kW : REAL;
Energy_kWh : REAL;
ReadBuffer : ARRAY[0..19] OF WORD;
END_VAR
(* Read holding registers from energy meter *)
ModbusTCP_Client(
sIPAddr := EnergyMeter_IP,
uiPort := EnergyMeter_Port,
bEnable := TRUE
);
IF ModbusTCP_Client.xReady THEN
(* Read registers 30001-30020 *)
ModbusTCP_Client.ReadHoldingRegs(
uiUnitID := 1,
uiStartAddr := 30001,
uiQuantity := 20,
pData := ADR(ReadBuffer)
);
(* Convert register data to engineering units *)
Voltage_L1 := WORD_TO_REAL(ReadBuffer[0]) * 0.1; (* 0.1V per bit *)
Current_L1 := WORD_TO_REAL(ReadBuffer[2]) * 0.01; (* 0.01A per bit *)
ActivePower_kW := WORD_TO_REAL(ReadBuffer[4]) * 0.1;
Energy_kWh := WORD_TO_REAL(ReadBuffer[10]);
END_IF
Modbus Server Example (Exposing WAGO Data):
VAR
ModbusTCP_Server : WagoAppModbus.FbMBSlaveTCP;
HoldingRegs : ARRAY[0..99] OF WORD;
CoilStatus : ARRAY[0..99] OF BOOL;
END_VAR
(* Map WAGO variables to Modbus registers *)
HoldingRegs[0] := REAL_TO_WORD(Zone1_Temp * 10.0);
HoldingRegs[1] := REAL_TO_WORD(Zone2_Temp * 10.0);
HoldingRegs[10] := REAL_TO_WORD(Zone1_Damper * 10.0);
HoldingRegs[11] := REAL_TO_WORD(Zone2_Damper * 10.0);
CoilStatus[0] := System_Enable;
CoilStatus[1] := Occupied_Mode;
(* Start Modbus TCP server *)
ModbusTCP_Server(
uiPort := 502,
bEnable := TRUE,
pHoldingRegs := ADR(HoldingRegs),
uiHoldingRegsSize := 100,
pCoils := ADR(CoilStatus),
uiCoilsSize := 100
);
KNX Building Automation
KNX is the leading protocol for residential and light commercial building automation, particularly popular in European markets.
WAGO KNX Integration:
WAGO offers KNX/IP routers and gateway functionality built into PFC controllers with the WagoAppKNX library.
KNX Applications:
- Lighting control and dimming
- Shading and blind control
- Room temperature control
- Presence and occupancy detection
- Energy monitoring
Example: KNX Lighting Control
VAR
KNX_Connection : WagoAppKNX.FbKNXConnection;
(* KNX Group Addresses *)
Light_Office1_Switch : WagoAppKNX.FbKNX_DPT_1_001; (* Boolean *)
Light_Office1_Dimmer : WagoAppKNX.FbKNX_DPT_5_001; (* 0-100% *)
Occupancy_Office1 : WagoAppKNX.FbKNX_DPT_1_001;
(* Control Logic *)
OccupancyTimer : TON;
DimLevel : BYTE;
END_VAR
(* Read occupancy sensor *)
Occupancy_Office1.Read();
IF Occupancy_Office1.Value THEN
(* Occupancy detected - turn on lights *)
Light_Office1_Switch.Value := TRUE;
Light_Office1_Switch.Write();
DimLevel := 255; (* 100% brightness *)
Light_Office1_Dimmer.Value := DimLevel;
Light_Office1_Dimmer.Write();
(* Reset vacancy timer *)
OccupancyTimer(IN := FALSE);
ELSE
(* Start vacancy timer *)
OccupancyTimer(IN := TRUE, PT := T#10m);
IF OccupancyTimer.Q THEN
(* 10 minutes vacancy - turn off lights *)
Light_Office1_Switch.Value := FALSE;
Light_Office1_Switch.Write();
END_IF
END_IF
DALI Lighting Control
DALI (Digital Addressable Lighting Interface) provides advanced lighting control with dimming, color tuning, and individual fixture addressing.
WAGO DALI Integration:
WAGO offers DALI master modules (750-641) that interface directly with the PFC200 I/O system.
DALI Capabilities:
- Individual addressing of up to 64 DALI ballasts/drivers
- 0-100% dimming control
- Color temperature adjustment (tunable white)
- Status feedback and lamp failure detection
- Scene programming and recall
Example: DALI Scene Control
VAR
DALI_Master : WagoAppDALI.FbDALIMaster;
(* Scene selections *)
Scene_Meeting : BOOL;
Scene_Presentation : BOOL;
Scene_Cleaning : BOOL;
Scene_Energy : BOOL;
END_VAR
(* Scene 1: Meeting mode - 80% brightness *)
IF Scene_Meeting AND NOT Scene_Presentation THEN
DALI_Master.RecallScene(SceneNumber := 1);
END_IF
(* Scene 2: Presentation mode - 30% brightness *)
IF Scene_Presentation THEN
DALI_Master.RecallScene(SceneNumber := 2);
END_IF
(* Scene 3: Cleaning mode - 100% brightness *)
IF Scene_Cleaning THEN
DALI_Master.RecallScene(SceneNumber := 3);
END_IF
(* Scene 4: Energy saving mode - 50% brightness *)
IF Scene_Energy THEN
DALI_Master.RecallScene(SceneNumber := 4);
END_IF
LON Integration
LON (Local Operating Network) supports legacy building automation systems, particularly in North American installations.
WAGO provides LON interface modules for integration with existing LON networks, enabling gradual system modernization while maintaining compatibility with installed LON field devices.
Complete Example: Multi-Zone HVAC with BACnet
System Architecture:
- 4-zone VAV system with zone temperature sensors
- BACnet/IP integration with building management system
- Supply air temperature control
- Economizer control based on outdoor air temperature
- Demand-based ventilation
Complete Program Structure:
PROGRAM HVAC_Main
VAR
(* Zone Variables - exposed via BACnet *)
Zone_Temps : ARRAY[1..4] OF REAL;
Zone_Setpoints : ARRAY[1..4] OF REAL := [72.0, 72.0, 72.0, 72.0];
Zone_Dampers : ARRAY[1..4] OF REAL;
(* Air Handling Unit *)
Supply_Temp : REAL;
Supply_SP : REAL := 55.0;
Return_Temp : REAL;
Outdoor_Temp : REAL;
Mixed_Temp : REAL;
(* Equipment *)
Supply_Fan : BOOL;
Cooling_Valve : REAL;
OA_Damper : REAL;
RA_Damper : REAL;
EA_Damper : REAL;
(* System Control *)
System_Mode : INT; (* 0=Off, 1=Heat, 2=Cool, 3=Auto *)
Occupied : BOOL;
Economizer_Enable : BOOL;
(* BACnet Integration *)
BACnet : WagoAppBACnet.FbBACnetDevice;
BACnet_AI : ARRAY[1..20] OF WagoAppBACnet.FbAnalogInput;
BACnet_AO : ARRAY[1..10] OF WagoAppBACnet.FbAnalogOutput;
BACnet_BI : ARRAY[1..10] OF WagoAppBACnet.FbBinaryInput;
BACnet_BO : ARRAY[1..10] OF WagoAppBACnet.FbBinaryOutput;
i : INT;
END_VAR
(* Main Control Logic *)
(* Read analog inputs *)
Zone_Temps[1] := AI_Zone1_Temp; (* Mapped to physical I/O *)
Zone_Temps[2] := AI_Zone2_Temp;
Zone_Temps[3] := AI_Zone3_Temp;
Zone_Temps[4] := AI_Zone4_Temp;
Supply_Temp := AI_Supply_Temp;
Return_Temp := AI_Return_Temp;
Outdoor_Temp := AI_Outdoor_Temp;
(* System enable logic *)
IF System_Mode > 0 AND Occupied THEN
Supply_Fan := TRUE;
(* Zone damper control *)
FOR i := 1 TO 4 DO
IF Zone_Temps[i] > (Zone_Setpoints[i] + 1.0) THEN
Zone_Dampers[i] := LIMIT(20.0, Zone_Dampers[i] + 5.0, 100.0);
ELSIF Zone_Temps[i] < (Zone_Setpoints[i] - 1.0) THEN
Zone_Dampers[i] := LIMIT(20.0, Zone_Dampers[i] - 5.0, 100.0);
END_IF
END_FOR
(* Economizer control *)
IF Economizer_Enable AND (Outdoor_Temp < 65.0) AND (Outdoor_Temp < Return_Temp) THEN
(* Free cooling available *)
OA_Damper := LIMIT(20.0, (Supply_SP - Mixed_Temp) * 10.0, 100.0);
RA_Damper := 100.0 - OA_Damper;
EA_Damper := OA_Damper;
Cooling_Valve := 0.0;
ELSE
(* Mechanical cooling *)
OA_Damper := 20.0; (* Minimum outside air *)
RA_Damper := 80.0;
EA_Damper := 20.0;
IF Supply_Temp > Supply_SP THEN
Cooling_Valve := LIMIT(0.0, Cooling_Valve + 2.0, 100.0);
ELSIF Supply_Temp < (Supply_SP - 0.5) THEN
Cooling_Valve := LIMIT(0.0, Cooling_Valve - 2.0, 100.0);
END_IF
END_IF
ELSE
(* System off *)
Supply_Fan := FALSE;
Zone_Dampers[1] := 0.0;
Zone_Dampers[2] := 0.0;
Zone_Dampers[3] := 0.0;
Zone_Dampers[4] := 0.0;
Cooling_Valve := 0.0;
OA_Damper := 0.0;
RA_Damper := 100.0;
EA_Damper := 0.0;
END_IF
(* Write outputs to physical I/O *)
DO_Supply_Fan := Supply_Fan;
AO_Zone1_Damper := Zone_Dampers[1];
AO_Zone2_Damper := Zone_Dampers[2];
AO_Zone3_Damper := Zone_Dampers[3];
AO_Zone4_Damper := Zone_Dampers[4];
AO_Cooling_Valve := Cooling_Valve;
AO_OA_Damper := OA_Damper;
AO_RA_Damper := RA_Damper;
AO_EA_Damper := EA_Damper;
(* BACnet object mapping *)
FOR i := 1 TO 4 DO
BACnet_AI[i](
PresentValue := Zone_Temps[i],
ObjectName := CONCAT('Zone ', INT_TO_STRING(i), ' Temperature'),
Units := 62 (* Degrees Fahrenheit *)
);
BACnet_AO[i](
PresentValue := Zone_Dampers[i],
ObjectName := CONCAT('Zone ', INT_TO_STRING(i), ' Damper'),
Units := 98 (* Percent *)
);
END_FOR
BACnet_AI[5](PresentValue := Supply_Temp, ObjectName := 'Supply Air Temp');
BACnet_AI[6](PresentValue := Return_Temp, ObjectName := 'Return Air Temp');
BACnet_AI[7](PresentValue := Outdoor_Temp, ObjectName := 'Outdoor Air Temp');
BACnet_AO[5](PresentValue := Cooling_Valve, ObjectName := 'Cooling Valve Position');
BACnet_AO[6](PresentValue := OA_Damper, ObjectName := 'Outside Air Damper');
BACnet_BO[1](PresentValue := Supply_Fan, ObjectName := 'Supply Fan Status');
END_PROGRAM
This comprehensive example demonstrates WAGO's strength in building automation: seamless integration of control logic with industry-standard protocols, enabling complete system visibility and control through BACnet building management systems.
IIoT and Cloud Connectivity
Modern WAGO controllers transform traditional PLCs into intelligent edge devices with cloud connectivity, enabling predictive maintenance, energy analytics, and remote monitoring.
MQTT for Cloud Communication
MQTT (Message Queuing Telemetry Transport) provides lightweight, publish-subscribe messaging ideal for IoT applications.
WAGO MQTT Implementation:
The WagoAppMQTT library enables MQTT client functionality:
MQTT Broker Connections:
- AWS IoT Core
- Azure IoT Hub
- Google Cloud IoT
- Eclipse Mosquitto
- HiveMQ
- Custom MQTT brokers
Example: Publishing Sensor Data to AWS IoT:
VAR
MQTT_Client : WagoAppMQTT.FbMQTTClient;
(* AWS IoT Configuration *)
Broker_Address : STRING := 'your-endpoint.iot.us-east-1.amazonaws.com';
Broker_Port : UINT := 8883;
Client_ID : STRING := 'WAGO_PFC200_Building_A';
(* Publish Topics *)
Topic_Temperature : STRING := 'building/hvac/temperature';
Topic_Energy : STRING := 'building/energy/consumption';
(* Data Buffers *)
JSON_Buffer : STRING(500);
(* Timing *)
PublishTimer : TON;
END_VAR
(* Connect to MQTT broker *)
MQTT_Client(
sBrokerAddress := Broker_Address,
uiPort := Broker_Port,
sClientID := Client_ID,
bUseTLS := TRUE,
bEnable := TRUE
);
(* Publish data every 60 seconds *)
PublishTimer(IN := TRUE, PT := T#60s);
IF PublishTimer.Q THEN
PublishTimer(IN := FALSE);
(* Build JSON payload *)
JSON_Buffer := CONCAT('{',
'"timestamp": "', GetCurrentDateTime(), '",',
'"zone1_temp": ', REAL_TO_STRING(Zone1_Temp), ',',
'"zone2_temp": ', REAL_TO_STRING(Zone2_Temp), ',',
'"zone3_temp": ', REAL_TO_STRING(Zone3_Temp), ',',
'"zone4_temp": ', REAL_TO_STRING(Zone4_Temp), ',',
'"supply_temp": ', REAL_TO_STRING(Supply_Temp), ',',
'"outdoor_temp": ', REAL_TO_STRING(Outdoor_Temp),
'}');
(* Publish to AWS IoT *)
MQTT_Client.Publish(
sTopic := Topic_Temperature,
sPayload := JSON_Buffer,
uiQoS := 1
);
END_IF
Subscribing to Cloud Commands:
VAR
Subscribe_Topic : STRING := 'building/hvac/commands';
Received_Command : STRING(200);
END_VAR
(* Subscribe to command topic *)
MQTT_Client.Subscribe(
sTopic := Subscribe_Topic,
uiQoS := 1
);
(* Process received commands *)
IF MQTT_Client.xNewMessage THEN
Received_Command := MQTT_Client.sReceivedPayload;
(* Parse JSON command *)
IF FIND(Received_Command, 'setpoint') > 0 THEN
(* Extract and apply new setpoint *)
Zone1_SP := ParseJSONReal(Received_Command, 'zone1_setpoint');
Zone2_SP := ParseJSONReal(Received_Command, 'zone2_setpoint');
END_IF
IF FIND(Received_Command, 'mode') > 0 THEN
(* Change system mode *)
System_Mode := ParseJSONInt(Received_Command, 'system_mode');
END_IF
END_IF
OPC UA for Industry 4.0
OPC UA (Open Platform Communications Unified Architecture) provides secure, reliable industrial communication for MES and ERP integration.
WAGO OPC UA Server:
WAGO Edge Controllers include built-in OPC UA server functionality:
OPC UA Features:
- Secure communication with encryption and authentication
- Information modeling for structured data
- Publisher-subscriber architecture
- Platform-independent (works with Windows, Linux, embedded systems)
- Vendor-neutral standard
Configuration:
- Enable OPC UA server in PLC settings
- Configure security policies (None, Basic128, Basic256)
- Create user accounts and permissions
- Map PLC variables to OPC UA address space
Variable Mapping:
VAR_GLOBAL
{attribute 'OPC.UA.DA' := '1'}
Zone1_Temperature : REAL;
{attribute 'OPC.UA.DA' := '1'}
Zone1_Setpoint : REAL;
{attribute 'OPC.UA.DA.Access' := 'RW'}
System_Enable : BOOL;
END_VAR
The OPC.UA.DA attribute exposes variables through the OPC UA server, enabling SCADA systems, historians, and analytics platforms to access real-time PLC data.
Docker Container Support
WAGO Edge Controllers support Docker containers, enabling custom applications to run alongside PLC logic:
Container Applications:
- Node-RED: Visual programming for IoT data flows
- InfluxDB: Time-series database for sensor data
- Grafana: Data visualization dashboards
- Custom Applications: Python, Node.js, Go applications
Example: Node-RED for Data Processing
Deploy Node-RED container on Edge Controller:
- Access WAGO Web-Based Management
- Navigate to Docker Container Management
- Pull Node-RED image from Docker Hub
- Configure container networking
- Start container and access Node-RED interface
Node-RED flows can:
- Read PLC variables via Modbus TCP
- Process and aggregate data
- Publish to cloud platforms
- Implement custom business logic
- Generate reports and notifications
Architecture Benefits:
Traditional PLC logic handles real-time control while containers handle:
- Complex data analytics
- Machine learning inference
- Web dashboards and APIs
- Database management
- Cloud integration
This separation optimizes each component for its specific purpose while maintaining real-time determinism in safety-critical control functions.
Web-Based HMI (Built-In)
WAGO's Web-Based Management provides integrated web HMI without additional software:
Key Features:
- HTML5-based responsive design
- Access from any browser (Chrome, Firefox, Safari, Edge)
- Mobile-friendly tablet and smartphone interfaces
- Built-in security with user authentication
- HTTPS encryption for secure remote access
Creating Web Visualizations:
e!COCKPIT includes integrated web visualization editor:
- Add Web Visualization object to project
- Design screens using drag-and-drop interface
- Link screen elements to PLC variables
- Configure user access levels
- Build and download to controller
Web HMI Elements:
- Gauges and meters
- Trend charts
- Buttons and switches
- Numeric inputs
- Status indicators
- Navigation menus
- Alarm displays
Example: Energy Monitoring Dashboard
(Web Visualization configuration)
Screen: Energy_Dashboard
Elements:
- Trend Chart: "Building Power Consumption (kW)" → ActivePower_kW
- Gauge: "Current Load" → Current_L1
- Numeric Display: "Today's Energy (kWh)" → DailyEnergy_kWh
- Bar Chart: "Zone Temperatures" → Zone1_Temp, Zone2_Temp, Zone3_Temp, Zone4_Temp
- Button: "Export Report" → Trigger_Export
Access dashboard via browser: http://192.168.1.100/webvisu.htm
This eliminates dedicated HMI hardware and software costs while providing professional visualization accessible from anywhere on the network or internet (with proper security configuration).
Example: Energy Monitoring with Cloud Dashboard
Complete System Architecture:
Local Control Layer (WAGO PFC200):
- Read power meter data via Modbus TCP
- Calculate energy consumption, demand, power factor
- Control loads based on demand response signals
- Store historical data locally
Edge Processing Layer (Docker Containers):
- InfluxDB time-series database
- Grafana visualization dashboards
- Data aggregation and analysis
Cloud Layer (AWS IoT):
- Long-term data storage
- Advanced analytics
- Mobile notifications
- Remote monitoring
Implementation:
VAR
(* Energy Meter Communication *)
EnergyMeter : Modbus_TCP_Client;
(* Measured Values *)
Voltage : ARRAY[1..3] OF REAL;
Current : ARRAY[1..3] OF REAL;
ActivePower_kW : REAL;
ReactivePower_kVAR : REAL;
PowerFactor : REAL;
Energy_kWh : REAL;
DailyEnergy_kWh : REAL;
(* Demand Response *)
PeakDemand_Threshold : REAL := 500.0; (* kW *)
NonCritical_Loads : ARRAY[1..5] OF BOOL;
LoadShedding_Active : BOOL;
(* Cloud Publishing *)
MQTT : WagoAppMQTT.FbMQTTClient;
PublishTimer : TON;
JSON_Payload : STRING(1000);
(* Local Database *)
InfluxDB_Write : HTTP_Client;
END_VAR
(* Read energy meter data via Modbus TCP *)
EnergyMeter.ReadMultipleRegisters(
StartAddress := 30001,
Quantity := 20
);
(* Process meter data *)
Voltage[1] := MeterRegisters[0] * 0.1;
Voltage[2] := MeterRegisters[1] * 0.1;
Voltage[3] := MeterRegisters[2] * 0.1;
Current[1] := MeterRegisters[3] * 0.01;
Current[2] := MeterRegisters[4] * 0.01;
Current[3] := MeterRegisters[5] * 0.01;
ActivePower_kW := MeterRegisters[10] * 0.1;
ReactivePower_kVAR := MeterRegisters[11] * 0.1;
PowerFactor := MeterRegisters[12] * 0.001;
Energy_kWh := MeterRegisters[15];
(* Demand response logic *)
IF ActivePower_kW > PeakDemand_Threshold THEN
LoadShedding_Active := TRUE;
(* Shed non-critical loads *)
NonCritical_Loads[1] := FALSE; (* Office lighting *)
NonCritical_Loads[2] := FALSE; (* Break room equipment *)
NonCritical_Loads[3] := FALSE; (* Non-essential HVAC *)
ELSIF ActivePower_kW < (PeakDemand_Threshold * 0.8) THEN
LoadShedding_Active := FALSE;
(* Restore loads *)
NonCritical_Loads[1] := TRUE;
NonCritical_Loads[2] := TRUE;
NonCritical_Loads[3] := TRUE;
END_IF
(* Write to local InfluxDB (running in Docker container) *)
InfluxDB_Write.POST(
URL := 'http://localhost:8086/write?db=energy',
Data := CONCAT(
'power,location=building_a ',
'active_kw=', REAL_TO_STRING(ActivePower_kW), ',',
'reactive_kvar=', REAL_TO_STRING(ReactivePower_kVAR), ',',
'pf=', REAL_TO_STRING(PowerFactor)
)
);
(* Publish to cloud every 5 minutes *)
PublishTimer(IN := TRUE, PT := T#5m);
IF PublishTimer.Q THEN
PublishTimer(IN := FALSE);
JSON_Payload := CONCAT('{',
'"timestamp": "', GetISODateTime(), '",',
'"active_power_kw": ', REAL_TO_STRING(ActivePower_kW), ',',
'"reactive_power_kvar": ', REAL_TO_STRING(ReactivePower_kVAR), ',',
'"power_factor": ', REAL_TO_STRING(PowerFactor), ',',
'"energy_kwh": ', REAL_TO_STRING(Energy_kWh), ',',
'"load_shedding": ', BOOL_TO_STRING(LoadShedding_Active),
'}');
MQTT.Publish(
Topic := 'building/energy/realtime',
Payload := JSON_Payload,
QoS := 1
);
END_IF
Cloud Dashboard Features:
- Real-time power consumption monitoring
- Historical energy usage trends
- Demand response event logging
- Cost analysis and forecasting
- Mobile app notifications for peak demand events
- Comparison across multiple buildings
This architecture demonstrates WAGO's IIoT capabilities: local real-time control, edge data processing, and cloud connectivity for enterprise visibility.
Web-Based Visualization
WAGO's built-in web server and Web-Based Management provide professional visualization without additional HMI software or hardware.
Built-In Web Server Capabilities
Every WAGO PFC controller includes an embedded web server offering:
Configuration Interface: Web-based controller configuration eliminates dedicated software requirements Diagnostic Tools: Real-time I/O monitoring, network diagnostics, system logs Firmware Updates: Upload new firmware directly through browser File Management: Upload/download programs, configuration files, data logs User Management: Configure authentication and access control
Access Methods:
- Direct IP address:
http://192.168.1.100 - Hostname:
http://pfc200-building-a.local - HTTPS with self-signed or custom certificates
Web Visu Editor in e!COCKPIT
The integrated Web Visualization editor creates HTML5 HMIs without HTML/JavaScript programming:
Development Workflow:
-
Add Visualization Object
- Right-click Application → Add Object → Visualization
- Name visualization (e.g., "Main_Screen")
-
Design Interface
- Drag elements from toolbox (buttons, displays, charts)
- Arrange layout using grid snap
- Configure element properties
-
Link to Variables
- Select element
- Configure "Text Variable" or "Toggle Variable"
- Link to PLC variables
-
Build Project
- Compile visualization with PLC program
- Download to controller
- Access via web browser
Available Elements:
- Rectangles/Circles: Status indicators, background shapes
- Text Fields: Display values, labels
- Buttons: Operator commands, mode selection
- Switches: Toggle controls
- Gauges: Analog displays, pressure, temperature
- Trend Charts: Historical data visualization
- Bar Graphs: Multi-value comparison
- Images: Import PNG/SVG graphics for equipment representation
Creating Professional Operator Interfaces
Design Best Practices:
Visual Hierarchy: Use size and color to emphasize critical information
- Large fonts (18-24pt) for primary values
- Color coding (green=normal, yellow=warning, red=alarm)
- Consistent positioning across screens
Responsive Layout: Design for multiple screen sizes
- Tablet landscape (1024x768)
- Desktop monitors (1920x1080)
- Smartphone portrait (portrait mode limited for complex HMIs)
Navigation Structure:
- Main overview screen
- Detail screens for subsystems
- Consistent navigation menu/buttons
- Breadcrumb navigation for complex systems
Example: HVAC System Interface
Main Screen Layout:
Header: "Building A - Rooftop Unit 1"
[System Status] [Alarms] [Trends] [Settings]
Zone Status:
┌─────────────────────────────────────────┐
│ Zone 1: Office Area │
│ Temperature: 72.3°F Setpoint: 72.0°F │
│ Damper: ████████░░ 80% │
│ Status: [COOLING] │
└─────────────────────────────────────────┘
(Repeat for Zones 2-4)
Equipment Status:
[Supply Fan: ON] [Cooling Valve: 45%]
[OA Damper: 25%] [Economizer: OFF]
Quick Controls:
[Occupied Mode] [System Enable]
Variable Assignments:
- Zone 1 Temperature → Zone1_Temp (display only)
- Zone 1 Setpoint → Zone1_SP (adjustable numeric input)
- Damper Position → Zone1_Damper (bar graph)
- Supply Fan → Supply_Fan (button with status color)
- System Enable → System_Enable (toggle switch)
Responsive Design for Mobile Access
Mobile Optimization:
Separate Mobile View: Create dedicated smartphone layout
- Simplified single-column layout
- Larger touch targets (minimum 44x44 pixels)
- Critical information only
- Landscape orientation recommended
Touch-Friendly Controls:
- Button size: 50x50 pixels minimum
- Adequate spacing between buttons (10+ pixels)
- Avoid hover-only interactions
- Use simple gestures (tap, not complex swipes)
Bandwidth Consideration:
- Minimize graphic complexity
- Reduce update frequency for cellular connections
- Compress images
- Lazy-load non-critical screens
Remote Access and Monitoring
Secure Remote Access Methods:
VPN Connection:
- Establish VPN tunnel to facility network
- Access web HMI through encrypted connection
- Firewall protects controller from internet exposure
- Recommended for long-term remote monitoring
Port Forwarding with Authentication:
- Forward HTTPS port 443 to controller
- Require strong username/password
- Consider IP whitelisting
- Enable HTTPS with valid certificate
- Monitor access logs
WAGO Cloud Services:
- Secure cloud proxy service
- No VPN configuration required
- Access via cloud.wago.com portal
- Subscription-based service
Security Best Practices:
- Change default passwords immediately
- Use HTTPS (SSL/TLS) for all remote access
- Implement user role-based permissions
- Enable audit logging
- Regular firmware updates
- Network segmentation (separate OT and IT networks)
Complete Web HMI Example: Building Energy Dashboard
Dashboard Requirements:
- Real-time energy consumption display
- Historical trend charts
- Zone temperature monitoring
- Equipment status indicators
- Demand response controls
- Mobile-accessible design
Screen Structure:
Overview Page (index.htm):
Building Energy Management System
Current Status:
┌─────────────────────────────────────────┐
│ Total Power: 487 kW │
│ Today's Energy: 3,245 kWh │
│ Power Factor: 0.94 │
│ Peak Demand: 523 kW (2:15 PM) │
└─────────────────────────────────────────┘
Power Consumption (Last 24 Hours):
[Interactive Trend Chart]
Zone Temperatures:
Zone 1: 72°F ████████████░░ 85% demand
Zone 2: 71°F ██████████░░░░ 70% demand
Zone 3: 73°F ██████████████ 95% demand
Zone 4: 72°F ███████████░░░ 78% demand
Demand Response:
[Load Shedding: INACTIVE]
[Manual Override] [Settings]
Trend Chart Configuration:
- X-axis: Time (0-24 hours)
- Y-axis: Power (kW)
- Update interval: 60 seconds
- Data source: ActivePower_kW variable
- Color: Blue line, yellow alert threshold, red peak threshold
Variable Bindings:
Total_Power → Text display with unit "kW"
DailyEnergy_kWh → Text display with unit "kWh"
PowerFactor → Text display with decimal format "0.00"
PeakDemand_kW → Text display with timestamp
Zone1_Temp → Gauge element (60-80°F range)
Zone1_Damper → Bar graph (0-100%)
LoadShedding_Active → Status indicator (red=active, green=inactive)
Manual_Override → Toggle button
Responsive Breakpoints:
- Desktop (>1200px): Full dashboard with all charts
- Tablet (768-1200px): Simplified layout, smaller charts
- Mobile (<768px): Single column, critical values only, accordion sections
Access URL:
https://building-controller.company.com/webvisu.htm
This professional web HMI provides building operators complete system visibility from any device without specialized HMI software, reducing costs while improving accessibility.
Practical Application Example: Building Energy Management System
This comprehensive example demonstrates a complete WAGO PFC200 installation for commercial building energy management.
System Overview
Project Requirements:
- 50,000 sq ft office building
- 4-zone VAV HVAC system
- Energy monitoring and demand response
- BACnet integration with existing building management system
- Web-based monitoring for facilities team
- Cloud data logging for corporate energy reporting
Hardware Configuration:
WAGO PFC200 Controller (750-8212):
- 2x Ethernet interfaces
- 512 MB RAM, 4 GB Flash
- SD card for data logging
I/O Modules:
- 750-430: 8-channel analog input (0-10V) - zone temperature sensors
- 750-432: 4-channel analog input (4-20mA) - pressure transmitters
- 750-530: 4-channel analog output (0-10V) - damper actuators
- 750-504: 4-channel analog output (4-20mA) - valve actuators
- 750-1405: 16-channel digital input (24V DC) - status switches
- 750-1504: 16-channel digital output (24V DC) - equipment control
- 750-652: Modbus TCP module - energy meter communication
- End module: 750-600
Field Devices:
- Temperature sensors: 4x zone, 1x supply air, 1x return air, 1x outdoor air
- Pressure transmitters: 2x duct static pressure
- Damper actuators: 4x zone VAV, 1x outside air, 1x return air, 1x exhaust
- Valve actuators: 1x cooling valve, 1x heating valve
- VFD: Supply fan variable frequency drive (Modbus TCP)
- Energy meter: Schneider PM5560 (Modbus TCP)
- BACnet BMS: Tridium Niagara system
PFC200 with I/O Module Configuration
Physical Installation:
- Mount PFC200 on DIN rail in electrical panel
- Install I/O modules in sequence matching program configuration
- Connect spring cage terminals:
- Power supply: 24V DC to controller and I/O modules
- Ethernet X1: Building network (BACnet, Modbus TCP devices)
- Ethernet X2: Programming/maintenance network
- Wire field devices to appropriate I/O modules
- Apply labels matching program variable names
e!COCKPIT I/O Configuration:
PFC200 750-8212
├── 750-430 (Analog Input 8ch)
│ ├── Channel 1: Zone1_Temp (0-10V = 50-90°F)
│ ├── Channel 2: Zone2_Temp (0-10V = 50-90°F)
│ ├── Channel 3: Zone3_Temp (0-10V = 50-90°F)
│ ├── Channel 4: Zone4_Temp (0-10V = 50-90°F)
│ ├── Channel 5: Supply_Temp (0-10V = 40-70°F)
│ ├── Channel 6: Return_Temp (0-10V = 50-90°F)
│ ├── Channel 7: Outdoor_Temp (0-10V = -20-120°F)
│ └── Channel 8: Mixed_Temp (0-10V = 40-80°F)
├── 750-432 (Analog Input 4ch)
│ ├── Channel 1: Supply_Pressure (4-20mA = 0-2"WC)
│ └── Channel 2: Return_Pressure (4-20mA = 0-2"WC)
├── 750-530 (Analog Output 4ch)
│ ├── Channel 1: Zone1_Damper_Cmd (0-10V = 0-100%)
│ ├── Channel 2: Zone2_Damper_Cmd (0-10V = 0-100%)
│ ├── Channel 3: Zone3_Damper_Cmd (0-10V = 0-100%)
│ └── Channel 4: Zone4_Damper_Cmd (0-10V = 0-100%)
├── 750-504 (Analog Output 4ch)
│ ├── Channel 1: Cooling_Valve_Cmd (4-20mA = 0-100%)
│ ├── Channel 2: OA_Damper_Cmd (4-20mA = 0-100%)
│ ├── Channel 3: RA_Damper_Cmd (4-20mA = 0-100%)
│ └── Channel 4: EA_Damper_Cmd (4-20mA = 0-100%)
├── 750-1405 (Digital Input 16ch)
│ ├── Input 1: Supply_Fan_Status
│ ├── Input 2: Supply_Fan_Fault
│ ├── Input 3: Smoke_Detector
│ ├── Input 4: Freeze_Stat
│ └── Inputs 5-16: Reserved
├── 750-1504 (Digital Output 16ch)
│ ├── Output 1: Supply_Fan_Start
│ ├── Output 2: Alarm_Horn
│ └── Outputs 3-16: Reserved
└── 750-600 (End Module)
BACnet Device Integration
BACnet Network Configuration:
Network: Building IP network (192.168.100.0/24) WAGO IP: 192.168.100.50 BACnet Port: 47808 (default) Device Instance: 123456
BACnet Object Configuration:
VAR_GLOBAL
(* BACnet Device *)
BACnet_Device : WagoAppBACnet.FbBACnetDevice;
(* Analog Inputs - Sensors *)
BAC_AI : ARRAY[1..10] OF WagoAppBACnet.FbAnalogInput;
(* Analog Outputs - Control Commands *)
BAC_AO : ARRAY[1..10] OF WagoAppBACnet.FbAnalogOutput;
(* Analog Values - Setpoints *)
BAC_AV : ARRAY[1..10] OF WagoAppBACnet.FbAnalogValue;
(* Binary Inputs - Status *)
BAC_BI : ARRAY[1..10] OF WagoAppBACnet.FbBinaryInput;
(* Binary Outputs - Equipment *)
BAC_BO : ARRAY[1..5] OF WagoAppBACnet.FbBinaryOutput;
END_VAR
(* Initialize BACnet Device *)
BACnet_Device(
udiDeviceID := 123456,
sDeviceName := 'WAGO_RTU_1',
sModelName := 'PFC200',
sDescription := 'Office Building Rooftop Unit 1',
sLocation := '123 Main Street'
);
(* Configure Analog Inputs *)
BAC_AI[1](
udiObjectID := 1,
sObjectName := 'Zone 1 Temperature',
PresentValue := Zone1_Temp,
uiUnits := 62, (* Degrees Fahrenheit *)
sDescription := 'Open Office Area Temperature'
);
BAC_AI[2](
udiObjectID := 2,
sObjectName := 'Zone 2 Temperature',
PresentValue := Zone2_Temp,
uiUnits := 62
);
(* Continue for all sensors... *)
(* Configure Analog Outputs *)
BAC_AO[1](
udiObjectID := 1,
sObjectName := 'Zone 1 Damper Command',
PresentValue := Zone1_Damper,
uiUnits := 98 (* Percent *)
);
(* Configure Analog Values - Setpoints *)
BAC_AV[1](
udiObjectID := 1,
sObjectName := 'Zone 1 Setpoint',
PresentValue := Zone1_SP,
uiUnits := 62
);
(* Allow BMS to write setpoints *)
IF BAC_AV[1].xWritten THEN
Zone1_SP := BAC_AV[1].PresentValue;
END_IF
(* Configure Binary Outputs *)
BAC_BO[1](
udiObjectID := 1,
sObjectName := 'Supply Fan Command',
PresentValue := Supply_Fan_Cmd
);
IF BAC_BO[1].xWritten THEN
Supply_Fan_Cmd := BAC_BO[1].PresentValue;
END_IF
This BACnet configuration allows the Tridium Niagara building management system to:
- Monitor all zone temperatures and equipment status
- Adjust zone temperature setpoints
- Override equipment operation
- Collect trend data
- Generate alarms and notifications
Web-Based Monitoring Interface
Visualization Pages:
Page 1: System Overview
- Current operating mode
- All zone temperatures and setpoints
- Equipment run status
- Active alarms
- Energy consumption summary
Page 2: Zone Details
- Individual zone temperature trends
- Damper positions
- Airflow rates
- Heating/cooling demand
Page 3: Equipment Status
- Supply fan speed and status
- Cooling valve position
- Economizer damper positions
- Filter status and differential pressure
Page 4: Energy Dashboard
- Real-time power consumption
- Daily/weekly/monthly energy totals
- Demand trending
- Cost calculations
Page 5: Diagnostics
- I/O status
- Communication status (BACnet, Modbus)
- Alarm history
- System logs
User Access Levels:
- Viewer: Read-only access to all screens
- Operator: Adjust setpoints, acknowledge alarms
- Engineer: Full access including equipment override
- Administrator: System configuration and user management
Cloud Data Logging Implementation
MQTT Configuration for AWS IoT:
VAR
(* AWS IoT Configuration *)
MQTT_Client : WagoAppMQTT.FbMQTTClient;
AWS_Endpoint : STRING := 'a3k7m2n8l9p4qr-ats.iot.us-east-1.amazonaws.com';
AWS_Port : UINT := 8883;
Thing_Name : STRING := 'Building_A_RTU_1';
(* Publishing *)
Pub_Timer : TON;
Pub_Interval : TIME := T#5m;
(* Data Structure *)
CloudData : STRING(2000);
END_VAR
(* Connect to AWS IoT Core *)
MQTT_Client(
sBrokerAddress := AWS_Endpoint,
uiPort := AWS_Port,
sClientID := Thing_Name,
bUseTLS := TRUE,
sCertFile := '/etc/ssl/device-cert.pem',
sKeyFile := '/etc/ssl/device-key.pem',
sCACertFile := '/etc/ssl/root-ca.pem',
bEnable := TRUE
);
(* Publish data every 5 minutes *)
Pub_Timer(IN := TRUE, PT := Pub_Interval);
IF Pub_Timer.Q AND MQTT_Client.xConnected THEN
Pub_Timer(IN := FALSE);
(* Build JSON payload *)
CloudData := CONCAT(
'{',
'"timestamp": "', GetISOTimestamp(), '",',
'"building_id": "Building_A",',
'"equipment": "RTU_1",',
'"zones": [',
'{"id": 1, "temp": ', REAL_TO_STRING(Zone1_Temp), ', "sp": ', REAL_TO_STRING(Zone1_SP), ', "damper": ', REAL_TO_STRING(Zone1_Damper), '},',
'{"id": 2, "temp": ', REAL_TO_STRING(Zone2_Temp), ', "sp": ', REAL_TO_STRING(Zone2_SP), ', "damper": ', REAL_TO_STRING(Zone2_Damper), '},',
'{"id": 3, "temp": ', REAL_TO_STRING(Zone3_Temp), ', "sp": ', REAL_TO_STRING(Zone3_SP), ', "damper": ', REAL_TO_STRING(Zone3_Damper), '},',
'{"id": 4, "temp": ', REAL_TO_STRING(Zone4_Temp), ', "sp": ', REAL_TO_STRING(Zone4_SP), ', "damper": ', REAL_TO_STRING(Zone4_Damper), '}',
'],',
'"supply_temp": ', REAL_TO_STRING(Supply_Temp), ',',
'"outdoor_temp": ', REAL_TO_STRING(Outdoor_Temp), ',',
'"cooling_valve": ', REAL_TO_STRING(Cooling_Valve), ',',
'"supply_fan": ', BOOL_TO_STRING(Supply_Fan_Status), ',',
'"power_kw": ', REAL_TO_STRING(ActivePower_kW), ',',
'"energy_kwh": ', REAL_TO_STRING(DailyEnergy_kWh),
'}'
);
(* Publish to AWS IoT *)
MQTT_Client.Publish(
sTopic := CONCAT('buildings/', Thing_Name, '/telemetry'),
sPayload := CloudData,
uiQoS := 1
);
END_IF
AWS IoT Integration:
- IoT Core receives telemetry data
- IoT Rules route data to:
- DynamoDB for long-term storage
- CloudWatch for monitoring and alerting
- Lambda functions for analytics
- QuickSight for executive dashboards
- SNS notifications for alarm conditions
- Mobile app access via AppSync GraphQL API
Complete Program Structure
Program Organization:
Application
├── PLC_PRG (Main Program)
│ ├── System initialization
│ ├── Mode logic
│ └── Safety interlocks
├── HVAC_Control (Function Block)
│ ├── Zone temperature control
│ ├── Supply air control
│ └── Economizer logic
├── Energy_Monitor (Function Block)
│ ├── Modbus meter communication
│ ├── Demand calculation
│ └── Load shedding
├── BACnet_Interface (Program)
│ ├── Object mapping
│ └── Communication handling
├── Cloud_Interface (Program)
│ ├── MQTT connection
│ └── Data publishing
└── Alarms (Function Block)
├── Alarm detection
├── Priority management
└── Notification logic
Task Configuration:
- MainTask: Cyclic 100ms - Control logic
- BACnetTask: Cyclic 500ms - BACnet communication
- CloudTask: Cyclic 5000ms - Cloud publishing
- AlarmTask: Event-driven - Immediate alarm response
This complete example demonstrates WAGO's capabilities in a real-world building automation application, combining local control, standard protocol integration, web visualization, and modern cloud connectivity.
Best Practices for WAGO Development
Following these best practices ensures reliable, maintainable, and professional WAGO PLC programs.
Program Organization for CODESYS
Modular Architecture:
Create separate POUs for distinct functions:
- Main program for coordination
- Function blocks for reusable control algorithms
- Functions for calculations and data manipulation
- Global variable lists for shared data
Example Project Structure:
Application
├── Main
│ └── PLC_PRG (coordinates all subsystems)
├── Control_Algorithms
│ ├── FB_PID_Controller
│ ├── FB_LeadLag_Controller
│ └── FB_Ramp_Generator
├── Communication
│ ├── PRG_BACnet_Interface
│ ├── PRG_Modbus_Client
│ └── PRG_MQTT_Publisher
├── Utilities
│ ├── FUN_ScaleAnalog
│ ├── FUN_MovingAverage
│ └── FUN_AlarmCheck
└── Hardware_Interface
├── PRG_Analog_Inputs
├── PRG_Analog_Outputs
└── PRG_Digital_IO
Benefits:
- Easier testing and debugging
- Code reuse across projects
- Team collaboration
- Simplified maintenance
Function Block Libraries
Creating Reusable Function Blocks:
Example: Temperature Control with Deadband
FUNCTION_BLOCK FB_TempControl
VAR_INPUT
Temperature : REAL; (* Current temperature *)
Setpoint : REAL; (* Desired temperature *)
Deadband : REAL := 1.0; (* Control deadband *)
Enable : BOOL; (* Enable control *)
END_VAR
VAR_OUTPUT
Heating : BOOL; (* Heating output *)
Cooling : BOOL; (* Cooling output *)
InDeadband : BOOL; (* Temperature within deadband *)
END_VAR
VAR
Error : REAL;
END_VAR
(* Control Logic *)
IF Enable THEN
Error := Setpoint - Temperature;
IF Error > Deadband THEN
Heating := TRUE;
Cooling := FALSE;
InDeadband := FALSE;
ELSIF Error < -Deadband THEN
Heating := FALSE;
Cooling := TRUE;
InDeadband := FALSE;
ELSE
Heating := FALSE;
Cooling := FALSE;
InDeadband := TRUE;
END_IF
ELSE
Heating := FALSE;
Cooling := FALSE;
InDeadband := FALSE;
END_IF
Usage in Multiple Programs:
VAR
Zone1_Control : FB_TempControl;
Zone2_Control : FB_TempControl;
Zone3_Control : FB_TempControl;
END_VAR
Zone1_Control(
Temperature := Zone1_Temp,
Setpoint := Zone1_SP,
Deadband := 1.0,
Enable := System_Enable
);
Zone2_Control(
Temperature := Zone2_Temp,
Setpoint := Zone2_SP,
Deadband := 1.0,
Enable := System_Enable
);
Library Management:
- Store proven function blocks in external libraries
- Version control libraries separately
- Document inputs, outputs, and behavior
- Include example usage in comments
Web Visualization Design Guidelines
Consistent Layout:
- Use grid-based layouts (8px or 10px grid)
- Consistent color scheme across all screens
- Standard navigation elements in same position
- Predictable button placement
Color Standards:
- Green: Normal operation, enabled
- Yellow/Amber: Warning, manual mode
- Red: Alarm, fault, disabled
- Blue: Information, neutral state
- Gray: Inactive, disabled
Typography:
- Sans-serif fonts for readability
- Minimum 14pt for body text
- 18-24pt for primary values
- Bold for labels and headings
Performance:
- Limit update frequency (1-5 second intervals)
- Minimize graphic complexity
- Use vector graphics (SVG) when possible
- Lazy-load non-critical elements
Security Configuration
Network Segmentation:
- Separate OT (operational technology) and IT networks
- Use VLANs to isolate automation systems
- Firewall between internet and automation network
- DMZ for external access points
Authentication:
- Change default passwords immediately
- Strong password requirements (12+ characters, mixed case, numbers, symbols)
- Unique passwords per user
- Password expiration policies
- Account lockout after failed attempts
Encryption:
- Enable HTTPS for web access
- Use valid SSL certificates (not self-signed in production)
- TLS 1.2 or higher
- Strong cipher suites
User Management:
- Role-based access control
- Principle of least privilege
- Regular access reviews
- Disable unused accounts
- Audit logging of access and changes
WAGO-Specific Security:
WBM Security Settings:
├── User Management
│ ├── Create role: Viewer (read-only)
│ ├── Create role: Operator (control)
│ └── Create role: Engineer (configuration)
├── HTTPS Configuration
│ ├── Upload SSL certificate
│ ├── Disable HTTP (port 80)
│ └── Enable HTTPS only (port 443)
├── Firewall Rules
│ ├── Allow: 443 (HTTPS)
│ ├── Allow: 47808 (BACnet/IP)
│ ├── Allow: 502 (Modbus TCP)
│ └── Deny: All other inbound
└── Audit Logging
├── Enable event logging
├── Log authentication attempts
└── Log configuration changes
Firmware Updates and Maintenance
Regular Update Schedule:
- Check for firmware updates quarterly
- Review release notes for bug fixes and security patches
- Test updates in development environment before production
- Schedule updates during maintenance windows
Backup Procedures:
Before Updates:
- Download complete project from controller
- Export web visualization
- Document current firmware version
- Export I/O configuration
- Save backup to version control and offline storage
Update Process:
- Access Web-Based Management
- Navigate to Firmware Update section
- Upload new firmware file
- Verify checksum
- Execute update
- Controller reboots automatically
- Verify operation after update
- Test all functions
- Document update completion
Configuration Management:
- Version control for all projects (Git recommended)
- Tag releases with version numbers
- Change log documentation
- Backup before any configuration changes
Preventive Maintenance:
- Monthly: Review alarm logs, check communication status
- Quarterly: Review trending data, verify calibration
- Annually: Full system functional test, backup verification
- As-needed: Firmware updates, security patches
Documentation Standards:
- Maintain as-built drawings
- Variable naming documentation
- BACnet object lists
- IP address assignments
- User manuals for operators
- Troubleshooting guides
These best practices ensure WAGO systems remain secure, reliable, and maintainable throughout their operational lifetime.
FAQ with Schema Markup
What is a WAGO PFC controller?
WAGO PFC (Programmable Fieldbus Controller) is an industrial automation controller optimized for building automation, IIoT, and distributed control applications. Unlike traditional PLCs, PFC controllers emphasize communication capabilities with native support for BACnet/IP, Modbus TCP, KNX, and other building automation protocols. WAGO controllers use spring cage terminal technology for fast, reliable wiring connections and include built-in web servers for browser-based programming and visualization. The PFC200 series is the most popular model, offering modular I/O expansion, CODESYS-based programming via e!COCKPIT software, and comprehensive protocol support for commercial building and infrastructure applications.
Does WAGO use CODESYS?
Yes, WAGO uses CODESYS V3 as the foundation for e!COCKPIT programming software. This provides full IEC 61131-3 programming language support including ladder logic, function block diagram, structured text, sequential function chart, and instruction list. The CODESYS foundation ensures compatibility with extensive function block libraries, professional development tools, and industry-standard programming practices. However, WAGO's e!COCKPIT extends basic CODESYS with integrated web-based visualization, simplified building automation configuration, and WAGO-specific hardware integration. Programs developed in e!COCKPIT may port to other CODESYS-compatible controllers with minimal modifications, making WAGO an excellent platform for learning transferable PLC programming skills.
Can WAGO controllers do building automation?
WAGO controllers excel at building automation applications and are specifically designed for HVAC, lighting, and energy management systems. Native BACnet/IP support enables direct integration with Johnson Controls, Honeywell, Siemens, and other building management systems without additional gateways. WAGO also supports KNX for European building automation, DALI for advanced lighting control, and Modbus TCP for equipment integration. The compact PFC200 controller with modular I/O perfectly suits distributed building automation architectures, while built-in web visualization eliminates separate HMI costs. Spring cage terminal technology reduces installation time by 50% compared to screw terminals. Major applications include multi-zone HVAC control, demand-based ventilation, lighting scenes, and energy monitoring with cloud connectivity.
What is web-based programming?
WAGO's web-based programming allows engineers to develop, monitor, and troubleshoot PLC programs through standard web browsers without installing dedicated software on every computer. While the primary development environment (e!COCKPIT) still requires installation on engineering workstations, WAGO controllers include built-in web servers providing browser-accessible interfaces for monitoring, diagnostics, and basic configuration changes. The Web-Based Management (WBM) interface enables viewing I/O status, downloading programs, adjusting parameters, and updating firmware from any device with a web browser including tablets and smartphones. This dramatically improves maintenance efficiency and remote troubleshooting capabilities. Additionally, WAGO's web visualization feature creates HTML5-based HMIs accessible from browsers without requiring specialized HMI software or runtime licenses.
Does WAGO support BACnet?
Yes, WAGO provides comprehensive native BACnet/IP support through the WagoAppBACnet library included with e!COCKPIT. WAGO controllers function as BACnet Application Specific Controllers (B-ASC) supporting all standard BACnet objects including Analog Input, Analog Output, Analog Value, Binary Input, Binary Output, Binary Value, and Multi-State objects. Supported BACnet services include ReadProperty, WriteProperty, ReadPropertyMultiple, SubscribeCOV (Change of Value), WhoIs/I-Am device discovery, and alarm/event management. This enables seamless integration with all major building management systems including Tridium Niagara, Johnson Controls Metasys, Honeywell EBI, Siemens Desigo, and Schneider Electric EcoStruxure. No additional hardware gateways are required—BACnet communication occurs directly over standard Ethernet networks using UDP/IP protocol.
Can WAGO connect to the cloud?
Yes, modern WAGO controllers provide multiple cloud connectivity options for IIoT applications. The WagoAppMQTT library enables MQTT client connections to AWS IoT Core, Microsoft Azure IoT Hub, Google Cloud IoT, and other MQTT brokers for telemetry publishing and command reception. WAGO Edge Controllers include OPC UA server/client functionality for Industry 4.0 data exchange and Docker container support for running Node-RED, custom applications, and edge analytics alongside PLC logic. Built-in HTTPS and RESTful API capabilities allow integration with enterprise systems and custom cloud platforms. Security features include TLS encryption, certificate-based authentication, and encrypted storage. Typical cloud applications include predictive maintenance, energy analytics, remote monitoring, multi-site dashboards, and corporate sustainability reporting with historical data visualization.
What are spring cage terminals?
Spring cage terminals are WAGO's patented wire connection technology using spring pressure instead of screws to secure electrical connections. Wires insert into terminal blocks and are held by spring force, eliminating loosening from vibration, thermal cycling, or mechanical stress. Installation is significantly faster—strip wire, insert, and release—compared to traditional screw terminals requiring screwdrivers and torque specifications. Spring cage terminals accept solid or stranded wire from 0.08mm² to 4mm² without ferrules, though ferrules remain optional for stranded wire identification. The technology provides superior long-term reliability with constant contact force maintained throughout the system lifetime. Global certifications include UL, CSA, IEC, and others. WAGO pioneered this technology and it has become an industry standard adopted by other manufacturers, but WAGO remains the technology leader with the most comprehensive product line.
Is WAGO PLC software free?
Yes, WAGO's e!COCKPIT programming software is completely free to download and use with no license fees, subscription costs, or feature limitations. This includes full access to all IEC 61131-3 programming languages (ladder logic, function block diagram, structured text, sequential function chart, instruction list), simulation capabilities, web visualization development, and communication protocol libraries. Free software significantly reduces total cost of ownership compared to manufacturers charging thousands of dollars for programming software licenses. Download e!COCKPIT directly from www.wago.com/ecockpit without registration barriers. The only costs are WAGO controller hardware and field I/O modules—there are no recurring software fees, annual maintenance charges, or per-seat licensing. This makes WAGO extremely cost-effective for learning, small projects, and large installations alike.
What industries use WAGO controllers?
WAGO controllers serve diverse industries with particular strength in building automation, renewable energy, water/wastewater treatment, and infrastructure applications. Building Automation: Commercial offices, hospitals, universities, retail facilities, and data centers use WAGO for HVAC control, lighting management, and energy monitoring with BACnet integration. Renewable Energy: Solar farms, wind turbines, and battery energy storage systems rely on WAGO for monitoring, control, and SCADA communication in harsh outdoor environments. Water/Wastewater: Municipal water treatment, pumping stations, and distribution systems use compact WAGO controllers with cellular communication for remote installations. Manufacturing: Machine builders and process automation integrators choose WAGO for its flexibility and cost-effectiveness. Transportation: Tunnel ventilation, traffic control, and railway systems utilize WAGO's reliability and communication capabilities. Marine: Shipbuilding and offshore platforms use WAGO controllers with marine certifications and corrosion-resistant housings.
How do I get started with WAGO programming?
Start with these steps: 1. Download e!COCKPIT: Visit www.wago.com/ecockpit and download the latest version of e!COCKPIT programming software (completely free). Install on Windows 10 or 11 computer. 2. Explore Simulation: Use built-in simulation mode to practice programming without hardware. Create sample projects with ladder logic and structured text. 3. Learn CODESYS Basics: Since WAGO uses CODESYS V3, any CODESYS tutorial provides applicable knowledge. Master IEC 61131-3 programming languages. 4. Study Sample Projects: e!COCKPIT includes example projects demonstrating common applications. Analyze these to understand programming patterns. 5. Get Hardware: Purchase starter kit with PFC200 controller and basic I/O modules (typically $800-1200). 6. Online Resources: Access WAGO's extensive documentation, video tutorials, and technical support. 7. Training: Consider WAGO's official training courses covering controller programming, building automation, and IIoT applications. 8. Community: Join WAGO user forums and LinkedIn groups for peer support and knowledge sharing.
What is the difference between PFC100 and PFC200?
PFC100 and PFC200 differ primarily in processing power, memory, and I/O expansion capabilities. PFC100 offers entry-level functionality with 600 MHz processor, 256 MB RAM, 512 MB Flash storage, and supports up to 250 I/O points in compact 62mm width. Best for small machine control, protocol gateways, and simple automation at $350-500. PFC200 provides mainstream capabilities with 600 MHz to 1 GHz processor (G2 models), 512 MB RAM, 4 GB Flash storage, supports up to 1000 I/O points, includes SD card slot, and offers more Ethernet ports. Ideal for building automation, distributed control, and complex applications at $600-1200. PFC200's modular I/O system with extensive module selection makes it more scalable for large systems. Both use identical e!COCKPIT programming software and support the same protocols, so programming knowledge transfers directly between models. Choose PFC100 for cost-sensitive small systems and PFC200 for applications requiring growth capacity and additional communication interfaces.
How does WAGO compare to Siemens or Allen-Bradley?
WAGO offers compelling advantages over Siemens and Allen-Bradley for building automation and distributed control applications. Cost: WAGO typically costs 15-30% less than equivalent Siemens S7-1200/1500 or Allen-Bradley CompactLogix systems, with free programming software versus Siemens TIA Portal licenses ($3000+) or Rockwell Studio 5000 licenses ($7500+). Building Automation: Native BACnet/IP, KNX, and DALI support surpasses Siemens and Allen-Bradley requiring additional communication modules or gateways. Installation Speed: Spring cage terminals reduce wiring time by 50% compared to screw terminals. Web HMI: Built-in web visualization eliminates separate HMI costs. Disadvantages: Siemens and Allen-Bradley offer superior high-speed motion control, larger I/O capacity for massive systems, and stronger process industry presence. For general building automation, renewable energy, and infrastructure applications under 1000 I/O points, WAGO provides better value with excellent technical capabilities at lower total cost of ownership.
This comprehensive WAGO PLC programming tutorial equips you with the knowledge to successfully implement building automation, IIoT, and distributed control systems using WAGO PFC controllers. From understanding controller selection through advanced BACnet integration and cloud connectivity, you now have the foundation to design professional automation solutions leveraging WAGO's unique advantages in compactness, protocol support, web-based capabilities, and cost-effectiveness.
For additional PLC programming resources, explore our CODESYS programming tutorial for deeper CODESYS V3 knowledge, review Modbus protocol implementation for equipment integration, or compare free PLC programming software options for learning and development. Master these skills to advance your building automation and IIoT engineering career.
💡 Pro Tip: Download Our Complete PLC Programming Resource
This comprehensive 10 946-word guide provides deep technical knowledge, but our complete 500+ page guide (coming December 2025) includes additional practical exercises, code templates, and industry-specific applications.Preorder the complete guide here (60% off) →
🚀 Ready to Become a PLC Programming Expert?
You've just read 10 946 words of expert PLC programming content. Preorder our complete 500+ page guide with even more detailed examples, templates, and industry applications.
✓ December 2025 release ✓ Full refund guarantee
Frequently Asked Questions
How long does it take to learn PLC programming?
With dedicated study and practice, most people can learn basic PLC programming in 3-6 months. However, becoming proficient in advanced techniques and industry-specific applications typically takes 1-2 years of hands-on experience.
What's the average salary for PLC programmers?
PLC programmers earn competitive salaries ranging from $55,000-$85,000 for entry-level positions to $90,000-$130,000+ for senior roles. Specialized expertise in specific industries or advanced automation systems can command even higher compensation.
Which PLC brands should I focus on learning?
Allen-Bradley (Rockwell) and Siemens dominate the market, making them excellent starting points. Schneider Electric, Mitsubishi, and Omron are also valuable to learn depending on your target industry and geographic region.