From OpenSCADAWiki
Jump to: navigation, search

Software OpenSCADA interface to service input and output requests through a network interface is presented by the objects and virtual functions of the calls from the OpenSCADA core:

  • TTypeTransport->TModule — The root module's object of the "Transports" subsystem:
    • TTransportIn *In( const string &name, const string &db ); — It is called when you open or create by this module a new input transport object name with the db storage.
    • TTransportOut *Out( const string &name, const string &db ); — It is called when you open or create by this module a new output transport object name with the db storage.
  • TTransportIn — The transport's object of the processing the input requests, the function of the server. Input requests received by the module through the implementation of a network interface must be sent to the specified in the configuration input protocol protocol() via the mess() function:
    • string getStatus( ); — Call to get the specific status of the interface.
    • void setAddr( const string &addr ); — Setting the address of transport. Can be overridden for the processing and verification of module-specific address format of the transport.
    • void start(); — Start of the transport. When you start the input transport the task, that waits for requests from the outside, is typically created.
    • void stop(); — Stop of the transport.
  • TTransportOut — The transport's object of the processing the output requests, the function of the client:
    • string getStatus( ); — Call to get the specific status of the interface.
    • void setAddr( const string &addr ); — Setting the address of transport. Can be overridden for the processing and verification of module-specific address format of the transport.
    • void start( ); — Start of the transport. When you start the output transport the actual connection to the remote station is established for the interfaces that works by the connection. At this time, the errors can occur if the connection is impossible, and the transport should return to the stopped state.
    • void stop( ); — Stop of the transport.
    • int messIO( const char *obuf, int len_ob, char *ibuf = NULL, int len_ib = 0, int time = 0, bool noRes = false ); — Processing the requests from the OpenSCADA core to send data over the transport. The time waiting time of connection is specified in milliseconds, having a nonzero value it must replace the same transport's timeout in its general configuration. noRes is used by the protocols for the exclusive blocking the transport for the time of being working with it and for its own blocking exclusion by the function. The package to be sent is specified in the obuf buffer with the len_ob length, and the buffer and its size for the response are specified in the ibuf and len_ib. The output buffer obuf may be empty (NULL) if you want to check for further response or responses, received without a request, the mode of broadcasting. If the response buffer is not specified (NULL), the response waiting will not be realized.