Use the Siemens TCON function block
To establish an open TCP connection the following communication blocks are available
in the Siemens standard library (
Communication
->
Open user communication
->
Others
):
■
“TCON” for establishing the connection
■
“TDISCON” for terminating the connection
■
“T_CONFIG” to configure the interface
In this example the “TCON” (see image below) is called in OB1 with the instance data
block “TCON_DB”. In the case of a reboot, the “#Initial_Call” flag triggers the TCON FB
to open the TCP communication. The ID of the TriSpector1000 FB Input must have the
same value as the ID input of the TCON FB (will be set up in next step).
The connection parameters (input parameter “CONNECT”) for setting up the TCP con‐
nection are stored in an automatically generated data block. Please open the “Proper‐
ties” of the TCON FB to make the settings and generate the data block.
12
APPENDIX
88
O P E R A T I N G I N S T R U C T I O N S | TriSpector1000
8021808/12ID/2019-01 | SICK
Subject to change without notice