The first step in Cloud Logging is setting up a data source. This is done by selecting a communication protocol and defining the variables. This article shows you how to do this for a Siemens S7-300/400/1200/1500 PLC.
- PLC settings
- Select a communication protocol
- Available datatypes
- Add variables (new, import)
- Test variables
- Manage variables (export, duplicate, remove)
The S7-1200 and S7-1500 PLCs have a built-in firewall. By default, the maximum protection level is activated. The x500 IoT gateway will need access to the PLC.
- In TIA Portal, go to [Device configuration], select [Protection & security] in the properties tab and check the setting “Permit access with PUT/GET communication from remote partner“.
- Finally, download the new hardware configuration to the PLC for the changes to take effect.
The addresses of Data Block variables are, by default, optimized by TIA Portal and not visible. If you wish to log data from Data Blocks, these will need to have “optimized block access” turned off.
- In TIA Portal, right-click a Data Block, or the linked Function Block, go to [Properties], select [Attributes], and uncheck “Optimized block access“.
- Finally, compile the TIA Portal project and download the new software to the PLC for the changes to take effect.
Select a communication protocol
You first have to select a communication protocol. This is the protocol that the x500 IoT gateway will use to communicate with the PLC.
- Go to [Devices] in the main menu, select the concerning device, open its [Services] tab, and press [Add service].
- Name the PLC, enter the PLC’s IP address, and press [Next].
- Select your service type: [Data source].
- Select the communication protocol “Siemens S7-300/400/1200/1500”. The port number will automatically be filled based on the selected protocol (port 102 for Siemens-S7). The rack and slot number are that of the PLC itself, visible in the hardware configuration in TIA Portal. Press [Add].
X4 Remote supports the following datatypes when using the Siemens S7 :
- SINT / INT / DINT / LINT
- USINT / UINT / UDINT / ULINT
- REAL / LREAL
Once you’ve added a Data Source and selected a communication protocol, you can start adding variables. This is done in the configurator tool, specifically designed to quickly add, duplicate, import, export, and remove variables.
- Go to [Devices] in the main menu, select the concerning device, open its [Services] tab, and edit the PLC’s services.
- Select [Data source] and press [Open configurator].
- To add a variable press [Add variable].
You can choose to:
Manually add new variables
When you press [Add new variable] you’ll see the window that is depicted below.
- Enter the variable’s name, type, full address, additional information, and press [Add]. The image below contains explanatory text for each setting.
- Press [Push changes] in the config tab to complete the setup.
Import variables from a file (or device)
You can easily and effortlessly copy variables from one device to another by exporting the concerning variables (view the “Manage variables” part of this article) and then importing them in your new device. Alternatively, you can manually prepare your variables in the required CSV format to load them all at once into your configurator. The CSV file structure is explained in our “Import variables: CSV file structure“-article.
When you press [Import from CSV-file], you’ll see a browse window.
- Select a CSV file to import and press [Open].
- When the file has been read, press [Add] to add all variables to your data source.
- Finally, press [Push changes] in the config tab to complete the setup.
The test utility is used to check if all the added variables are set correctly. It shows the status of every variable and displays the variables’ latest values if everything is configured correctly. If not, it’ll show an error message.
- In the configurator press [Run test].
A connection will now be set up to stream the data directly to your computer, using:
|Port||Transport protocol||Application protocol|
When the connection is set up and all variables are set correctly, it should look like this:
If the test utility shows unexpected values, please check if the addresses and data types of all variables are entered correctly.
If you get no data at all, please also check that the above listed port and protocols are not being blocked by your computer’s or company’s firewall.
You can view all defined variables in a list view or table view. Multiple variables can be selected by pressing the icon on the left, or you can select all by pressing […]. These can then be removed, duplicated, or exported to a CSV file.