Samples

For both communication paths (Mapping vs. PLC library) with a Siemens S7 Controller, a separate sample is available to download in each case.

Sample

Description

TF6620_S7CommunicationSample_PLC

This sample shows how the PLC library Tc3_S7Comm can be used to establish a communication link with an S7 Controller and to read or write data points.

TF6620_S7CommunicationSample_SysMan

This sample shows how the S7 communication link can be configured as TwinCAT I/O device to read or write data points from an S7 Controller.

Download

Sample code and configurations for this product can be obtained from the corresponding repository on GitHub: https://github.com/Beckhoff/TF6620_Samples . There you have the option to clone the repository or download a ZIP file containing the sample.

Samples 1:

Further Information

The samples originate from an imaginary S7 Controller (S7-1500), which can be reached in the local network under the IP address 192.168.179.1. This controller was configured for the S7 protocol access and provides the following variables in the DATA_BLOCKS data area:

Samples 2:

Please adapt these samples to match your operating environment.

In the PLC sample, the function block instance of type FB_S7CommConnection is pre-initialized with the TCP/UDP RT module. This is done using the Symbol Initialization tab in the properties of the PLC project instance.

Samples 3: