Working With Online Devices
138
NetLinx Studio (v2.4 or higher)
3. Right-click inside the Watch window to open the Watch Window context menu.
4. Click Add to insert a new variable in the Watch window. A box appears in the window, with a
cursor blinking in the Name column.
5. Type the syntax of the variable exactly as it is defined in the code and press the Enter key. The
value of the specified variable appears next to the variable (in the Value column).
6. You can select different view formats for the Value by right-clicking on the line containing the
variable/value, and clicking on Display in the Watch window context menu. This opens the
Display sub-menu, containing the following view options:
To exit Debug mode, close the Watch window.
Notes on Using Current Length (when the Total Length option is disabled):
The way you initialize variables in your source code affects the use of Current Length. For
example, if you have a variable declared as:
CHAR cat[3]
in debug, Total Length = 3 and Current Length = 0.
If you modified the code as:
CHAR cat[3] = 'CAT'
in debug Total Length = 3 and Current Length = 3.
If you modified the code like this:
CHAR cat[3]
and then in the DEFINE_START section of your code you added:
cat[1] = 'C'
cat[2] = 'A'
cat[3] = 'T'
in debug Total Length = 3 and Current Length = 0, because setting values using array indexing
does not set the current length.
Master Controller Debug Options
The Watch window is displayed when Start Debugging is selected from the Debug menu (or the
Debug Watch toolbar). The Watch window is a dockable window that allows you to view and edit
the contents of variables within a compiled Axcess or NetLinx program. Also, you can control the
execution through each pass of the mainline of a compiled Axcess or NetLinx program.
Once Start Debugging has been selected, the other options in the Debug menu become available:
ASCII Display displays the value of the watched variable in ASCII format.
Decimal Display displays the value of the watched variable in decimal format.
Hexadecimal Display displays the value of the watched variable in hexadecimal format.
Octal Display displays the value of the watched variable in octal format.
Binary Display displays the value of the watched variable in binary format.
Start/Stop Debugging Ability to toggle the debug state of the application. There is no limitation
on then number of NetLinx variables that can be watched in the Debug
Watch windows. A maximum of 10 watch variables are allowed when
debugging an Axcess master controller.