Siemens S7
Review the following information to set up and configure the Siemens S7 driver.
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 Litmus 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 Litmus Edge DeviceHub
- Step 3: Configure the List of Registers
If the device is configured for Ethernet access, find its network parameters. Otherwise, follow the steps below.
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.
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.
Parameter | Value |
---|---|
Type | Siemens |
Driver | Siemens S7 |
Network Address | The device address you defined during Step 1 |
Port | 102 |
Slot | Set based on your PLC configuration. Default slot values for the S7 Series controllers are as follows:
|
NOTE: The address format in this Gen 2 driver is different from the (Siemens S7-Advanced (Gen1)) for the same device. Learn more about Gen1 and Gen2 Driver Differences.
Name | Value Types | Address Format | 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 | 0 | 65535 | Data block, absolute address |
DB(bit) | bool | DDDDDd | 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 | 0 | 65535 | M memory |
M(bit) | bool | DDDDDd | 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 | 0 | 65535 | Input area |
I(bit) | bool | DDDDDd | 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 | 0 | 65535 | Output area |
Q(bit) | bool | DDDDDd | 0 | 655357 | Output area (bits) |
Most users of Siemens PLCs and TIA Portal are familiar with the convention for absolute addressing, which may look like this: DB2.DBx0.7. This address refers to Data Block 2, byte 0, bit 7. To add this tag to a Litmus Edge device using the Siemens S7 driver, enter the following tag parameters:
- Name: DB(bit)
- Value Type: bool
- DB: 2
- Address: 07
- Litmus Edge only allows integers in the "Address" field. When entering addresses of bits, delete the bit delimiter.
Here is another example of a Siemens address that a user may want to add as a DInt type in Litmus Edge: DB40.DBD20
- Name: DB
- Value Type: dint
- DB: 40
- Address: 20
The last character in the absolute addressing format signifies the size of the register. The following table shows some examples of data types you may want to use based on the size of the register.
Siemens size character | Size (bits) | Data type examples |
---|---|---|
x | 1 | Bool |
B | 8 | Byte Char |
W | 16 | Int UInt Word |
D | 32 | DInt DWord Real UInt |
(None) | 64 | LInt LReal ULInt |
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.