Skip to content
MB Datasuite
  • Features
  • Applications
  • Energy
  • Visualization
  • Prices
  • Free Trial
  • Deutsch
MB Datasuite
  • Features
  • Applications
  • Energy
  • Visualization
  • Prices
  • Free Trial
  • Deutsch

System requirements and compatibility

5
  • System requirements and secure operation
  • Operate as a windows service
  • Database connections 
  • PLC support  
  • White Label

Quick start

9
  • Installation  
  • Set up PLC connection  
  • Create trigger  
  • Select trigger variable in the handshake  
  • Execute trigger  
  • Create Excel file  
  • Write header data to the file  
  • Write record  
  • Connect to a Database

Tutorials, HowTos and instructions

1
  • Alarm emails with OPC-UA: Monitoring excess temperature with an S7 1500 PLC

User Manual

96
  • General information on the user manual
  • Licensing
    • Determining the required licence  
    • Activate your licence  
  • Settings
    • General information
    • Export  
    • Import  
    • Password protection  
    • Change language  
    • Factory settings  
  • Trigger
    • General information about the trigger
    • Create trigger  
    • Trigger structure  
    • Use variables  
    • Additional trigger editing functions
      • Calculations and Formatting of SPS Data
      • Invert Excel Actions 
      • Changing data blocks for all variables in the trigger 
    • Trigger Actions
      • General information
      • Write variable 
      • Excel – Writing  
      • Excel – Read  
      • Convert Excel file to PDF  
      • Print Excel file  
      • Convert Excel file to HTML file  
      • Database: Execute Query 
      • Database: Write record (Insert) 
      • Database: Write several data records (insert) 
      • Database: Read data record (Select) 
      • Database: Read multiple records (Select) 
      • File options (copy, move, rename, delete)  
      • Read out file names in folder  
      • Execute REST Request 
      • FTP Upload
      • Send e-mail  
      • Send SMS  
      • Send message using Telegram 
      • Send message using Threema  
      • Start external applications  
      • Exporting and importing data blocks (DB)
      • Update Data Block
      • Set PLC time 
    • Trigger trigger conditions and handshake
      • General information on Trigger conditions and handshake  
      • Standard handshake  
      • Individual handshake  
    • Error handling and log
      • Error handling and log  
  • Accounts
    • Telegram account
      • Telegram time limit
      • Configure Telegram account 
      • Set up Telegram
    • Threema account
      • Threema Time limit  
      • Configure Threema account 
      • Set up a Threema account
    • E-Mail account
      • Email time limit
      • Configure email account  
      • General info about e-mail account
    • SMS-account
      • Configuring a SMS / Seven Account
      • SMS time limit
      • SMS Sandbox
  • Error Codes
    • General   (0 – 99)
    • PLC (200 – 299)
    • E-mail (300 – 399)
    • SMS (400 – 499)
    • Excel (500 – 599)
    • OPC UA (700 – 799)
    • Databases (800 – 899)
    • Print (1000 – 1099)
    • PDF (1100 – 1199)
    • HTML (1200 – 1299)
    • Start external applications  (1300 – 1399)
    • Rest (1400 – 1499)
    • Time Master (1900 – 1999)
    • Telegram (2000 – 2099)
    • Threema (2100 – 2199)
  • Devices (Shelly)
    • General information about Shelly
    • Add devices 
    • Using Shelly variables 
  • Excel, CSV, PDF files
    • CSV files: Formats, special characters, encodings
    • General information on Excel files
    • File selection 
    • File formats  
    • Read Access 
    • Write Access 
  • Control systems (PLC connections)
    • General information on PLC connections
    • Create PLC connection  
    • Variables  
    • Configure PLC connection  
  • Databases
    • General information on databases
    • Database: Write record (Insert) 
    • Database: Write several data records (insert) 
    • Database: Read data record (Select) 
    • Database: Read multiple records (Select) 
    • Database: Execute Query 
  • Webserver / REST API
    • General information web server/rest API
    • Settings and security 
    • Calling up web pages 
    • Use Rest-API 
  • Support
    • Create Support Packages  
    • Support contact details

Upgrade from version 2 to version 3

1
  • Change from version 2 to version 3  
  • Home
  • Docs
View Categories

Read/write optimized data blocks (DB) of an S7 PLC (Excel, SQL)

Lesedauer: 2 min

Introduction #

How can DataSuite be used with optimized data blocks (DB) of a Siemens S7 PLC?
Welcome to the guide, in this document you will learn how to set up DataSuite with a PLC (S7-1200/S7-1500) and optimized data blocks.
The data is saved in Excel files, but can also be stored in SQL databases


1. Requirements #

1.1 Hardware & Software #

  • Siemens S7-1200 or S7-1500 PLC with activated OPC UA functionality
  • DataSuite software (version 3 or newer)
  • TIA Portal (for PLC programming and configuration)
  • Licensed OPC UA Runtime for the PLC
  • Microsoft Excel (if Excel files are to be used)

1.2 Network Configuration #

  • Profinet connection between PC (with DataSuite) and the PLC
  • Fixed IP address for the PLC
  • Firewall settings for OPC UA (enable port 4840)

2. Activate OPC UA in the Siemens PLC #

As optimized data blocks cannot be accessed via Put/Get, the PLC must act as an OPC UA server.

2.1 Enable OPC UA Server in the PLC #

  1. Open TIA Portal and load the PLC project.
  2. Go to Device configuration → OPC UA.
  3. Activate OPC UA Server and select standard interface.
  4. (Optional) Change port from 4840 to another port.
  5. Configure security options:
    • Activate at least user name/password authentication.
    • (Recommended) Activate encrypted connection.
  6. Save changes and restart PLC.

2.2 Configuring OPC-UA Variables #

  1. Open the desired data block (DB) in TIA Portal.
  2. Drag the desired variables into the OPC UA server interface (right mouse button → OPC UA → Add).
  3. Load the modified program into the PLC.

3. Connecting DataSuite with OPC UA #

3.1 Add SPS connection #

  1. Open DataSuite and go to PLCs.
  2. Click on Create new PLC.
  3. Select PLC – OPC UA as the connection type.

3.2 Enter OPC UA connection parameters #

  1. Enter the IP address of the PLC.
  2. Set port 4840 (or the port set in the PLC).
  3. Security mode: If activated, select an encrypted connection.
  4. Authentication: Enter the user name and password of the PLC.
  5. Test and confirm the connection.

4. Importing variables from OPC UA #

  1. Open the newly created PLC connection in DataSuite.
  2. Click on Manage variables.
  3. Select OPC UA Import and load the data blocks released in the PLC.
  4. If new variables are added in the PLC, import again.

5. Configure Excel file in the DataSuite #

5.1 Creating a new Excel file #

  1. Open DataSuite and go to Excel files.
  2. Click on Add new file.
  3. Create a new Excel file or use a template.

5.2 Set up Excel file for write access #

  1. Enter file path and name (may contain variables).
  2. Set save options:
    • Overwrite (old file is replaced)
    • Continue (new data is appended to existing file)
    • Append number (create a new file with consecutive number each time)
  3. Set data format (XLSX or CSV).

5.3 Saving Data in an Excel File #

  1. Create a trigger in DataSuite.
  2. Select Action: Excel – Write.
  3. Select the desired file and spreadsheet.
  4. Assign the corresponding cells to the PLC variables.
  5. Save and activate.

5.4 Reading Data from an Excel File #

  1. Create a trigger in DataSuite.
  2. Select Action: Excel – Read.
  3. Select the desired file and spreadsheet.
  4. Assign the Excel cells to the OPC UA variables in the PLC.
  5. Save and activate.

6. Alternative: Database connection (SQL) #

If the data is not to be saved in Excel but in an SQL database, DataSuite can also work with the following databases :

  • Microsoft SQL Server
  • MySQL
  • MariaDB
  • PostgreSQL

6.1 Configure Database Connection #

  1. Go to Databases in DataSuite.
  2. Click on Create new connection.
  3. Select the desired database type.
  4. Enter the connection parameters (host, port, user, password).
  5. Test and save the connection.

6.2 Set up database queries #

  • Write data to database → Action: SQL insert
  • Read data from database → Action: SQL-Select

The tables and columns can be linked dynamically with PLC variables.


7. Troubleshooting & optimization #

7.1 Connection not possible? #

    • Check whether the PLC is accessible (ping to IP address).
    • In TIA Portal:
      • OPC UA Server activated?
      • Correct security options selected?
      • Data blocks added to the OPC UA interface?

    7.2 Values are not being updated? #

    • Open the variable view in DataSuite → Are values being read?
    • Triggers configured correctly? (Check conditions)
    • Excel file not open? (Excel locks files when editing)
    • SQL database queries correct? (Test connection)
    Wie findest du den Beitrag?
    Immer noch Fragen? Wie können wir helfen?

    Wie können wir helfen?

    Inhalt
    • Introduction
    • 1. Requirements
      • 1.1 Hardware & Software
      • 1.2 Network Configuration
    • 2. Activate OPC UA in the Siemens PLC
      • 2.1 Enable OPC UA Server in the PLC
      • 2.2 Configuring OPC-UA Variables
    • 3. Connecting DataSuite with OPC UA
      • 3.1 Add SPS connection
      • 3.2 Enter OPC UA connection parameters
    • 4. Importing variables from OPC UA
    • 5. Configure Excel file in the DataSuite
      • 5.1 Creating a new Excel file
      • 5.2 Set up Excel file for write access
      • 5.3 Saving Data in an Excel File
      • 5.4 Reading Data from an Excel File
    • 6. Alternative: Database connection (SQL)
      • 6.1 Configure Database Connection
      • 6.2 Set up database queries
    • 7. Troubleshooting & optimization
      • 7.1 Connection not possible?
      • 7.2 Values are not being updated?

    MB DataSuite

    • Home
    • Features
    • Applications
    • Prices

    Info portal

    • Knowledge Base
    • Newsletter
    • Change Log
    • FAQ & Support

    Company

    • About us
    • Imprint
    • Linkedin
    • YouTube
    • Facebook

    Legal

    • Privacy
    • EULA
    • Cookie Settings

    Help and support

    • Tel +49 2742 72927 80
    • Live Presentation
    • Contact
    • Deutsch
      • About us
      • Support & FAQ
      • Contact
      • Imprint
      • TOS and EULA
      • Privacy policy
      • Linkedin
      • Facebook
      • Youtube
      [MB] Software und Systeme GmbH