TCP/IP Module Configuration
TCP/IP Module Configuration
This section describes how to configure the **TCP/IP communication module** and describes each configuration parameter.
Options Diagram
Configuration Parameters Description
| Parameter | Default value | Description |
|---|---|---|
| Tcp Server | ||
| IpProtocolType | IPv4 | The type of IP Protocol. IPv4, IPv6 or Both. |
| PortNumber | The connection port number. | |
| Tcp Client | ||
| IpProtocolType | IPv4 | The type of IP Protocol. IPv4 or IPv6. |
| AutoReconnection | true | On/Off auto-reconnection for TCP client. |
| ReconnectionDelay | 5000 | The time delay in milliseconds after which TCP client reconnection will be done. |
| DestinationServers | List of servers to which client establishes the connection. (HostName, PortNumber) | |
| ReconnectAfterTelegramReceived | false | TCP Client Reconnect after every Telegram received. |
| ReconnectAfterTelegramSent | false | TCP Client Reconnect after every Telegram sent. |
| Tcp Receiver | ||
| ProducerType | ByteArray | Defines the type of data that is generated by the TCP Handler. |
| HeaderLengthIncludedInTelegramLength | true | Flag that indicates whether length of header is included in length of whole telegram. |
| ReadingTimeout | 1000 | The reading timeout in milliseconds. |
| UseFixedTelegramLength | false | Flag that indicates whether telegram length is fixed. |
| FixedTelegramLength | Size of fixed telegram length. | |
| ValidateValuesAgainstConstraints | false | Use telegram constraint validation. |
| DisconnectWhenInvalidTelegramReceived | false | If telegram definition doesn't exist or length of a telegram not match the definition, TCP will disconnect. |
| CustomProvidedTelegramMappings | Use custom provided telegram id mapping. | |
| Tcp Sender | ||
| ConsumerType | ByteArray | Defines the type of data that is consumed by the TCP Handler. |
| SendingTimeout | 1000 | The sending timeout in milliseconds. |
| OverwriteTelegramIdInHeader | false | Overwrite telegram ID in header according to the definition if there is a risk that provider will not set the value correctly. |
| Decoding Configuration | ||
| TextEncoding | ASCII | The encoding used for text fields. |
| Endianness | LittleEndian | Defines in which order bytes will be read. Little or Big endian. |
| LeftTrimStrings | false | Remove all leading white-space characters from text fields. |
| RightTrimStrings | false | Remove all trailing white-space characters from text fields. |
| AllowInfinityValues | true | Determines whether to allow infinity values, otherwise telegrams with infinity values are rejected. |
| IncludePlusSignAtBegin | The plus sign will be added before number and it will use one byte from number length. | |
| MoveSignWhenPadding | The sign character will be moved to the first byte on the left side. | |
| CustomStringPadding | Padding text field with specified 'Pad Character' up to field length. | |
| CustomStringPaddingChar | Space | Padding character used for string fields. |
| CustomIntegerPadding | false | Padding integer field with specified 'Pad Character' up to field length. |
| CustomIntegerPaddingChar | Space | Padding character used for integer fields. |
| CustomIntegerPaddingAlignment | Left | When padding is used, the content of the field is aligned to the left or right. |
| CustomDecimalPadding | false | Padding decimal field with specified 'Pad Character' up to field length. |
| CustomDecimalPaddingChar | Space | Padding character used for decimal fields. |
| CustomDecimalPaddingAlignment | Left | When padding is used, the content of the field is aligned to the left or right. |
| Data Dump | ||
| TargetDirectory | Path where dump files will be saved. | |
| DataDumpStrategy | DoNotDump | A strategy for dumping telegram data. (DoNotDump, DumpOnErrorsOnly, DumpAll) |
Examples of settings file
{
"TCP": {
"TcpConnectionType": "Sever",
"IpProtocolType": "IPv4",
"Server":
{
"PortNumber": "1111",
"Sender":
{
"ConsumerType": "ByteArray",
"OutgoingConfiguration":
{
"TextEncoding": "ASCII",
"Endianness": "LittleEndian",
"LeftTrimStrings": false,
"RightTrimStrings": false,
"AllowInfinityValues": true,
"IncludePlusSignAtBegin": false,
"MoveSignWhenPadding": false,
"CustomStringPadding": false,
"CustomStringPaddingChar": " ",
"CustomIntegerPadding": false,
"CustomIntegerPaddingChar": "0",
"CustomIntegerPaddingAlignment": "Right",
"CustomDecimalPadding": false,
"CustomDecimalPaddingChar": "0",
"CustomDecimalPaddingAlignment": "Right"
},
"SendingTimeout": 1000,
"OverwriteTelegramIdInHeader": false,
"DataDumpOptions":
{
"TargetDirectory": "",
"DataDumpStrategy": "DoNotDump"
}
},
"Receiver":
{
"ProducerType": "ByteArray",
"IncomingConfiguration":
{
"TextEncoding": "ASCII",
"Endianness": "LittleEndian",
"LeftTrimStrings": false,
"RightTrimStrings": false,
"AllowInfinityValues": true,
"IncludePlusSignAtBegin": false,
"MoveSignWhenPadding": false,
"CustomStringPadding": false,
"CustomStringPaddingChar": " ",
"CustomIntegerPadding": false,
"CustomIntegerPaddingChar": "0",
"CustomIntegerPaddingAlignment": "Right",
"CustomDecimalPadding": false,
"CustomDecimalPaddingChar": "0",
"CustomDecimalPaddingAlignment": "Right"
},
"HeaderLengthIncludedInTelegramLength": true,
"ReadingTimeout": 1000,
"UseFixedTelegramLength": false,
"FixedTelegramLength": 0,
"ValidateValuesAgainstConstraints": false,
"DisconnectWhenInvalidTelegramReceived": false,
"UseCustomProvidedMappings": false,
"CustomProvidedTelegramMappings": [],
"DataDumpOptions":
{
"TargetDirectory": "",
"DataDumpStrategy": "DoNotDump"
}
}
},
"Client":
{
"DestinationServers": [],
"AutoReconnection": true,
"ReconnectionDelay": 1000,
"Sender":
{
"ConsumerType": "ByteArray",
"OutgoingConfiguration":
{
"TextEncoding": "ASCII",
"Endianness": "LittleEndian",
"LeftTrimStrings": false,
"RightTrimStrings": false,
"AllowInfinityValues": true,
"IncludePlusSignAtBegin": false,
"MoveSignWhenPadding": false,
"CustomStringPadding": false,
"CustomStringPaddingChar": " ",
"CustomIntegerPadding": false,
"CustomIntegerPaddingChar": "0",
"CustomIntegerPaddingAlignment": "Right",
"CustomDecimalPadding": false,
"CustomDecimalPaddingChar": "0",
"CustomDecimalPaddingAlignment": "Right"
},
"SendingTimeout": 1000,
"OverwriteTelegramIdInHeader": false,
"DataDumpOptions":
{
"TargetDirectory": "",
"DataDumpStrategy": "DoNotDump"
},
"ClientReconnectAfterTelegramSent": false
},
"Receiver":
{
"ProducerType": "ByteArray",
"IncomingConfiguration":
{
"TextEncoding": "ASCII",
"Endianness": "LittleEndian",
"LeftTrimStrings": false,
"RightTrimStrings": false,
"AllowInfinityValues": true,
"IncludePlusSignAtBegin": false,
"MoveSignWhenPadding": false,
"CustomStringPadding": false,
"CustomStringPaddingChar": " ",
"CustomIntegerPadding": false,
"CustomIntegerPaddingChar": "0",
"CustomIntegerPaddingAlignment": "Right",
"CustomDecimalPadding": false,
"CustomDecimalPaddingChar": "0",
"CustomDecimalPaddingAlignment": "Right"
},
"HeaderLengthIncludedInTelegramLength": true,
"ReadingTimeout": 1000,
"UseFixedTelegramLength": false,
"FixedTelegramLength": 0,
"ValidateValuesAgainstConstraints": false,
"DisconnectWhenInvalidTelegramReceived": false,
"UseCustomProvidedMappings": false,
"CustomProvidedTelegramMappings": [],
"DataDumpOptions":
{
"TargetDirectory": "",
"DataDumpStrategy": "DoNotDump"
}
"ReconnectAfterTelegramReceived": false
}
}
}
}
Basic TCP/IP Client connection configuration
{
"TCP": {
"ConnectionType": "Client",
"DestinationServers": {
"0": {
"Host": "localhost",
"port": "####"
}
}
}
}
Basic TCP/IP Server connection configuration
{
"TCP": {
"ConnectionType": "Server",
"Server": {
"PortNumber": "####"
}
}
}