Why connect a PLC to Power BI?
Power BI is the most widely used Business Intelligence tool in Latin American companies. The classic Industry 4.0 challenge is precisely this: production process data stays trapped on the plant floor and never reaches the management dashboards where business decisions are made.
Connecting the PLC to Power BI closes that gap: production, energy efficiency, OEE and quality KPIs appear in the same reports alongside financial and sales data.
Recommended architecture
This architecture has several advantages: the PLC is not directly exposed to the IT network, the Historian acts as a buffer and single source of truth, and Power BI can run a scheduled refresh (every 15-60 minutes) without affecting PLC performance.
Step 1: Enable OPC UA on the Siemens PLC
In TIA Portal, S7-1500 and ET200SP PLCs come with a built-in OPC UA server in recent firmware versions. The steps are:
- In the CPU properties, enable "OPC UA Server"
- Define the endpoint (port 4840 by default)
- Configure the security policy (recommended: Basic256Sha256)
- Create the Server Interfaces: drag in the DB variables you want to expose
- Compile and download the program
Step 2: Node-RED as the OPC UA client
In Node-RED, the node-red-contrib-opcua node acts as the client and connects to the PLC's server. The configuration includes the endpoint URL, credentials and subscriptions to the nodes of interest. Node-RED receives the value changes and sends them to InfluxDB with the correct timestamp.
Step 3: InfluxDB as the Historian
Node-RED writes to InfluxDB using Line Protocol or the native HTTP client. Data is stored with a measurement (data type), tags (equipment identifiers) and fields (numeric values or strings). Data retention is configured according to the company's historical analysis needs.
Step 4: Power BI connected to InfluxDB
Power BI can connect to InfluxDB in two ways:
- Direct InfluxDB connector — available in Power BI Desktop for InfluxDB v1. It allows direct Flux or InfluxQL queries
- REST API + Power Query — more flexible, compatible with InfluxDB v2. The Web.Contents() function in Power Query is used to query the API
For executive reports with a daily or weekly refresh, both options work well. For dashboards closer to real time (15-minute refresh), the REST API is more stable.
Alternatives to consider
| Case | Recommendation |
|---|---|
| Real-time visualization in the control room | Grafana (better suited than Power BI) |
| Automatic reports to management | Power BI with scheduled refresh |
| Ad hoc analysis by engineers | Grafana or Jupyter Notebook with Python |
| Integration with SAP ERP | InfluxDB → API REST → SAP Analytics Cloud |
Want to connect your plant to Power BI?
We implement the complete IT/OT architecture, from the PLC connection to the Power BI dashboards, with training for your team.
See Industrial Data →