Skip to main content

TCP/IP Module Configuration


TCP/IP Module Configuration

This section describes how to configure the **TCP/IP communication module** and describes each configuration parameter.

Table of Contents

Options Diagram​

ConfigurationDiagram

Configuration Parameters Description​

ParameterDefault valueDescription
Tcp Server
IpProtocolTypeIPv4The type of IP Protocol. IPv4, IPv6 or Both.
PortNumberThe connection port number.
Tcp Client
IpProtocolTypeIPv4The type of IP Protocol. IPv4 or IPv6.
AutoReconnectiontrueOn/Off auto-reconnection for TCP client.
ReconnectionDelay5000The time delay in milliseconds after which TCP client reconnection will be done.
DestinationServersList of servers to which client establishes the connection. (HostName, PortNumber)
ReconnectAfterTelegramReceivedfalseTCP Client Reconnect after every Telegram received.
ReconnectAfterTelegramSentfalseTCP Client Reconnect after every Telegram sent.
Tcp Receiver
ProducerTypeByteArrayDefines the type of data that is generated by the TCP Handler.
HeaderLengthIncludedInTelegramLengthtrueFlag that indicates whether length of header is included in length of whole telegram.
ReadingTimeout1000The reading timeout in milliseconds.
UseFixedTelegramLengthfalseFlag that indicates whether telegram length is fixed.
FixedTelegramLengthSize of fixed telegram length.
ValidateValuesAgainstConstraintsfalseUse telegram constraint validation.
DisconnectWhenInvalidTelegramReceivedfalseIf telegram definition doesn't exist or length of a telegram not match the definition, TCP will disconnect.
CustomProvidedTelegramMappingsUse custom provided telegram id mapping.
Tcp Sender
ConsumerTypeByteArrayDefines the type of data that is consumed by the TCP Handler.
SendingTimeout1000The sending timeout in milliseconds.
OverwriteTelegramIdInHeaderfalseOverwrite telegram ID in header according to the definition if there is a risk that provider will not set the value correctly.
Decoding Configuration
TextEncodingASCIIThe encoding used for text fields.
EndiannessLittleEndianDefines in which order bytes will be read. Little or Big endian.
LeftTrimStringsfalseRemove all leading white-space characters from text fields.
RightTrimStringsfalseRemove all trailing white-space characters from text fields.
AllowInfinityValuestrueDetermines whether to allow infinity values, otherwise telegrams with infinity values are rejected.
IncludePlusSignAtBeginThe plus sign will be added before number and it will use one byte from number length.
MoveSignWhenPaddingThe sign character will be moved to the first byte on the left side.
CustomStringPaddingPadding text field with specified 'Pad Character' up to field length.
CustomStringPaddingCharSpacePadding character used for string fields.
CustomIntegerPaddingfalsePadding integer field with specified 'Pad Character' up to field length.
CustomIntegerPaddingCharSpacePadding character used for integer fields.
CustomIntegerPaddingAlignmentLeftWhen padding is used, the content of the field is aligned to the left or right.
CustomDecimalPaddingfalsePadding decimal field with specified 'Pad Character' up to field length.
CustomDecimalPaddingCharSpacePadding character used for decimal fields.
CustomDecimalPaddingAlignmentLeftWhen padding is used, the content of the field is aligned to the left or right.
Data Dump
TargetDirectoryPath where dump files will be saved.
DataDumpStrategyDoNotDumpA 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": "####"
}
}
}