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

TypeNameDefaultDescription
SI.TimesamplePeriod (from DiscreteBlock)Sample period of component
SI.TimestartTime (from DiscreteBlock)0First sample time instant
Integernin (from DiscreteMIMO)1Number of inputs
Integernout (from DiscreteMIMO)1Number of outputs
StringIP_Address"127.0.0.1"IP address or name of server
Integerport27015Port on server

Connectors

TypeNameDefaultDescription
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