modelPartialTCPCommunicator
Partial Model of TCP-Interface, minimum code which needs additional information
Extends from Modelica.Blocks.Interfaces.DiscreteMIMO (Multiple Input Multiple Output discrete control block).
Information
This is a partial model for a model which handles TCP communication. It only establishes a connection to a server on a certain port and terminates it when the simulation ends.
Check TCPCommunicatorExample for an algorithm example for sending and receiving telegrams.
Note a server needs to be accessible for communication.
Higher Level protocols (>OSI-Level 5) need to be added depending on the specific application.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| SI.Time | samplePeriod (from DiscreteBlock) | Sample period of component | |
| SI.Time | startTime (from DiscreteBlock) | 0 | First sample time instant |
| Integer | nin (from DiscreteMIMO) | 1 | Number of inputs |
| Integer | nout (from DiscreteMIMO) | 1 | Number of outputs |
| String | IP_Address | "127.0.0.1" | IP address or name of server |
| Integer | port | 27015 | Port on server |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Blocks.Interfaces.RealInput[nin] | u (from DiscreteMIMO) | Connector of Real input signals | |
| Modelica.Blocks.Interfaces.RealOutput[nout] | y (from DiscreteMIMO) | Connector of Real output signals |
Revisions
- August 25, 2018
by Thomas Beutlich:
Utilize TCPIPSocketClient from Modelica_DeviceDrivers library. This is for:#277 - January 25, 2016
by Ana Constantin:
Added socketHandle to allow for more than one socket in a model - October 07, 2015
by Georg Ferdinand Schneider:
Revised for publishing - September 24, 2013
by Georg Ferdinand Schneider:
First implementation