User`s guide

26
K
A
DAK
KwikNet Overview
Breakpoint Traps
KwikNet can generate a debug trap when it encounters an error condition which is
generally not expected in the normal course of events. Such errors are often the result of
modifications of private KwikNet data by errant applications which result in decision
conflicts which
KwikNet cannot resolve.
KwikNet debug traps are also generated whenever error reporting is enabled and a warning
or error message is generated.
To use KwikNet's debug trap, you must first build the KwikNet Library to include the extra
code necessary to generate the trap. To do so, use the KwikNet Configuration Builder to
edit your KwikNet Network Parameter File and view the Debug property page (see Chapter
2.3). Check the box labeled "Trap to kn_bphit()".
Each debug trap generates a call to the KwikNet breakpoint procedure kn_bphit(). When
testing your application, you can place a breakpoint on this procedure to trap all errors
detected by
KwikNet.
Note
KwikNet breakpoint procedure kn_bphit() will be called
whenever a programmed halt occurs, even if the debug trap
feature is not enabled. Hence you can always detect a
programmed halt by placing a breakpoint on function
kn_bphit().
Monitoring Memory Usage
To use
KwikNet's memory usage monitor, you must first build the KwikNet Library to
include the extra code necessary to detect and record memory allocation and release. To
do so, use the
KwikNet Configuration Builder to edit your KwikNet Network Parameter File
and view the Debug property page (see Chapter 2.3).
Check the box labeled "
Monitor memory usage". Doing so enables KwikNet to monitor the
total memory allocated for use by KwikNet at any instant. KwikNet also monitors the worst
case memory usage. The memory usage summary can be displayed with other network
statistics by calling
KwikNet function kn_netstats().