.debugprint Method
Function: |
Sends (prints) a string into TIDE's Output pane. |
Syntax: |
sys.debugprint(byref str as string) |
Returns: |
--- |
See Also: |
--- |
Part |
Description |
str |
The data to send. |
Details
This method allows you to trace the execution of your application by printing messages in TIDE's Output pane.
This method only works when sys.runmode = 1 — PL_SYS_MODE_DEBUG. It is ignored when the application is compiled for release.
Note that sending debug messages significantly slows down execution. The VM sends a message and pauses. TIDE then sends a command to resume the execution. A single message can introduce a delay in the hundreds of milliseconds.
With the introduction of wireless debugging on the WM2000, you also need to take into account performance degradation due to UDP communications over Wi-Fi. If you have a significant amount of debug messages, TIDE must wait for replies from your device for each one, which can lead to slow performance.
TIDE doesn't automatically print each new message on a new line. Add CR/LF to your message to achieve this:
... sys.debugprint("Point 1 reached"+chr(13)+chr(10)) 'one way to add CR/LF ... sys.debugprint("Point 2, x="+str(x)+"\x0D\x0A")
'the second way to add CR/LF;
'this also demonstrates how the current value of some variable may be sent as well ...