Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpi4LabVIEW)  1.26.2
Trace entries
Collaboration diagram for Trace entries:

Functions

MLPIRESULT mlpiTraceMessage (const MLPIHANDLE connection, const WCHAR16 *text, const WCHAR16 *moduleName=0, const WCHAR16 *functionName=0, const LONG lineNumber=0)
 
MLPIRESULT mlpiTraceWarning (const MLPIHANDLE connection, const WCHAR16 *text, const WCHAR16 *moduleName=0, const WCHAR16 *functionName=0, const LONG lineNumber=0)
 
MLPIRESULT mlpiTraceError (const MLPIHANDLE connection, const WCHAR16 *text, const WCHAR16 *moduleName=0, const WCHAR16 *functionName=0, const LONG lineNumber=0)
 
MLPIRESULT mlpiTraceEvent (const MLPIHANDLE connection, const WCHAR16 *text, const WCHAR16 *moduleName=0, const WCHAR16 *functionName=0, const LONG lineNumber=0)
 

Detailed Description

Use the following functions to add new entries to the trace system.

Function Documentation

MLPIRESULT mlpiTraceMessage ( const MLPIHANDLE  connection,
const WCHAR16 text,
const WCHAR16 moduleName = 0,
const WCHAR16 functionName = 0,
const LONG  lineNumber = 0 
)

This function traces a message.

Parameters
[in]connectionHandle for multiple connections.
[in]textMessage text.
[in]moduleNameModule filter name.
[in]functionNameName of source function.
[in]lineNumberLine of source file.
Returns
Return value indicating success (>=0) or error (<0).
Note
The message gets discarded if the corresponding module is not activated. Use mlpiTraceActivateModule to activate the module.
Example:
1 // let's define some macros for automatic function and line insertion
2 #define TRACE_MESSAGE(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceMessage(c, t, m, f, __LINE__); }
3 #define TRACE_WARNING(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceWarning(c, t, m, f, __LINE__); }
4 #define TRACE_ERROR(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceError(c, t, m, f, __LINE__); }
5 #define TRACE_EVENT(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceEvent(c, t, m, f, __LINE__); }
6 
7 // Use macro to set a trace message
8 TRACE_MESSAGE(connection, L"MLPI_TRACE_USER", L"This is a test message for the trace.");
MLPIRESULT mlpiTraceWarning ( const MLPIHANDLE  connection,
const WCHAR16 text,
const WCHAR16 moduleName = 0,
const WCHAR16 functionName = 0,
const LONG  lineNumber = 0 
)

This function traces a warning.

Parameters
[in]connectionHandle for multiple connections.
[in]textMessage text.
[in]moduleNameModule filter name.
[in]functionNameName of source function.
[in]lineNumberLine of source file.
Returns
Return value indicating success (>=0) or error (<0).
Note
The message gets discarded if the corresponding module is not activated. Use mlpiTraceActivateModule to activate the module.
Example:
1 // let's define some macros for automatic function and line insertion
2 #define TRACE_MESSAGE(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceMessage(c, t, m, f, __LINE__); }
3 #define TRACE_WARNING(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceWarning(c, t, m, f, __LINE__); }
4 #define TRACE_ERROR(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceError(c, t, m, f, __LINE__); }
5 #define TRACE_EVENT(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceEvent(c, t, m, f, __LINE__); }
6 
7 // Use macro to set a trace warning
8 TRACE_WARNING(connection, L"MLPI_TRACE_USER", L"This is a test warning for the trace.");
MLPIRESULT mlpiTraceError ( const MLPIHANDLE  connection,
const WCHAR16 text,
const WCHAR16 moduleName = 0,
const WCHAR16 functionName = 0,
const LONG  lineNumber = 0 
)

This function traces an error.

Parameters
[in]connectionHandle for multiple connections.
[in]textMessage text.
[in]moduleNameModule filter name.
[in]functionNameName of source function.
[in]lineNumberLine of source file.
Returns
Return value indicating success (>=0) or error (<0).
Note
The error gets discarded if the corresponding module is not activated. Use mlpiTraceActivateModule to activate the module.
Example:
1 // let's define some macros for automatic function and line insertion
2 #define TRACE_MESSAGE(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceMessage(c, t, m, f, __LINE__); }
3 #define TRACE_WARNING(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceWarning(c, t, m, f, __LINE__); }
4 #define TRACE_ERROR(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceError(c, t, m, f, __LINE__); }
5 #define TRACE_EVENT(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceEvent(c, t, m, f, __LINE__); }
6 
7 // Use macro to set a trace error
8 TRACE_ERROR(connection, L"MLPI_TRACE_USER", L"This is a test error for the trace.");
MLPIRESULT mlpiTraceEvent ( const MLPIHANDLE  connection,
const WCHAR16 text,
const WCHAR16 moduleName = 0,
const WCHAR16 functionName = 0,
const LONG  lineNumber = 0 
)

This function traces an event.

Parameters
[in]connectionHandle for multiple connections.
[in]textMessage text.
[in]moduleNameModule filter name.
[in]functionNameName of source function.
[in]lineNumberLine of source file.
Returns
Return value indicating success (>=0) or error (<0).
Note
The event gets discarded if the corresponding module is not activated. Use mlpiTraceActivateModule to activate the module.
Example:
1 // let's define some macros for automatic function and line insertion
2 #define TRACE_MESSAGE(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceMessage(c, t, m, f, __LINE__); }
3 #define TRACE_WARNING(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceWarning(c, t, m, f, __LINE__); }
4 #define TRACE_ERROR(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceError(c, t, m, f, __LINE__); }
5 #define TRACE_EVENT(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceEvent(c, t, m, f, __LINE__); }
6 
7 // Use macro to set a trace event
8 TRACE_EVENT(connection, L"MLPI_TRACE_USER", L"This is a test event for the trace.");