Buildings.Utilities.IO.BCVTB.BaseClasses

Package with base classes for BCVTB interface

Information


This package contains base classes that are used to construct the models in 
Buildings.Utilities.IO.BCVTB.

Extends from Modelica_Fluid.Icons.BaseClassLibrary (Icon for library).

Package Content

NameDescription
Buildings.Utilities.IO.BCVTB.BaseClasses.closeClientSocket closeClientSocket Closes the socket for the inter process communication
Buildings.Utilities.IO.BCVTB.BaseClasses.establishClientSocket establishClientSocket Establishes the client socket connection
Buildings.Utilities.IO.BCVTB.BaseClasses.exchangeReals exchangeReals Exchanges values of type Real with the socket


Buildings.Utilities.IO.BCVTB.BaseClasses.closeClientSocket

Closes the socket for the inter process communication

Information


Function that closes the inter-process communication.


Inputs

TypeNameDefaultDescription
IntegersocketFD Socket file descripter, or a negative value if an error occured

Outputs

TypeNameDescription
IntegerretValReturn value of the function that closes the socket connection

Modelica definition

function closeClientSocket 
  "Closes the socket for the inter process communication"

  input Integer socketFD 
    "Socket file descripter, or a negative value if an error occured";
  output Integer retVal 
    "Return value of the function that closes the socket connection";
  external "C" 
     retVal=closeBSDSocket(socketFD);
end closeClientSocket;

Buildings.Utilities.IO.BCVTB.BaseClasses.establishClientSocket

Establishes the client socket connection

Information


Function that establishes a socket connection to the BCVTB.

For the xml file name, on Windows use two backslashes to separate directories, i.e., use

  xmlFileName="C:\\examples\\roomPtDymola\\socket.cfg"
In case of a problem, check the file utilSocket.log that is written during the data exchange with the BCVTB.


Inputs

TypeNameDefaultDescription
StringxmlFileName"socket.cfg"Name of xml file that contains the socket information

Outputs

TypeNameDescription
IntegersocketFDSocket file descripter, or a negative value if an error occured

Modelica definition

function establishClientSocket 
  "Establishes the client socket connection"

  input String xmlFileName = "socket.cfg" 
    "Name of xml file that contains the socket information";
  output Integer socketFD 
    "Socket file descripter, or a negative value if an error occured";
  external "C" 
     socketFD=establishBSDSocket(xmlFileName);
end establishClientSocket;

Buildings.Utilities.IO.BCVTB.BaseClasses.exchangeReals

Exchanges values of type Real with the socket

Information


Function to exchange data of type Real with the socket.
This function must only be called once in each 
communication interval.


Inputs

TypeNameDefaultDescription
IntegersocketFD Socket file descripter
IntegerflaWri Communication flag to write to the socket stream
TimesimTimWri Current simulation time in seconds to write [s]
RealdblValWri[nDblWri] Double values to write
IntegernDblWri Number of double values to write
IntegernDblRea Number of double values to read

Outputs

TypeNameDescription
IntegerflaReaCommunication flag read from the socket stream
TimesimTimReaCurrent simulation time in seconds read from socket [s]
RealdblValRea[nDblRea]Double values read from socket
IntegerretValThe exit value, which is negative if an error occured

Modelica definition

function exchangeReals 
  "Exchanges values of type Real with the socket"

  input Integer socketFD(min=1) "Socket file descripter";
  input Integer flaWri "Communication flag to write to the socket stream";
  input Modelica.SIunits.Time simTimWri 
    "Current simulation time in seconds to write";
  input Real[nDblWri] dblValWri "Double values to write";
  input Integer nDblWri "Number of double values to write";
  input Integer nDblRea "Number of double values to read";
  output Integer flaRea "Communication flag read from the socket stream";
  output Modelica.SIunits.Time simTimRea 
    "Current simulation time in seconds read from socket";
  output Real[nDblRea] dblValRea "Double values read from socket";
  output Integer retVal "The exit value, which is negative if an error occured";
  external "C" 
     retVal=exchangeDoublesWithBSDSocket(socketFD,
                        flaWri, flaRea,
                        simTimWri,
                        dblValWri, nDblWri,
                        simTimRea,
                        dblValRea, nDblRea);
end exchangeReals;

HTML-documentation generated by Dymola Fri May 15 10:15:40 2009.