debugging_complex_programs
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
debugging_complex_programs [2018/12/26 10:51] – [First scan] emozolyak | debugging_complex_programs [2018/12/26 10:53] – [First scan] emozolyak | ||
---|---|---|---|
Line 28: | Line 28: | ||
Remember that registers such as Dxx, CDxx and other internal registers, except for DSxx, return to the initial state (usually 0) after initializing the project (which happens when editing project elements - scripts, registers, connections, | Remember that registers such as Dxx, CDxx and other internal registers, except for DSxx, return to the initial state (usually 0) after initializing the project (which happens when editing project elements - scripts, registers, connections, | ||
+ | |||
+ | ===== Differences between write function for internal registers and external ===== | ||
+ | |||
+ | There are some differences in the operation of the SetReg and WriteReg functions with respect to internal registers (Dxx, DSxx). These functions directly change the values of the internal registers inside the scan, and do not delay WriteReg writing to the next scan start. Thus, at the end of the scan, the internal register can have a value different from the one at the scan input. Then, for example, a situation is possible where: | ||
+ | |||
+ | *script 1 changes the value of a certain register Dn. (executed in each scan) | ||
+ | *script 2 works by changing this register Dn. (executed upon register change) | ||
+ | |||
+ | If the order of execution of the scripts is 1 - 2, then everything will work, because at the current scan start script #2 saw one value, and before its execution another one(which script #1 has changed before), and will correctly work 'by changing the state of the register.' | ||
debugging_complex_programs.txt · Last modified: 2022/01/15 20:50 by 127.0.0.1