Siemens S7
Review the following information for setting up and configuring the Siemens S7 driver.
Manufacturing Connect Edge Compatible Series
Compatibility parameter | Compatible items |
|---|---|
Driver type | Ethernet |
Validated devices/series | |
Replaces Gen 1 driver(s) | Learn more about Gen1 and Gen2 Driver Differences |
To set up and configure this device in Manufacturing Connect Edge, you will need to do the following:
- Step 1: Set up and Configure the PLC Device
- Step 2: Set up the PLC Device in Manufacturing Connect Edge DeviceHub
- Step 3: Configure the List of Registers
Step 1: Set up and Configure the PLC Device
If the device is configured for Ethernet access, find its network parameters. Otherwise, follow the steps below.
S7-1200 and S7-1500 Devices
To configure your device:
- Open your TIA Portal project.
- In the project tree, right-click your PLC and select Properties… from the popup menu. The Properties window opens.
- To obtain the device’s IP address (if you do not already have it):
- From the left pane, select PROFINET interface > Ethernet addresses.
- In the right pane, go to IP protocol, find the IP address of the PLC, and copy it aside.
- From the left pane, select PROFINET interface > Advanced options > Port [X1 P1] > Port interconnection.
- In the right pane, enter “Any partner” in the Partner port field.
- From the left pane, select Protection & Security > Access level.
- In the right pane, select the Full access radio button.
- From the left pane, select Protection & Security > Connection mechanisms.
- In the right pane, select the Permit access with PUT/GET communication from remote partner check box.
- Click OK.
- In the project tree, right-click the data block you want to read and select Properties… from the popup menu The Properties window opens.
- From the left pane, select Attributes.
- In the right pane, clear the Optimized block access check box.
- Click OK.
- Repeat steps 11-14 for all data blocks you want to read.
- Click the Compile icon on the toolbar.
- When the project finishes compiling, click Download to Device.
S7-200, S7-300, and S7-400 Devices
To configure your device:
- Open your SIMATIC Manager project.
- In the project tree, right-click your PLC and select Object Properties... from the popup menu. The Properties window opens.
- Select the Interfaces tab.
- Find and copy the IP address of the Ethernet interface.
Step 2: Set up the PLC Device in Manufacturing Connect Edge DeviceHub
Configure the following parameters when you Connect a Device with this driver. Update default values to the specific set up of your device.
Parameter | Value |
|---|---|
Type | Siemens |
Driver | Siemens S7 |
Network Address | The device address you defined during Step 1 |
Port | 102 |
Slot | The slot number of the relevant interface on the device |
Step 3: Configure the List of Registers
When you Add Tags to the connected device, refer to the following register table and tag parameters.
Refer to the following additional resources:
Register Table
NOTE: The address format in this Gen 2 driver is different from the Gen 1 driver (Siemens S7-Advanced (Gen1)) for the same device. Learn more about Gen1 and Gen2 Driver Differences.
Name | Data Type | Address Format | Address Format on the Device | Min Address | Max Address | Description |
|---|---|---|---|---|---|---|
DB | byte, word, dword, lword, usint, uint, udint, ulint, sint, int, dint, lint, real, lreal, date, s5time, dt, ldt, tod, ltod, time, ltime, dtl, char, wchar, string, wstring | DDDDD | DB[x].DB[y][DDDDD] | 0 | 65535 | Data block, absolute address |
DB(bit) | bool | DDDDDd | DB[x].DB[y].[DDDDD].[d] | 0 | 655357 | Data block (bits), absolute address |
M | byte, word, dword, lword, usint, uint, udint, ulint, sint, int, dint, lint, real, lreal, date, s5time, dt, ldt, tod, ltod, time, ltime, dtl, char, wchar, string, wstring | DDDDD | %M[y][DDDDD] | 0 | 65535 | M memory |
M(bit) | bool | DDDDDd | %M[DDDDD].[d] | 0 | 655357 | M memory (bits) |
I | byte, word, dword, lword, usint, uint, udint, ulint, sint, int, dint, lint, real, lreal, date, s5time, dt, ldt, tod, ltod, time, ltime, dtl, char, wchar, string, wstring | DDDDD | %I[y][DDDDD] | 0 | 65535 | Input area |
I(bit) | bool | DDDDDd | %I[DDDDD].[d] | 0 | 655357 | Input area (bits) |
Q | byte, word, dword, lword, usint, uint, udint, ulint, sint, int, dint, lint, real, lreal, date, s5time, dt, ldt, tod, ltod, time, ltime, dtl, char, wchar, string, wstring | DDDDD | %Q[y][DDDDD] | 0 | 65535 | Output area |
Q(bit) | bool | DDDDDd | %Q[DDDDD].[d] | 0 | 655357 | Output area (bits) |
Tag Parameters
- Name: Select a register name from the drop-down list. The available options depend on the names in the register table.
- Value Type: Select a data type from the drop-down list. The available options depend on the register name selected.
- Polling Interval: Enter a value in seconds. This determines how often the tag should poll the register for data.
- Tag Name: Enter a name for the tag.
- Description (Optional): Enter a description for the tag.
- Address: Enter a tag address. The value must in the decimal format, within the allowed min/max range. Omit the leading zeros. The device might use the decimal (D), hexadecimal (H), or octal (O) address format. See the Register Table at the bottom of the dialog box. For Bit tags, append the bit address without the bit separator. The lowercase letters in the address format indicate how many digits you should enter in the Bit address.
- Count: Enter the number of register values to read. A count higher than 1 will generate an array of values from the address value configured and respective subsequent address values.
- DB: Enter the data block number of the tag.
- Tag Formula: Enter a formula for the tag to process the generated data. Two variables are permitted: value (current tag value) and timestamp (current tag UNIX time in milliseconds). The following math functions are available:
- sin
- cos
- sqrt
- tan
- power: power(x) performs the operation 10^x.
- log: log(x) is the natural logarithm (the logarithm is in base e).
- exp: exp(x) performs the operation e^x.
- Only Publish on Change of Value: Select the checkbox to customize NATS messages to be published only when the value parameter changes from a previous value to a new one. Change of Value only applies to boolean, numeric (such as int or float), and simple string data types. It does not apply to complex types, such as JSON or array. Poll-once topics will not be affected by Change of Value settings. These topics will still only see a single message.
- Meta Data: Metadata summarizes basic information about data. This feature allows you to define key-value pair data for the device output payload later on. It can then be used to find, use, and reuse particular instances of data.
Note: If you use special characters in meta data key names, the special characters are replaced with underscore characters in the payload. This can cause two key names to be combined into one. For example, configuring the key names a**b and a&&b will cause only one key name to be created (a__b).
Additional Considerations/Configurations
You can:
- Export elements from a single PLC tag table
- Export all PLC tags and constants of a CPU from the All tags table
To export device tags:
- In TIA Portal, open the table from which you want to export the tags (a single PLC tag table or the All tags table).
- In the PLC tag table, click the Export button The Export dialog box opens.
- Click the Path of export file button. The Save as dialog opens.
- Select the directory for the export file and enter the file name.
- Select .xlsx, .sdf, or .xml as the file type. The only human-readable file type is .xlsx.
- Click Save.
- Select the export options
- Export tags and/or constants
- Export all elements of the table or just the elements that are being used in the program on the current CPU
- Click OK. The export file is generated. Errors and warnings generated during export appear on the Info tab of the Inspector window.