Connect Siemens PLC to Oracle Database Without Coding or Networking
In modern industrial environments, connecting PLCs directly to enterprise databases like Oracle is a common requirement for data logging, analytics, and supervisory control. Traditionally, this involves complex programming, OPC servers, and network configuration. However, a new approach using a dedicated smart gateway simplifies the process dramatically. This article explores how to connect multiple Siemens S7-1200 and S7-1500 PLCs to an Oracle database without writing code or dealing with intricate network setups.
The Challenge of PLC-Database Integration
PLCs are designed for real-time control, not database communication. They lack native drivers for Oracle, SQL Server, or MySQL. Engineers often resort to middleware like OPC UA, Kepware, or custom scripts on a PC. These solutions add cost, complexity, and potential points of failure. Moreover, when multiple PLCs need to talk to the same database, the architecture becomes even more tangled.
The Smart Gateway Solution
A dedicated industrial IoT gateway, such as the IGT-DSER, acts as a bridge between PLCs and databases. It connects to the PLC via Ethernet (Profinet, Modbus TCP, etc.) and to the database via standard network protocols. The gateway handles all protocol conversion, data buffering, and transaction management. This means you can set up bidirectional data transfer between Siemens S7-1200/1500 PLCs and Oracle database in minutes, using a simple configuration tool.
Key Features of the Gateway
- No Programming Required: Configuration is done via a graphical software tool. Simply select the PLC type, define data points, and enter database credentials.
- Data Buffering: If the network or database server is unavailable, the gateway stores data locally and automatically resends it when the connection is restored. This prevents data loss.
- Multi-PLC Support: One gateway can connect to multiple Siemens PLCs simultaneously, aggregating data into a single database.
- Bidirectional Communication: Read data from PLCs and write to database, or query database and write values back to PLC registers.
- Edge Computing: Perform simple data processing like scaling, formatting, and conditional logic directly on the gateway.
- Database Compatibility: Supports Oracle, MySQL, SQL Server, PostgreSQL, and others.
Step-by-Step Configuration
The setup process is straightforward and typically takes less than 30 minutes for a basic application.
1. Select Device Type
Open the gateway configuration software. Navigate to ‘Function’ -> ‘Type and Device Selection’. Choose the third option for database integration, and select Siemens S7-1200/1500 as the PLC type. Confirm and write parameters to the gateway, then reboot.
2. Configure Network Parameters
Set the IP address and subnet of the gateway to match your local network. Ensure it can reach both the PLCs and the database server.
3. Set Up Database Connection
Go to ‘Function’ -> ‘Data Reporting and Platform Integration’, select ‘SQL Remote Database’. Enter the Oracle server IP, port, username, and password. Define the data points you want to exchange: for each, specify the PLC register address, data type, and the corresponding database table/column.
4. Data Processing Rules (Optional)
The gateway supports powerful inline data processing. You can add rules in the ‘Data Processing/Initial Value’ column:
| Function | Syntax Example | Description |
|---|---|---|
| Limit string length | [n=24] | For CHAR[n] type, restricts max characters to 24 (range 1-128). |
| Fix decimal places | [.03] | For REAL/LREAL, keeps 3 decimal places (range 01-06). |
| Arithmetic operation | [/100] | Divides the current value by 100. Supports +, -, *, /, \ (integer division). |
| Decimal to hex | [.x] or [.X] | Converts unsigned integer to hexadecimal (lowercase/uppercase). |
| Conditional trigger | [==]100 | Only execute if value equals 100. Also supports <>, <=, >=. |
| String composition | [#count=**pcs] | If value is 100, outputs “count=100pcs”. |
| Value mapping | [#@0=Off|1=Standby|2=Run|3=Fault|Other] | Replaces numeric codes with descriptive strings. |
5. Deploy and Monitor
Write the configuration to the gateway and reboot. Use the built-in data monitor to view generated SQL statements and verify data flow.
Typical Network Architecture
The gateway sits on the same network as the PLCs, usually on the machine or plant floor. It connects to the database server via the corporate LAN or even over a VPN. Since the gateway initiates the database connection, no inbound firewall rules are needed on the PLC network. This enhances security while simplifying IT involvement.
For redundancy, multiple gateways can be deployed, or a single gateway can be configured to failover to a secondary database server. Data integrity is maintained through local storage and automatic retransmission.
Beyond Siemens: Universal PLC Compatibility
While this article focuses on Siemens S7-1200/1500, the same gateway supports Rockwell Allen-Bradley, Omron, Mitsubishi, GE, Beckhoff, Emerson, and many other PLC brands. This makes it a versatile tool for plants with mixed-vendor equipment. The configuration process remains identical; only the PLC driver selection changes.
Benefits for Industrial Automation
Adopting a smart gateway for PLC-to-database connectivity offers several advantages:
- Reduced Engineering Time: No need to write PLC code or PC applications for data logging.
- Lower Cost: Eliminates the need for OPC servers, additional PCs, and software licenses.
- Improved Reliability: Built-in data buffering ensures zero data loss during network outages.
- Scalability: Easily add more PLCs or data points without reprogramming.
- Enhanced Security: The gateway acts as a secure bridge, isolating the control network from the enterprise network.
Conclusion: Integrating Siemens PLCs with Oracle databases no longer requires specialized programming skills or complex network configurations. A dedicated industrial IoT gateway streamlines the process, offering a robust, scalable, and cost-effective solution for modern data-driven manufacturing.