Variables and Call Stack Window
Use the Variables and Call Stack window to inspect and modify the values of defined program variables.
To view this window, select Window»Variables and Call Stack in the active LabWindows/CVI window.
Call Stack
The Call Stack section displays the current call stack of functions in the program with the most recently called function at the top and the initial function at the bottom of the list. Double-click a function in the list to view the last statement that your program executed in that function.
LabWindows/CVI displays functions in the Call Stack only during a breakpoint state.
Variables
The Variables section the window displays the names and types of all declared variables, including arrays and strings. LabWindows/CVI also displays the current values of numeric scalars, pointer values and contents, and string contents. LabWindows/CVI displays variables in the Variables and Call Stack window when you are debugging a program.
LabWindows/CVI updates variables at each breakpoint. Values in red indicate a change in the variable value since you suspended the program.
While the program is suspended, you can open the window for a currently highlighted active variable from a Source window or function panel by selecting Run»View Variable Value in the Source window or Code»View Variable Value in the function panel.
LabWindows/CVI displays extended information for certain data types that you can use when debugging your LabWindows/CVI application. Some LabWindows/CVI-defined data types automatically display extended data. For example, a variable of ListType displays the number of list items. You can expand the variable to view the contained list items. For other data types, you can choose to interpret the variable as a specific data type. For example, to interpret a panel handle variable, an integer value, as a true panel handle, right-click the variable and select Specific Type»Panel Handle from the context menu. LabWindows/CVI displays the title of the panel next to the integer value. Disable the extended data display by deselecting the Enable extended Variable/Watch window displays checkbox in the Environment dialog box.
The window is divided into two horizontal sections: the global tree and the function tree.
The global tree displays the following variables:
- Project globals, including all global variables not declared as static
- Interactive Execution window variables declared in the Interactive Execution window
- Global variables declared as static
The function tree displays function parameters and local variables from the active function. By default, LabWindows/CVI shows the variables and parameters of the function that is executing. To view the parameters and local variables of a different function, double-click the function in the Call Stack. The variable list for each function is grouped in a separate section.
You can view variables in the Graphical Array View, Array Display, and Memory Display windows. Select the variable you want to view from the Variables and Call Stack window and drag it into the windows or onto the tab if the window is confined.
If you want to define and view your own expressions, add a watch expression. These expressions are shown in the Watch window.
Right-clicking in the Variables and Call Stack window displays the context menu with the following options:
- Edit Value—Change the value of the variable.
- Add Watch Expression—Add the variable to the Watch window.
- Find—Find text in the Variables section of the window.
- Specific Type, or when right-clicking an array, Specific Type of Elements
Note LabWindows/CVI updates this list depending on the instrument drivers that you use in your application. For example, if you load the Programmer's Toolbox, List Type (Toolbox) displays in this list. - None (default)—Interpret the variable according to its basic data type.
- RGB Color—Interpret the data type as a RGB color.
- Time (ANSI C Library)—Interpret that data as time_t and display the current calendar time.
- Date Time (UI Library)—Interpret the data type as a DateTime value and retrieve the current date and time.
- Panel Handle—Interpret the data type as a panel handle and identify the name of the panel.
- Thread Lock Handle—Interpret the data type as a thread lock handle and identify the handle.
- Thread-Safe Queue Handle—Interpret the data type as a thread-safe queue handle and identify the handle.
- TCP Conversation Handle—Interpret the data type as a TCP conversation handle and represent the connection between the server and the client.
- VISA Instrument Session Handle—Interpret the data type as a VISA instrument session handle and display the name of the device.
- Element Type—Interpret the contained element for some aggregate data types, such as ListType and CmtTSQHandle, as a specific typed object rather than as a generic memory block. This option appears only if you right-click on an aggregate data type.
- Format
- Decimal—View the variable in decimal format.
- Hexadecimal—View the variable in hexadecimal format.
- Octal—View the variable in octal format.
- Binary—View the variable in binary format.
- ASCII—View the variable in ASCII format.
- String Encoding—View the string variable content encoded in ANSI or UTF-8 format.
Note LabWindows/CVI automatically detects the encoding of string variables based on variable content and the project encoding. When you explicitly change the encoding of a string variable, LabWindows/CVI no longer detects the encoding for that variable automatically. - Floating Point—View the variable in floating point format.
- Scientific—View the variable in scientific format.
- Preferences—Set default formats.
- View
- Array Display—View the variable in the Array Display window.
- Memory—View the variable in the Memory window.
- Graphical Array View—View the variable in the Graphical Array View.
- Options
- Variable Size—Display the number of bytes the variable consumes.
- Interpret As—Display a variable as if it were another type. Selecting a type from the Available Types dialog box displays the variable as the new type.
- Estimate Number of Elements—Estimate the number of elements for a variable.
- Release/Confine Window—Release the window from the Debugging Region if confined. Confine the window into the Debugging Region if released.
Right-clicking the tab of this window displays the context menu with the following options:
- Close—Close the window.
- Release Window—Remove the window from the Debugging Region.