IEC driver config file
This page provides sample IEC driver config files. Please refer to Possible IEC driver config entries for details on the entries.
It is not possible to mix IEC 101 and IEC 104 in one driver! This requires two drivers.
With the WinCC OA version 3.10 the internal DPE _IecConnection.Config.ConnInfo was implemented. This replaces the config entries "connection" and "connection_101". Thus, the creation of new connections can take place in the panel for connection settings. Because of that an IEC driver restart is not necessary anymore when a new IEC device was added or if connection parameters (e.g. IP address) have changed. The entry from the internal DPE (if available) has a higher weight than this from the config file (if available).
IEC 104
For the correct start-up of an IEC104 driver the following config entries are possible:
Sample IEC 104 config file
Because WinCC OA is acting as a client in the example, you do not need to specify a tcpServerPort:
[iec_1]
connection = "Gateway1" "GW1" 2404 10 //Connection to Gateway1
connection = "Gateway2" "GW2" 2404 10 //Connection to Gateway2
Definition of terms:
-
"Gateway1" (name): (Logical) name of this connection. For each connection there is one data point "_<name>" of the "_ IecConnection" type. These DPs are automatically created on the panel for connections. For redundant drivers the name of both replicas must differ as follows: e.g. "name" on $HOST1 and "name_2" on $HOST2.
-
"GW1" (host): Name (or IP address) of the host the driver is supposed to connect to and from which it accepts a connection, e.g. eiwnt160, for a remote computer or localhost if using your own computer.
-
2404 (port): Port number if the driver is a TCP client and attempts to connect on its own, or 0 if the driver is a TCP server. In the latter case, the " tcpServerPort" entry must exist.
-
10 ( timeout): Timeout interval at which the driver attempts to connect on the TCP level if it is a TCP client.
In theory for IEC-104 up to 32766 connections can be established! In practice the range acts in accordance with the performance demands.
For each connection ("connection = " in the config file) there must be a DP of the type _IecConnection that is automatically created in the panel for connections (see Panel for connections).
IEC 101
Sample IEC 101 config file, unbalanced mode
WinCC OA is configured as master:
[iec_1]
connection_101 = "Gateway1" "Com1" 2
connection_101 = "Gateway2" "Com1" 1
device_101 = "Com1" "V24" "com1;9600, e,8,1"
balanced_101 = "No"
master_101 = "Yes"
timeout_t2 = 10000
sizeof_LA_101 = 1
# The configuration of the IEC101 driver under Linux:
[iec_1]
connection_101 = "Gateway1" "Ser0" 5
device_101 = "Ser0" "V24" "/dev/ttyS0;9600,e,8,1"
station_101 = 1
balanced_101 = "no"
master_101 = "Yes"
timeout_t2 = 1000
sizeof_LA_101 = 1
Definition of terms:
-
"Gateway1"(<name>): (Logical) name of this connection, analogous to an IEC104 connection
-
"Com1"(< devname>): Name of a device_101
-
2(<101 link address>): Logical address of the IEC101 partner in unbalanced mode
-
"V24"(<type>): Fixed "V24"(for a serial connection)
-
"com1;9600, e,8,1"(<Device data>): Used for device-specific data depending on type.
Device data is a string with this format: "port;baud,parity, databits, stopbits".
-
"No" (balanced_101): Specifies unbalanced mode transmission.
-
"Yes" (master_101): Specifies "iec_1" as controlling station. All other stations are then controlled (slave) stations. This entry is obsolete for balanced mode.
-
timeout_t2: The entry timeout_t2 is only relevant for the unbalanced mode and defines the polling interval within which the data is queried. If the time is e.g. 1 second the driver queries each substation in 1 second interval. The entry is defined in milliseconds.
-
1 (sizeof_LA_101): Number of bytes for link address. Necessary for unbalanced mode. Must be unequal 0!
Sample IEC 101 config file, balanced mode
Requires 2 drivers as balanced mode is being used (both stations have equal rights; in this example 2 drivers are used for testing purposes. In normal cases you need of course only one driver):
[iec_1]
connection_101 = "Gateway1" "Com1"
device_101 = "Com1" "V24" "com1;9600, e,8,1"
balanced_101 = "Yes" // balanced mode
Definition of terms:
-
"Yes" (balanced_101): Specifies balanced mode transmission .
The other entries mean the same as in unbalanced mode.
IEC 101 - Extension: Serial communication over TCP connection
The IEC 101 driver has been extended to be able to use a serial protocol also over a TCP connection. This functionality simplifies the usage ethernet-serial converter, because no virtual COM interface will be necessary anymore. The converter can be TCP server or TCP client and can be operated transparent or with RFC2217 mode. Therefore the config entry "device_101" must be modified.
device_101 = < devname> <type> <specific device data>
The settings for <devname> and <type> are the same as when using a serial connection without TCP but the <specific device data> has to be modified as follows:
tcp[s][rfc]:<Host:Port (IPv4 oder IPv6)> [tcp timeout]
Element | Description |
---|---|
tcp | Prefix which determines that a TCP connection should be used.. |
s | Additional parameter that defines if the connection is to a server. If s is not stated it is a client connection. (optional) |
rfc | Additional parameter that defines whether the RFC2217 Mode shall be used or not. (optional) |
Host |
Name or IP of the host Note The host name of a server must not be set. It will be ignored even when the host name is set for a server, i.e. the server will accept connections from any host name. |
Port | Port that should be used for the connection. This port number is the "listening port" for a server. |
tcp timeout | Time-out that should be used for the TCP connection. Default: 10 seconds. (optional) |
Example
The following 3 examples show possible configurations of the <specific device data> when using a TCP connection:
"tcp:127.0.0.1:3040" => Client with 10sec time-out
"tcps:localhost:3041 5" => Server with 5sec time-out
"tcprfc:[::1]:3042 2" => Client with RFC2217 mode, IPv6 address and 2sec time-out