From OpenSCADAWiki
Jump to: navigation, search

For the purpose of general module's management the TModule class provides a number of virtual functions that can be defined in the root object of the module with the implementation of the necessary response to the OpenSCADA core commands to the module:

  • void load_( ); — Loading the module. It is called on the stage of loading the module's configuration from the configuration file or database.
  • void save_( ); — Saving the module. It is called on the stage of the module's configuration saving to the configuration file or database, usually initiated by the user.
  • void modStart( ); — Starting the module. It is called on the execution stage of background module's functions tasks, if any are provided by the module.
  • void modStop( ); — Stop the module. It is called on the stopping the execution stage of background module's functions tasks, if any are provided by the module.
  • void modInfo( vector<string> &list ); — Request the list of the information properties of the module. This function of the TModule class provides the standard set of properties of the module ("Module", "Name", "Type", "Source", "Version", "Author", "Description", "License"), which can be extended by additional properties of this module.
  • string modInfo( const string &name ); — Request for the specified information item. The processing of requests for additional properties of this module is made.
  • void postEnable( int flag ); — Connecting the module to the dynamic tree of object. It is called after the starting module.
  • void perSYSCall( unsigned int cnt ); — Call from the system thread at regular intervals for 10 seconds and the seconds counter cnt. It can be used to execute periodic, rare, service procedures.