User Tools

Site Tools


debugging_complex_programs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
debugging_complex_programs [2018/12/26 11:00] – [Differences between write function for internal registers and external] emozolyakdebugging_complex_programs [2018/12/26 11:12] – [Running backup on the new device] emozolyak
Line 43: Line 43:
  
 If the project was linked to Level2 account, when restoring its backup on the new WebHMI, check that Level2 integration is switched off, otherwise this WebHMI may interefer another one which use same Level2 account. If the project was linked to Level2 account, when restoring its backup on the new WebHMI, check that Level2 integration is switched off, otherwise this WebHMI may interefer another one which use same Level2 account.
 +
 +===== Debug messages =====
 +
 +It is desirable after the key moments of logic or calculations in scripts to immediately put the functions INFO, ERROR, DEBUG, TRACE, with respectve values at this point, script's name, line number at the beginning. Then these fragments are conveniently searched and analyzed in the communication log. 
 +
 +When there is a lot of records in the communication log, you can filter out unneccerary output from scripts with this [[http://docs.webhmi.com.ua/useful_programs#debug_printing|method]]
 +
 +In the script editor, there is a debugging console, which always prints out the functions INFO, DEBUG, ERROR, TRACE regardless of the system log level settings.
 +
 +However, in a large system with many interrelated scripts, when there is a lot of debugging data, it becomes inconvenient to look for the necessary data, especially if you need to track a specific chain of execution of several scripts that can not be called at specific moments, not in each scan.
 +
 +In addition, filtering unnecessary information in logs is also useful from the point of view of performance, since operations of permanent recording on a flash card of a large amount of information can reduce system performance.
 +
 +You can proceed as follows - assign your debugging function, which will be called only if the debug printing of this script is allowed. For example, you can write the ids of the scripts in the 'debug_ID' string in which debug printing is needed at the moment, and the print function inside the script will look at this number and turn it on or off. For example:
  
debugging_complex_programs.txt · Last modified: 2022/01/15 20:50 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki