Marine systems simulation

TCP/IP client.

+ Collaboration diagram for TCP client:
Author
Biao Su

This class enables communications via TCP interface. It creats a TCP/IP client on Localhost (127.0.0.1 Port number: 5000), or a specified IP address and port number. At present it can only send messages consist of double precision numbers (8 Bytes).

Example configuration excerpt

<Lib
LibName = "aquarobotics_interfaces"
SimObject = "TCP/client"
Name = "TCP"
ServerIPAddress = "127.0.0.1"
ServerPortNumber = "5000"
NumberOfMessagesToSend = "4"
NumberOfMessagesToReceive = "6"
SetInitialMessagesToReceive = "false"
ShowTCPResultOnScreen = "false"
ReceiveInMultipleRounds = "false"
CommunicationInterval = "1"
CommunicationStartingTime = "0"
/>

Input ports

Name Width Description
MessagesToSend <NumberOfMessagesToSend> A vector of values received from client.

Output ports

Name Width Description
MessagesReceived <NumberOfMessagesToReceive> A vector of values to be sent to client.

Configuration parameters

Name Width Description
ServerIPAddress 1 The server IP address.
ServerPortNumber 1 The server port number.
NumberOfMessagesToSend 1 The number of double values to send.
NumberOfMessagesToReceive 1 The number of double values to receive.
SetInitialMessagesToReceive 1 If enabled the initial value of MessagesReceived can be set by a configuration parameter. If not it is zero by default.
InitialMessagesToReceive <NumberOfMessagesToReceive> The initial value of MessagesReceived.
ShowTCPResultOnScreen 1 Log the activity of the TCP server to file and console.
ReceiveInMultipleRounds 1 This enables the possibility to receive the output vector of size NumberOfMessagesToReceive through several UDP packets.
CommunicationInterval 1 The interval between reading and writing messages.
CommunicationStartingTime 1 The startup time for reading and writing messages.

Full example