User Tools

Site Tools


eeros_architecture:control_system:available_blocks:socket

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
eeros_architecture:control_system:available_blocks:socket [2017/09/13 15:30] – [Parameters] grafeeros_architecture:control_system:available_blocks:socket [2021/04/22 12:20] (current) – [Parameters] ursgraf
Line 12: Line 12:
  
 ===== Parameters ===== ===== Parameters =====
-When constructing a socket data block you can pass the ip-address, the port number, and the period of the internal thread as parameters. If you pass an empty string as ip-address, a socket server will be created. Setting the ip-address will cause a socket client to be created, which tries to connect to the given ip-address. +When constructing a socket data block you can pass the ip-address, the port number, the period of the internal thread, and the read timeout time as parameters. If you pass an empty string as ip-address, a socket server will be created. Setting the ip-address will cause a socket client to be created, which tries to connect to the given ip-address. 
 The period of the internal thread determines the transceiver frequency. The period of the internal thread determines the transceiver frequency.
 <code cpp> <code cpp>
Line 22: Line 22:
 </code> </code>
 This creates a socket client. Input and output signals will be transmitted twice per second. The client connects to a server on the ip-address '146.136.36.102' with port number '9876'. This creates a socket client. Input and output signals will be transmitted twice per second. The client connects to a server on the ip-address '146.136.36.102' with port number '9876'.
 +
 +Both server and client transmit and receive with a thread frequency of 0.5s. It makes sense to choose the same frequency for both partners. If one of them has a lower frequency, the communication will happen with this lower frequency.
 +
 +The last parameter is the timeout time. If not specified, it will be 1 second. This is the time a socket data block tries to read from a socket connection. If the other side suddenly stops the connection, the socket data block will stop trying to read after this timeout out and will report a message.
 ===== Miscellaneous ===== ===== Miscellaneous =====
-As soon as a client connects to a socket server a connection is up and running until either one of them stops. It is possible to stop the server or the client and restart it subsequently. In both cases a new connection will be established. +As soon as a client connects to a socket server a connection is up and running until either one of them stops. It is possible to stop the server or the client and restart it subsequently. In both cases a new connection will be established. \\ 
 +As long as the connection is not yet open the ''SocketData'' block will have output values being zero. As soon as the connection is broken the block will set its output values back to zero.
eeros_architecture/control_system/available_blocks/socket.1505309408.txt.gz · Last modified: 2017/09/13 15:30 by graf