
To change the variable's value, double-click on the desired variable's value to change the value to an edit field, which you can modify as desired.Select a watched variable in the Watch Bar.Once you have entered Debug mode, you can change the name and/or value of any watched variable, via the Value column in the Watch Bar: When the breakpoint is encountered (and the program is suspended), you can single-step without a watched variable reference. NOTE: In NetLinx, you can use breakpoints with single-step mode. This command executes mainline one time and breaks.
With the watched variable selected, select Debug > Single Step. Right-click on a watched variable and choose Debug > Single Step to put the Master into single-step mode. In NetLinx systems, Single-step mode executes a single instruction in the source file. In Single-step mode, program execution is suspended between each pass through mainline, allowing you to test programs one line at a time. To exit Debug mode, select Debug > Stop Debugging. Octal Display displays the value of the watched variable in octal format.īinary Display displays the value of the watched variable in binary format. Hexadecimal Display displays the value of the watched variable in hexadecimal format. Decimal Display displays the value of the watched variable in decimal format. This opens the Display sub-menu, containing the following view options:ĪSCII Display displays the value of the watched variable in ASCII format. 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 Bar context menu. The value of the specified variable appears next to the variable (in the Value column). #Amx netlinx studio 2 software code#
Type the syntax of the variable exactly as it is defined in the code and press the Enter key.A box appears in the window, with a cursor blinking in the Name column. Click Add to insert a new variable in the Watch Bar.Right-click inside the Watch Bar to open the Watch Bar context menu.See the Connecting to a Master Controller section on page 118 for details. If this option is disabled, make sure your Master Communications Port settings are set to connect to your Master Controller. Choose Debug > Start Debugging to open the Watch Bar (FI G.The file must be successfully compiled before you can enter debug mode.
Open and compile a Source Code file (that contains at least one variable), if you have not already done so. Toggle a break point on the screen where the cursor is residing.Ī red diamond appears next to the line of code to signify a break point.Ĭlear Break Points: Clears all the break points within the source code file. Break: Stop execution of the program and highlight the line of code on the screen.Įdit Breakpoints: A dialog appears listing all the break points within the code. Run To Cursor: Execute the program and break on the line of code where the cursor is residing on the screen. Run: To continue execution after a Single Step operation or from a toggled break point. The following options only apply to NetLinx code: Single Step: Execute one line of a source code file at a time for a NetLinx Master. There is no limitation on then number of NetLinx variables that can be watched in the Debug Watch Bars. Once Start Debugging has been selected, additional options in the Debug menu become available:Ībility to toggle the debug state of the application. Also, you can control the execution through each pass of the mainline of a compiled program. The Watch Bar is a dockable window that allows you to view and edit the contents of variables within a compiled program. The Watch Bar is displayed when Start Debugging is selected from the Debug menu, or via the Debug Watch toolbar (F IG. NetLinx character strings by default are displayed in current length mode, while all other strings (including Integer strings) are displayed in total length mode. Avoid declaring variables as volatile whenever possible, since volatile variables will not display their contents during the debug session. You cannot compile, send/receive files, or change port settings while the program is in debug mode. To use debugging, the Build With Source option must be selected in the NetLinx Compiler tab of the Preferences dialog before the file is compiled. In order to begin debugging, your computer must be connected to a Master Controller, and you must have a compiled Source Code file active.
If you attempt to edit either the stack or parameter values, a warning message is displayed. However, stack and parameter values are not editable. NOTE: The Debugging feature allows you to view variables declared within the scope of a Function and/or Call procedure. NetLinx Studio contains several useful options for debugging your Master Controller and Source Code files.