From OpenSCADAWiki
Jump to: navigation, search
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
 
<languages/>
 
<languages/>
{{Constr|Generic revision and translation}}
 
 
<translate>
 
<translate>
 
<!--T:25-->
 
<!--T:25-->
Line 21: Line 20:
 
* Custom control over debugging, through the debugging message category for OpenSCADA parts and user space messages.
 
* Custom control over debugging, through the debugging message category for OpenSCADA parts and user space messages.
 
* Specific debugging and diagnostic environments for some parts of OpenSCADA, such as: data sources (controller objects) and interfaces of VCA (VCA projects).
 
* Specific debugging and diagnostic environments for some parts of OpenSCADA, such as: data sources (controller objects) and interfaces of VCA (VCA projects).
 
</translate>
 
{{Constr|Generic revision and translation are going here}}
 
<translate>
 
  
 
=== Debugging the current execution context === <!--T:29-->
 
=== Debugging the current execution context === <!--T:29-->
Line 30: Line 25:
  
 
<!--T:30-->
 
<!--T:30-->
Current execution context of DAQ procedures you can observe into a proper page of the object of the execution context, like: the tab "Attributes" of the Logic Level parameter (Fig. 6.1), the tab "Calculation" of the Java-like based calculator (Fig. 6.2) and so on. To append some interim values you can temporary [[Special:MyLanguage/Documents/Quick_start#DataProc|append (or set as an read-only attribute) and link some attributes to the template]] or [[Special:MyLanguage/Modules/JavaLikeCalc#Controller|append and link some IO to the function]].
+
Current execution context of DAQ procedures you can observe into a proper page of the object of the execution context, like: the tab "Attributes" of the Logic Level parameter (Fig. 1), the tab "Calculation" of the Java-like based calculator (Fig. 2) and so on. To append some interim values you can temporary [[Special:MyLanguage/Documents/Quick_start#DataProc|append (or set as an read-only attribute) and link some attributes to the template]] or [[Special:MyLanguage/Modules/JavaLikeCalc#Controller|append and link some IO to the function]].
  
 
<!--T:31-->
 
<!--T:31-->
[[file:LogicLev prm attr.png|center|frame|Fig. 6.1. Tab "Attributes" of the Logic Level parameter.]]
+
[[file:LogicLev prm attr.png|center|frame|Fig. 1. Tab "Attributes" of the Logic Level parameter.]]
  
 
<!--T:32-->
 
<!--T:32-->
[[file:JavaLikeCalc_cntr_calc.png|center|frame|Fig. 6.2. Tab "Calculation" of the Java-like based calculator.]]
+
[[file:JavaLikeCalc_cntr_calc.png|center|frame|Fig. 2. Tab "Calculation" of the Java-like based calculator.]]
  
 
<!--T:33-->
 
<!--T:33-->
Current execution context of the VCA procedures (procedures of the widgets) you can observe on the tab "Attributes" of the proper page or widget of the session of the executed now project (Fig. 6.3). To append some interim values you can temporary [[Special:MyLanguage/Documents/Quick_start#ComplexWdg|append and link some attributes to the widget/page]].
+
Current execution context of the VCA procedures (procedures of the widgets) you can observe on the tab "Attributes" of the proper page or widget of the session of the executed now project (Fig. 3). To append some interim values you can temporary [[Special:MyLanguage/Documents/Quick_start#ComplexWdg|append and link several attributes to the widget/page]].
  
 
<!--T:34-->
 
<!--T:34-->
[[file:HowTo_vca_ses_wp_ctx.png|center|frame|Fig. 6.3. Tab "Attributes" of a page or widget of the session of the executed now project.]]
+
[[file:HowTo_vca_ses_wp_ctx.png|center|frame|Fig. 3. Tab "Attributes" of a page or widget of the session of the executed now project.]]
  
=== Execution sequence debugging === <!--T:35-->
+
=== Debugging the execution sequence === <!--T:35-->
The debugging methods means placing and/or enabling debugging messages and next its observing into the generic messages' archiving and observing interface (Fig. 6.4) or into the interface proper to the OpenSCADA part:
+
That debugging method means placing and/or enabling debugging messages and next their observing into the generic interface of the messages archiving and observing (Fig. 4) or into the interface proper to the OpenSCADA part:
* The tab "Diagnostics" of the controller's object of the data source (Fig. 6.5).
+
* Tab "Diagnostics" of the controller object of the data source (Fig. 5).
* The tab "Diagnostics" of the project's object of VCA into the configurator (Fig. 6.6) or of the project's properties of the development mode of UI.Vision (Fig. 6.7).
+
* Tab "Diagnostics" of the project object of VCA into the configurator (Fig. 6) or of the project properties of the development mode of UI.Vision (Fig. 7).
  
 
<!--T:36-->
 
<!--T:36-->
[[file:QTCfg_subsys_arch_mess.png|center|frame|Fig. 6.4. Generic messages archiving and observing interface.]]
+
[[file:QTCfg_subsys_arch_mess.png|center|frame|Fig. 4. Generic messages archiving and observing interface.]]
  
 
<!--T:37-->
 
<!--T:37-->
[[file:QTCfg_subsys_daq_mod_cntr_diagn.png|center|frame|Fig. 6.5. Tab "Diagnostics" of a controller's object of a data source.]]
+
[[file:QTCfg_subsys_daq_mod_cntr_diagn.png|center|frame|Fig. 5. Tab "Diagnostics" of a controller object of a data source.]]
  
 
<!--T:38-->
 
<!--T:38-->
[[file:VCAeng_pg_diag.png|center|frame|Fig. 6.6. Tab "Diagnostics" of a project's object of VCA into the configurator.]]
+
[[file:VCAeng_pg_diag.png|center|frame|Fig. 6. Tab "Diagnostics" of a project object of VCA into the configurator.]]
  
 
<!--T:39-->
 
<!--T:39-->
[[file:Vision wlbpg diag.png|center|frame|Fig. 6.7. Tab "Diagnostics" of project's properties of the development mode of UI.Vision.]]
+
[[file:Vision wlbpg diag.png|center|frame|Fig. 7. Tab "Diagnostics" of project properties of the development mode of UI.Vision.]]
  
 
<!--T:40-->
 
<!--T:40-->
To append debug or other level's messages to self procedures you can use next functions:
+
To append messages in debug or other levels to your procedures you can use next functions:
* Generic: ''[[Special:MyLanguage/Documents/User_API#SYS|SYS.message(), SYS.mess{Debug,Info,Note,Warning,Err,Crit,Alert,Emerg}()]]'' — To form generic messages with a custom category, then them mostly allowed to observe from the generic messages archiving and observing interface (Fig. 6.4).
+
* Generic: ''[[Special:MyLanguage/Documents/User_API#SYS|SYS.message(), SYS.mess{Debug,Info,Note,Warning,Err,Crit,Alert,Emerg}()]]'' — to form generic messages with a custom category, then them mostly allowed to observe from the generic messages archiving and observing interface (Fig. 4).
* Generic: ''[[Special:MyLanguage/Documents/User_API#TCntrNode|SYS.*.messSys()]]'' — To form the system messages with the node path as a category and with the human readable path before the message. The messages will be allowed to observe into the diagnostics interface proper to the OpenSCADA part (Fig. 6.5, 6.6, 6.7).
+
* Generic: ''[[Special:MyLanguage/Documents/User_API#TCntrNode|SYS.*.messSys()]]'' — to form the system messages of the program with the node path as a category and with the human readable path before the message. The messages will be allowed to observe into the diagnostics interface proper to the OpenSCADA part (Fig. 5, 6, 7).
* VCA: ''[[Special:MyLanguage/Modules/VCAEngine#UserAPI|this.mess{Debug,Info,Note,Warning,Err,Crit,Alert,Emerg}()]]'' — To form the system message with the category as the widget path. The messages will be allowed to observe into the VCA diagnostics interface (Fig. 6.6, 6.7).
+
* VCA: ''[[Special:MyLanguage/Modules/VCAEngine#UserAPI|this.mess{Debug,Info,Note,Warning,Err,Crit,Alert,Emerg}()]]'' — to form the system message of the program with the category as the widget path. The messages will be allowed to observe into the VCA diagnostics interface (Fig. 6, 7).
  
 
<!--T:41-->
 
<!--T:41-->
[[File:at.png]] The same debug messages (the suffix is "Debug" or the level is 0), on Work version, will be allowed to observe only after the debugging enabled, the field "Least level" set to "Debug (0)" (Fig. 6.8), and category(es) of the messages checked (Fig. 6.9), for [[Special:MyLanguage/Documents/Program_manual#Config|the details read here]]! But the debug messages enabling and disabling allows you to include the debug messages permanently into the procedures with the proper category of the place. All other, not debug, messages will show anytime, for levels more or equal to the globally set (Fig. 6.8).
+
[[File:at.png]] The debugging messages (the suffix is "Debug" or the level is 0), on the last versions of OpenSCADA, will be allowed to observe only after the debugging enabled: the field "Least level" set to "Debug (0)" (Fig. 8) and check category(es) of the messages (Fig. 9), for the details read [[Special:MyLanguage/Documents/Program_manual#Config|here]]! The debugging messages enabling and disabling allows you to include the debug messages permanently into the procedures with the proper category of the place. All other, not debug, messages will show anytime, for levels more or equal to the globally set (Fig. 8).
  
 
<!--T:42-->
 
<!--T:42-->
[[file:HowTo_dbg_gen.png|center|frame|Fig. 6.8. Field "Least level" set to "Debug (0)".]]
+
[[file:HowTo_dbg_gen.png|center|frame|Fig. 8. Field "Least level" set to "Debug (0)".]]
  
 
<!--T:43-->
 
<!--T:43-->
[[file:QTCfg sys debug.png|center|frame|Fig. 6.9. Debug messages checking to debug.]]
+
[[file:QTCfg sys debug.png|center|frame|Fig. 9. Select categories of nodes for debugging and debugging messages.]]
  
 
<!--T:44-->
 
<!--T:44-->
[[File:at.png]] Internal or system parts of the controller's object of the data source enable for diagnostics from self interface by property "Level" set to "Debug (0)" (Fig. 6.5), irrespective.
+
[[File:at.png]] The internal or system parts of the controller object of the data source are enabled independently for diagnostics by setting the "Level" property to "Debug (0)" on the appropriate diagnostic interface (Fig. 5).
 
</translate>
 
</translate>

Revision as of 17:36, 27 February 2018

Other languages:
English • ‎mRussian • ‎Українська

Author: Roman Savochenko

If you strictly follow the Quick Start manual then you will not encounter any problems, but if you do something yourself then you may need some debugging. OpenSCADA provides extensive opportunities for debugging and identifying programming problems in the overall OpenSCADA user space and the problems of OpenSCADA itself and its parts.

Basic approaches to custom debugging include:

  • Creating external attributes to look at intermediate values and monitor the current execution context.
  • Creating debugging messages, also for review of intermediate values and follow-up monitoring.

Basic debugging mechanisms have been expanded in the latest versions of OpenSCADA for the subject:

  • Custom control over debugging, through the debugging message category for OpenSCADA parts and user space messages.
  • Specific debugging and diagnostic environments for some parts of OpenSCADA, such as: data sources (controller objects) and interfaces of VCA (VCA projects).

1 Debugging the current execution context

This method of debugging involves monitoring values of the variables of the execution context, including the addition of intermediate values, for detail.

Current execution context of DAQ procedures you can observe into a proper page of the object of the execution context, like: the tab "Attributes" of the Logic Level parameter (Fig. 1), the tab "Calculation" of the Java-like based calculator (Fig. 2) and so on. To append some interim values you can temporary append (or set as an read-only attribute) and link some attributes to the template or append and link some IO to the function.

Fig. 1. Tab "Attributes" of the Logic Level parameter.
Fig. 2. Tab "Calculation" of the Java-like based calculator.

Current execution context of the VCA procedures (procedures of the widgets) you can observe on the tab "Attributes" of the proper page or widget of the session of the executed now project (Fig. 3). To append some interim values you can temporary append and link several attributes to the widget/page.

Fig. 3. Tab "Attributes" of a page or widget of the session of the executed now project.

2 Debugging the execution sequence

That debugging method means placing and/or enabling debugging messages and next their observing into the generic interface of the messages archiving and observing (Fig. 4) or into the interface proper to the OpenSCADA part:

  • Tab "Diagnostics" of the controller object of the data source (Fig. 5).
  • Tab "Diagnostics" of the project object of VCA into the configurator (Fig. 6) or of the project properties of the development mode of UI.Vision (Fig. 7).
Fig. 4. Generic messages archiving and observing interface.
Fig. 5. Tab "Diagnostics" of a controller object of a data source.
Fig. 6. Tab "Diagnostics" of a project object of VCA into the configurator.
Fig. 7. Tab "Diagnostics" of project properties of the development mode of UI.Vision.

To append messages in debug or other levels to your procedures you can use next functions:

  • Generic: SYS.message(), SYS.mess{Debug,Info,Note,Warning,Err,Crit,Alert,Emerg}() — to form generic messages with a custom category, then them mostly allowed to observe from the generic messages archiving and observing interface (Fig. 4).
  • Generic: SYS.*.messSys() — to form the system messages of the program with the node path as a category and with the human readable path before the message. The messages will be allowed to observe into the diagnostics interface proper to the OpenSCADA part (Fig. 5, 6, 7).
  • VCA: this.mess{Debug,Info,Note,Warning,Err,Crit,Alert,Emerg}() — to form the system message of the program with the category as the widget path. The messages will be allowed to observe into the VCA diagnostics interface (Fig. 6, 7).

At.png The debugging messages (the suffix is "Debug" or the level is 0), on the last versions of OpenSCADA, will be allowed to observe only after the debugging enabled: the field "Least level" set to "Debug (0)" (Fig. 8) and check category(es) of the messages (Fig. 9), for the details read here! The debugging messages enabling and disabling allows you to include the debug messages permanently into the procedures with the proper category of the place. All other, not debug, messages will show anytime, for levels more or equal to the globally set (Fig. 8).

Fig. 8. Field "Least level" set to "Debug (0)".
Fig. 9. Select categories of nodes for debugging and debugging messages.

At.png The internal or system parts of the controller object of the data source are enabled independently for diagnostics by setting the "Level" property to "Debug (0)" on the appropriate diagnostic interface (Fig. 5).