EasyManua.ls Logo

Siemens SIMATIC NET S7-300 - Page 165

Siemens SIMATIC NET S7-300
317 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
6 Programmed Communication Connections
A-165
S7-CPs for Industrial Ethernet Configuring and Commissioning
Release 01/2007
C79000-G8976-C182-07
Example
Below, you will find a sample of a configuration data block with the parameter field
for system data and a parameter field for a TCP connection.
Table 6-1 CONF_DB
STL Ex-
plana -
tion
DATA_BLOCK DB271
TITLE=IP_CONFIG for 1 active nTCP connection,
AUTHOR : Alfred //CP data : IP=200.12.1.144, Router=200.12.1.80
FAMILY : AS300 //Connection data: Destination IP addr=200.12.1.99,
NAME : ipconf //Local port = 4001, remote port = 5001, estab=active
VERSION : 1.0 //07-June-2005
STRUCT
DB_TYP : INT := 1; //
// --------------------------------------------------------- System Data ------
sys_pb : INT:=0; // Subfield type: System data for CP
sys_id : INT:= 0; // System parameter ID, always 0
sys_sb_cnt: INT:= 3; // Number of subfields in
// System parameter field
ip_addr: SUB_IP_V4; // IP address of the CP
ip_netmask: SUB_NETMASK; // Subnet mask of the CP
ip_router: SUB_DEF_ROUTER; // Default router
// --------------------------------------------------------- tcp VB 01 ---------
tcp_pb_01 : INT := 1; // Subfield type: TCP connection
tcp_id_01 : INT := 1; // 1. TCP_VB
tcp_sb_cnt_01 : int := 6; // 6 Elements per TCP connection
tcp_vb_ip_01 : SUB_IP_V4; // IP address of the partner
tcp_loc_01 : SUB_LOC_PORT; //
tcp_rem_01 : SUB_REM_PORT; //
tcp_vb_01_name : CON_NAME_L; //
tcp_vb_01_kbus : SUB_KBUS_ADDR; // Relevant only for S7-400
rq_01 : ACT_CN_REQ;//
// ------------------------------------------------------------------------------
END_STRUCT ;
BEGIN
tcp_loc_01.port := 4001; // Definition of ports when value of
tcp_rem_01.port := 5001; // differs from predefinition !
END_DATA_BLOCK
// ------------------------------------------------ end ”IP_CONF_DB_271” -----

Table of Contents

Other manuals for Siemens SIMATIC NET S7-300

Related product manuals