Building and Debugging Source Code
115
NetLinx Studio - Instruction Manual
Troubleshooting Debugging
NetLinx Debugger Not Stopping On a Breakpoint
Symptoms - A breakpoint is set on a line of code, but the code does not stop execution on this line. The line of code in
question contains a SEND_COMMAND, SEND_STRING, or SEND_LEVEL.
Cause - The debugger will not stop on a line of code that sends a command, string, or level because of a device declared
as an integer instead of a DEVICE:PORT:SYSTEM (D:P:S) structure.
Example:
DEFINE_DEVICE
VCR = 2
TP = 128
DEFINE_EVENT
BUTTON_EVENT[TP,101]
{
PUSH:
{
SEND_COMMAND VCR," 'SP', 9" //The debugger will not stop if you put a breakpoint here
}
}
Resolution - Declare devices using the full D:P:S structure. In fact, you should always do this in NetLinx.
Example:
DEFINE_DEVICE
VCR = 2:1:0
TP = 128:1:0
DEFINE_EVENT
BUTTON_EVENT[TP,101]
{
PUSH:
{
SEND_COMMAND VCR," 'SP', 9" //The debugger will now stop if you put a breakpoint here
}
}
NetLinx Master Error - DEVICE_ID Error
When calling DEVICE_ID, this run time error can occur:
CIpLibrary::DEVICE_ID - Error 1
This error is cause by passing a parameter that is not of type DEV to the DEVICE_ID keyword. This usually occurs when
converting Axcess code to NetLinx. To fix this error, try the following:
Look for all references to the DEVICE_ID function
Make sure the value passed to the function is of type DEV. If this appears inside a DEFINE_CALL or
DEFINE_FUNCTION and a parameter is passed to the
DEVICE_ID function, make sure that parameter is of
type DEV.
Debug Option Disabled For Axcess Code File
Symptom - After compiling and downloading an Axcess code file, the Start Debugging option (in the Debug menu) is
disabled.
Cause - The code was created as an Axcess file, but was compiled as a NetLinx file.
Resolution:
1. Select the file in the Project Navigator window (Workspace tab), and right-click to open the Source Code File
Context Menu.
2. Select File Properties to open the File Properties dialog.
3. Change the Compile As selection to Axcess.
4. Click OK to save the change and close the File Properties dialog.
5. Recompile the file (as Axcess) and download.