API Debug - Krystian-L-Lis/Stage GitHub Wiki

#API #Debug

Parameters

DEBUG_CAP

Type: UDINT(1..16#7FFFFFFF)
Description: Max number of debug messages.


INIT_INTERNAL_DEBUG_MODE

Type: DebugMode
Description:
Should internal debug messages during initialization stop Runtime?


EXE_INTERNAL_DEBUG_MODE`

Type: DebugMode
Description:
Should internal debug messages during execution stop Runtime?


I_Debug

Type: Interface
Description:
Enables a function block to be registered in the Debug table for visibility within the IDE. Provides no additional functionality beyond this.
Signature: INTERFACE I_Debug


DebugMode

Type: Enum
Description:
Specifies the behaviour of the Runtime when handling debug messages. Panic stops execution, Notify continues without action.
Signature:

{attribute 'strict'}
{attribute 'to_string'}
TYPE DebugMode :
(
	Notify,
	Panic
) BYTE;
END_TYPE

NewDebug

Type: Function
Description:
Logs a debug message as a string tied to an I_Debug interface for inspection and troubleshooting within the IDE.
Signature:

FUNCTION DebugMsg  
VAR_INPUT  
    iDebugMain: I_Debug;  
     mode: DebugMode;

    sInfo: Str;  
    iDebugSub: I_Debug := 0;  
END_VAR  

DebugInfo

Type: Function Block
Description:
Provides access to registered debug information.

Fields

nLastMsgIdx

Type: Reference to UDINT
Description:
Reference to the index of the most recently added debug message.


nTotalNumber

Type: Reference to UDINT
Description:
Reference to the total number of debug messages recorded.


nPanicNumber

Type: Reference to UDINT
Description:
Reference to the total number of panic-level debug messages.


nNotifyNumber

Type: Reference to UDINT
Description:
Reference to the total number of notify-level debug messages.


entry

Type: Reference to ARRAY
Description:
Reference to the debug message buffer array.


⚠️ **GitHub.com Fallback** ⚠️