From OpenSCADAWiki
Jump to: navigation, search

The software OpenSCADA interface to implement access to real-time data is presented by the objects and virtual functions of the calls from the OpenSCADA core:

  • TTypeDAQ->TModule — The root module's object of the "Data acquisition" subsystem:
    • void compileFuncLangs( vector<string> &ls ); — Request in the ls the list of user programming languages supported by the module.
    • void compileFuncSynthHighl( const string &lang, XMLNode &shgl ); — Request the syntax rules shgl of the specified user programming language lang.
    • string compileFunc( const string &lang, TFunction &fnc_cfg, const string &prog_text ); — Calling the compilation of user's procedure prog_text and creation an object of the function's execution based on the fnc_cfg for the specified user programming language lang of this module. Returns address of the compiled function's object, ready for execution.
    • bool redntAllow( ); — A flag of support the redundancy mechanisms by module. Should be overridden and return "true" if supported, otherwise "false".
    • TController *ContrAttach( const string &name, const string &daq_db ); — It is called when you open or create a new controller's object name by this module in the db storage.
  • TController — Data source controller's object. In the context of the object is usually runs the task of the periodic or scheduled polling of real-time data of one physical controller or a dedicated physical data block. In the case of data getting by the packages, they are placed directly into the archive associated with the parameter's attribute TVAl::arch(), and the current value is set by the TVAl::set() function with the attribute "sys"=true:
    • string getStatus( ); — Call to get the specific status of the controller.
    • void enable_( ); — The enabling of the controller. Usually at this stage the initialization of the parameters' objects and their interfaces in the form of attributes is made, the attributes can sometimes be requested from the associated remote source.
    • void disable_( ); — Disabling the controller.
    • void start_( ); — Start of the controller. Usually at this stage the task of periodic or scheduled polling is created and started.
    • void stop_( ); — Stop of the controller.
    • void redntDataUpdate( bool firstArchiveSync = false ); — The operation of obtaining data from the backup station. It is called automatically by the redundancy scheme's service task and before the start to synchronize archives with the parameter firstArchiveSync.
    • TParamContr *ParamAttach( const string &name, int type ); — It is called when you open or create a new parameter's object name with the type.
  • TParamContr->TValue — The object of the data source controller's parameter. It contains the attributes with real data in a set, defined by the physically accessible data. The values and attributes are taken from the task of the controller's polling in the asynchronous mode, or requested at the time of query in the synchronous mode with the help of methods of this object's inherited type TValue:
    • void enable( ); — To enable the parameter. The formation of the attributes set and filling them with the value of unreliability is made.
    • void disable( ); — To disable the parameter.
    • void setType( const string &tpId ); — It is called to change the tpId type of the parameter and can be processed in the module's object to change its own data.
    • TVal* vlNew( ); — It is called at the stage of a new attribute creation. It can be overridden to implement a particular behavior within its own, inherited from the TVal, class during the access of the attribute.
    • void vlSet( TVal &val, const TVariant &pvl ); — Called for an attribute with a direct recording mode TVal::DirWrite (synchronous or write to an internal buffer of the object) when set to record the values in the immediate physical controller or buffer object.
    • void vlGet( TVal &val ); — It is called for an attribute with a direct reading mode TVal::DirRead (synchronous mode, or reading from an internal buffer of the object) when reading the value in order to directly read the value from the physical controller or object's buffer.
    • void vlArchMake( TVal &val ); — It is called at the stage of creation the values archive with the val attribute as the source in order to initialize the qualitative characteristics of the archive's buffer according to the characteristics of the data source and polling.