Siemens S7 Driver

Not counted towards your tag license limit.

Driver Errors: To learn more about the cause of an error condition, refer to the Driver Summary Report and the Driver Error Report, both of which are available in the Reports page. The Show Stats button will also provide current and last error messages: Show Statistics Button Widget

Siemens S7 drivers will commonly connect to TCP on port # 102, although variations may be found.

For S7-300 and S7-400, the CPU will normally be at slot 2, but for the S7-1200 PLC system the CPU will always be at slot 1, which is different from the default setting.

Reference Notes:

Communication with the PLC is via ISO over TCP.

This driver has the ability to save the last value written to each output tag, and to rewrite those values, either automatically when lost communications are restored, or manually by the press of a button. Carefully review the information in the Options tab to decide whether this feature should be used in your application. If this driver is being used in conjunction with a Driver Multiplexer, then configure the Driver Multiplexer to store the last values, not the drivers connected to the Multiplexer. In this case, only the Multiplexer should be configured to re-write automatically.

When this driver is used in combination with a TCP/IP tag, the standard TCP port is 102.

Required PLC Settings

For both of the following tasks, use the PLC manufacturer’s programming software, not VTScada.

  • If using the newer S7 1200 PLCs (possibly others as well), you must select the "Permit access with PUT/GET communication from remote partner" option in the PLC CPU properties.
  • When addressing tags using data blocks, you must deselect the "Optimized block access" option on the data blocks and program blocks in order to determine the byte offset of the individual variables in the blocks.

 

Server List

Select (or create) a named server list. (Driver Server Lists) Servers for the list must be defined using the Application Configuration dialog, as described in Servers for Specific Services. Smaller sites that do not have multiple servers, or that use only the default server list, need not configure this field.

Siemens S7 Driver properties Options tab

The Options tab for the Siemens S7 driver tag properties folder consists of attributes used to identify and establish a connection to the control device to be associated with this driver.

Siemens tag options tab

PLC Type

Address parsing differs for the S7-200 device. For all other S7 devices, choose the option, "other".

Priority

Two priority levels are available: OP Mode (low priority) and PG Mode (high priority). Note that there may be a limit on the number of PG mode connections which are available.

Rack and Slot

Specify the CPU position. These can be determined from the hardware configuration. Note that these fields do not apply to the S7-200 CPU.

CP Type

If you are connecting to a Siemens PLC through a communications processor, select it here, otherwise select None.

Options include: CP-243, CP-343 and CP-443.

Store Last Output Values

When selected, the driver will maintain a record of the last value written to each output address. This may be useful in at least two situations:

  • For hardware that does not maintain its state during a power loss and must be restored to that state when re-started.
  • When failed hardware is replaced by a new device and you would like to start that device with the values last written to the old one.

If the last output values are stored, they may be re-written by either of two methods:

  • Automatically, when communication is restored to the device.
  • Manually by way of a button press. See, Rewrite Outputs Widget for details.

Changing this value from selected to deselected will cause all stored values to be erased immediately.

If this driver is being used in conjunction with a Driver Multiplexer, then configure the Driver Multiplexer to store the last values, not the drivers connected to the Multiplexer. In this case, only the Multiplexer should be configured to re-write automatically.

Enable Auto Rewrite

If selected, the Store Last Output Values option will also be activated. This option causes the driver to rewrite the last value written to each output, in the event that communications are lost and then restored.

Use this option only if you are certain that you want the last values to be rewritten automatically after an interruption in driver communications.

Siemens S7 Driver properties Serial tab

The Serial tab for the Siemens S7 driver tag properties folder consists of attributes used to identify and establish a connection to the control device to be associated with this driver.

Siemens tag serial tag

Port

Since the only protocol available is ISO over TCP, you should configure and select a TCP Port.

Time-Out Limit and Retries

A half second time out limit with one retry is recommended as a reasonable value for a Siemens PLC.

Retries

The number of times to retry a message before declaring an error.

Use only if the driver is connected to a device that uses a serial port or a UDP/IP port that is configured to be polled. When connected directly to a device using TCP/IP, this value should normally be set to 0 since TCP/IP is a guaranteed message delivery protocol.
For unreliable communications, such as radio, set to 3 or 4.

Hold

Select this to have I/O tags attached to the driver hold their last value in the event of a communication failure. If not selected, tags will have their value set to invalid on a communication failure.

Protocol Timeout

Timeout period, after which a lack of protocol traffic is considered an error. Default: 30 seconds.

Initial Max Packet Length

Maximum PG/OP packet length used for initial communication with the PLC. This value will not be used after length negotiation with the PLC is complete. Default: 240.

Max. Outstanding Requests

Defines the maximum number of PG/OP packets that may be outstanding. Default: 1 outstanding request.

Max Items Per Request

Defines the maximum number of item addresses to include in a request. Default: 18 items.

Max Requests per Semaphore

Defines the maximum number of requests that can be sent in one semaphore acquisition. Default: 100 requests.

Max Time per Semaphore

Defines the maximum amount of time to hold the semaphore. Default: 1 second.