...
Kotva | ||||
---|---|---|---|---|
|
...
This protocol supports a data reading/writing from the control PLC machines Siemens SIMATIC:
- types S7-300 and S7-400 equipped by an ethernet interface for the communication S7 ISO over TCP communication .
- types S7-1200, S7-1500
- types Siemens LOGO
- Siemens Microbox
Note: communication via Profinet/Profibus adapter ACCON-NetLink-PRO compact produced by company DELTALOGIC has been verified. Communication with multiple S-300 series PLCs on Profibus worked after firmware upgrade of adapter to version V2.54 (31. march 2015) with adapter's BIOS version V2.39 (7. June 2011). When the adapter's firmware was version V2.37 (8. august 2011), communication could not be correctly established.
Note: communication with PLC Siemens LOGO was tested. A part of memory that is accessible for reading/writing is the V area that which is seen as DB1.
Note: the protocol has a "big-endian" data representation.
...
- Communication line category: TCP/IP-TCP, TCP Redundant.
- IP address (addresses) is set according to a network configuration of a specific Siemens SIMATIC device.
- The port number is 102 (according to specification RFC 1006).
- The line number is not used, set on 1.
When the a TCP Redundant communication line is set as TCP Redundant configured, you can configure an IP address and port of a backup device. If a communication process lost the connection or is unable to connect to the device, it will switch periodically between the configured devices. KOM process tries to connect to a primary device at first.
Note: Multiple IP addresses of primary/backup device devices can also be configured (separated by commas or semicolons).
...
Parameter | Meaning | Unit / size | Default value | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Siemens Simatic rack number. | 0 to 7 | 0 | |||||||||||||||||
Kotva | Rack 0 is most often used. Note: when using the ACCON-NetLink-PRO compact adapter, the Rack/Slot parameters must be set so that the MPI address of the S7 with which the D2000 KOM process communicates is equal to 32 * Rack + Slot. It is therefore necessary to create a separate line with specific Rack/Slot values for each S7. It is also necessary to set "RFC Routing over CPs with TSAP" to ON in the adapter web interface. | 0 to 7 | 0 | |||||||||||||||||
| Siemens Simatic slot number. Slot 2 is most often used. | 0 to 31 | 0 | |||||||||||||||||
| S7 subnet address sent as a part of Remote TSAP if parameter Use long TSAP is set to True | 0x0 to 0xFFFF | 0 | |||||||||||||||||
| S7 subnet address sent as a part of Remote TSAP if parameter Use long TSAP is set to True | 0x0 to 0xFFFF | 0 | |||||||||||||||||
| The parameter allows the use of redundant PLCs, which may differ in the settings of some parameters (Rack, Slot, S7 Subnet ID). If its value is True, the primary and secondary parameters are used alternately when connecting to the PLC using the specified IP addresses. | - | False | |||||||||||||||||
| Connection resource, it enters as MSB byte to the calculation of the value of Remote TSAP at initialization of ISO Connection-request. /TSK1/Sending CR-TPDU: CLASS=0, SRC-REF=0x0001, TPDU size=1024, SRC-TSAP=10-00, DST-TSAP=03-02 After changing the Connection resource from 3 to 2, the communication started working. Note: according to Siemens documentation, the Connection Resource can be:
| slot | slot | SlotSiemens Simatic slot number. | 0 to 31 | 0 | Kotva | | conres | conres | Connection Resource (hex)Connection resource, it enters as MSB byte to the calculation of the value of Remote TSAP at initialization of ISO Connection-request.0x0 to 0xFF | 3 | ||||||||
| ISO Local TSAP (Transport Service Local Point). Source TSAP value during the initialization of ISO Connection-request. See the description of parameter Use long TSAP. | 0x0 to 0xFFFF | 0x1000 | |||||||||||||||||
| ISO Source Reference. Value of SRC-REF during the initialization of ISO Connection-request. | 0 to 65535 | 1 | |||||||||||||||||
| Enables a long format of local and remote TSAP which is sent during the connection setup phase. Short TSAP is 2 bytes long. Short local TSAP has the following format:
Full remote TSAP is 28 bytes long and it contains: Kotva | | mpiaddr | mpiaddr | - | False | MPI/Profibus address sent as a part of Remote TSAP, if parameter Use long TSAP is set to True | 0 to 126 | 1 | |||||||||||
Kotva |
| - | False | |||||||||||||||||
| MPI/Profibus | s7sub1 | s7sub1 | S7 Subnet ID-part 1 (hex)S7 subnet address sent as a part of Remote TSAP, if parameter Use long TSAP is set to True | 0x0 to 0xFFFF | 0 | Kotva | | s7sub2 | s7sub2 | S7 Subnet ID-part 2 (hex)S7 subnet address sent as a part of Remote TSAP , if parameter Use long TSAP is set to True0x0 0 to 0xFFFF1260 | 1 | ||||||||
| The maximum required size of ISO TPDU. The parameter value the initialization of ISO Connection-request. | 8192, 4096, 2048, 1024, 512, 256 or 128 bytes | 1024 bytes | |||||||||||||||||
| Maximum parallel communication threads. Increase the value if there is a request on demand for more data read from the device in a shorter time. | 1 to 4 | 1 | |||||||||||||||||
| The required time of one data reading cycle. | ms | 1000 ms | |||||||||||||||||
| Maximal wait time on a reply from the device. | ms | 2500 ms | |||||||||||||||||
| Delay which is used before sending a data request. When a high data transfer rate is required, set 0 ms. | sec.ms | 20 ms | |||||||||||||||||
| Delay before reconnection to the device if the connection has failed or some communication error has occurred. | sec.ms | 2 sec | |||||||||||||||||
| When Timeout passes and communication error occurs in all threads, a communication error status is set on the stations. The FALSE state is set on the communication line. | sec.ms | 20 sec | |||||||||||||||||
| Maximum PDU in bytes at S7 communication with the device. | 240, 480, 960 bytes | 480 bytes | |||||||||||||||||
| Setting "Tcp No Delay" parameter causes the low-level socket option TCP_NODELAY to be set, thus turning off the default packet coalesce feature. | - | False | |||||||||||||||||
| Activates a debug info about the loaded received values of I/O tags. Use this parameter only when communication must be debugged because it highly uses CPU and slows down the communication. | YES/NO | NO | |||||||||||||||||
| Activates a debug info about a the binary content of packets. Use this parameter only when communication must be debugged because it highly uses CPU and slows down the communication. | YES/NO | NO | |||||||||||||||||
| Activates a basic debug info about requested data. | YES/NO | YES | |||||||||||||||||
| Activates a basic debug info about received packets. | YES/NO | YES |
...
- Communication protocol: Siemens SIMATIC S7 ISO over TCP.
- No station address, no protocol parameters on the station.
- The time parameter setting is ignored. See the line parameter Cycle Time.
- Time synchronization of the device is not supported.
Kotva | ||||
---|---|---|---|---|
|
...
; | Optional parameter. It disables the I/O tag from communication, stops the I/O tag address check when it is saved, and can be useful when the communication with the device is activated or debuggeduseful when the communication with the device is being developed or debugged. Note: Also an I/O tag with an address starting with %IGNORE will be ignored. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
S7:[connectionname] | Optional parameter. It does not contain any useful information but it is supported only because of backward compatibility with the Siemens SimaticNET OPC server. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DB | Data block. S7 variable identifier from "Data block". | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DI | Instance data block. S7 variable identifier from " Instance data block". | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<no> | A number of "data block" number or "instance data block" number. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<object> | Specification of block or area in S7 PLC. Possible values:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<type> | The data type of S7. It is not specified for T, C, and S objects.
| <type> | Data type of S7. It is not specified for T, C and S objects.
Note: The CHARARR type is a D2000 extension that allows you to read/write an array of CHARs as a string. This type is not compatible with the Siemens SimaticNET OPC server addressing.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<address> | Address of variable. Possible types:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<items> | The number of elements for structured I/O tags with configured Destination column. Every read element (1,2,3 .. items) will be written to one item of the destination column. Structured I/O tags are not supported for objects of type T (timers), C (counters), and S (system status lists) nor for data type STRING. Note: All "items" elements are read at once. If e.g. 100 elements of type D (double word) are configured, it means reading of a block of 400 bytes. If a smaller size of the packet (S7 PDU size) is agreed on during the establishment of connection, reading of this I/O tag will not be performed and the trace file of the line will contain an error message. Agreed S7 PDU size is minimum of size offered by D2000 (parameter S7 PDU Size) and supported size of a specific device. Note: the syntax of address when specifying the number of elements is compatible with Siemens S7 OPC server (e.g. S7:[MyPLC]DB120,INT1050, 24), which facilitates a simple transition from OPC communication to Siemens SIMATIC S7 ISO on TCP protokol protocol by configuring a new line, a new station and then changing the parent of I/O tags (e.g. via CSV or XML export and import). Example of addresses:
|
...
There have been reported cases when a communication with a device (specifically, Simatic S7-1200) was established, but after sending a read request the device didn't send required data but a packet with ResultCode = 0x8104, that is 33028 decimal.
According to http://stackoverflow.com/questions/23745407/libnodave-error-while-reading-from-siemens-s7-1200-0x8104, the problem is insufficient access rights. The cause is a new security option that was added to TIA Portal 12 and higher that , which by default disallows remote access to read/update blocks. Without this option disabled, only Siemens tools have access to the data.
Configuration: in TIA, under the properties for the CPU project, select "Protection"; there is an option for "Permit access with PUT/GET communications from the remote partner" and set also "Access level" according to the following screenshot.
Note: in practice, read/write access has been tested with Simatic S7-1500 even with "Access level" = "HMI access", with "Permit access with PUT/GET communications from remote partner" enabled.
In the case of TIA Portal version 14, the setting "Permit access with PUT/GET communications from the remote partner" is on a dedicated tab "Connection mechanisms" under "Protection & Security":
...
For the communication with these devices to work, beside besides the settings described in the note above, it is necessery necessary to disable "Optimized block access" in the TIA Portal tool. Following The following screenshot is taken in TIA Portal version 12:
After changing the security settings in TIA Portal, it is necessary to go to the menu Compile → "Software (Rebuild all)" and after compiling to uploat the project to PLC. Partial rebuild may not be sufficientcompiling to upload the project to PLC. A partial rebuild may not be sufficient.
As of STEP 7 V17, the following procedure is advised to get the communication working: use Online & diagnostics to perform a Reset to Factory Settings and mark the box labeled "Delete password for protection of confidential PLC configuration data".
Kotva | ||||
---|---|---|---|---|
|
...
- RFC 1006, "ISO Transport Service on top of the TCP, Version: 3", May 1987.
- International Standard ISO/IEC 8073:1997, "Information technology - Open Systems Interconnection - Protocol for providing the connection-mode transport service."
- International Standard ISO/IEC 8072:1996, "Information technology - Open Systems Interconnection - Transport service definition."
Info | ||
---|---|---|
| ||
You can read blogs about the Siemens SIMATIC S7 ISO on TCP communication protocol: |
Kotva | ||||
---|---|---|---|---|
|
...
- Ver. 1.0 - September 17, 2010 - Document written.
- Ver. 1.1 - July 2, 2020 - Support for CHARARR.
- Ver. 1.2 - July 9, 2020 - Support for BCD and LBCD.
- Ver. 1.3 - August 27, 2020- Support for Siemens Microbox
Info | ||
---|---|---|
| ||
...