Debugging / Fehler finden

<< Click to Display Table of Contents >>

Navigation:  MovingCap CODE - Python Programmierung >

Debugging / Fehler finden

Python-Ausgaben und Fehlermeldungen über UDP Port 14999

Python-Ausgaben und Fehlermeldungen können über eine Netzwerkverbindung auf UDP Port 14999 erhalten werden.

In Windows können Sie hierzu wie folgt vorgehen:

Laden Sie Docklight Scripting herunter und installieren Sie es. Sie benötigen keinen Lizenzschlüssel für einfache Tests / Anzeigen.

Gehen Sie zum movingcap.de Service-Portal, suchen Sie nach Docklight_MovingCap_ETH_Debug_Output.zip, laden Sie diese Datei herunter und entpacken Sie sie.

Starten Sie Docklight Scripting und öffnen Sie das Projekt Docklight_MovingCap_ETH_Debug_Output.ptp

Beachten Sie die in Docklight Scripting angezeigte Projektdokumentation (aus der Datei Docklight_MovingCap_ETH_Debug_Output.ptn):

MovingCap ETH Debug Interface via UDP Port 14999

 

* Click the "---> Connect" Send Sequence to open the connection and send an initial <CR> to the MovingCap.

 

A typical initial response could look like this:

 

12.12.2022 12:55:54.950 [PC] - <CR>

 

12.12.2022 12:55:54.955 [mc] - SYS_Initialize: The MPFS2 File System is mounted<CR><LF>

TCP/IP Stack: Initialization Ended - success <LF><CR>

Host MOVINGCAP TCP   - NBNS disabled<CR><LF>

IP Address: 192.168.2.150 <CR><LF>

REFGO - opening server<CR><LF>

code: starting upload...<CR><LF>

code: upload complete, script id: maxTRACK N23 demo rev8<CR><LF>

<CR>

><CR><LF>

 

From this point on, you can see both Python print() output, but also Python errors in the Docklight communication window:

 

12.12.2022 12:57:11.074 [mc] - code: compile, script id: maxTRACK N23 demo rev8<LF><CR>

code: execute, script id: maxTRACK N23 demo rev8<LF><CR>

Hello World from MovingCap!<CR><LF>

 

Here is what MovingCap reports after uploading and starting a script that contains an obvious Python error - the amount of spaces in line 22 is incorrect, rep. this line is not properly indented. See the Internet for "Python Indentation" and why this is important:

 

12.12.2022 12:58:57.769 [mc] - code: starting, script id: maxTRACK N23 demo rev8<LF><CR>

 

12.12.2022 12:58:57.869 [mc] - code: compile, script id: maxTRACK N23 demo rev8<LF><CR>

Traceback (most recent call last):<CR><LF>

 File "<stdin>", line 22<CR><LF>

IndentationError: unexpected indent<CR><LF>