|NI LabWindows™/CVI includes key productivity features with which you can efficiently create end-to-end solutions. Features such as CodeBuilder, interactive execution and built-in libraries and controls help you complete programs at a drastically faster pace. Also, save time finding and fixing bugs with advanced debugging tools and easily discover program inefficiencies with the Execution Profiler.|
Table of Contents
Generate Commonly Used Constructs with CodeBuilder
Ensure Uniform Team Development Practices with the New Project Wizard
Function Panels put Instrument Documentation at Your Fingertips
Use Interactive Execution to Test Code Sections
Save Development Time with Built-In Libraries and Controls
Precompiled Header Files Speed Up Build Times
Find Bugs Faster with Powerful and Interactive Debugging
Prevent Memory Leaks with Resource Tracking
Debug Crashes Quickly by Attaching Debugger to a Running Process
Execution Profiler Locates Slow Running Code
With LabWindows/CVI CodeBuilder, you can automatically generate Ansi C code skeletons that compile and run based on the callbacks you have created in your user interface resource (.uir) file. With the CodeBuilder feature, you save the time of typing standard code included in every program, eliminate syntax and typing errors, and maintain an organized source code file with a consistent programming style.
Figure 1. LabWindows/CVI generates common constructs and callbacks to save time and ensure code correctness
It's common for developers on a team to use a consistent code or user interface template when starting new projects. Common settings such as source code control or build options typically have to be reset from project to project if development is performed on different machines. With the Project Wizard, you can create new project or source files based on existing templates, reducing the amount of redundant tasks performed between multiple applications. The templates can apply to file-naming conventions, code documentation, build and target options, and user interface design.
Interfacing with an instrument usually requires the constant exploration of header files and help files. LabWindows/CVI introduced function panels as an easy tool to navigate an API and interactively insert function calls. Help is available for the function itself and each parameter. In addition, you can use function panels to interactively run individual functions with parameters that you specified. With function panels, quickly write source code in an interactive window, and even automatically insert ampersand (&) signs before variables to designate memory addresses. In addition, if you are developing a custom instrument driver, you can use the function panel HTML generation capabilities to take the documentation already included in your instrument drivers or in the open source instrument drivers available in function panels and generate web-ready documentation that can be easily distributed and searched.
Figure 2. LabWindows/CVI developers use function panels to interactively fill out and test function parameters with immediate access to help prior to inserting the function into source code
LabWindows/CVI lets you execute selected portions of code in an interactive execution window without writing a complete program. For instance, you can execute Ansi C variable declarations and assignment statements without declaring a main function. Use the interactive execution window to test portions of code before you include them in your main program so that you don’t waste time running through your entire application to test the execution of small sections.
Figure 3. LabWindows/CVI Interactive Execution window allows developers to quickly test a proof of concept
Developing advanced signal processing and mathematical algorithms requires a large investment of time and expertise in addition to subsequent testing for logical correctness. LabWindows/CVI provides hundreds of pre-built, highly advanced and verified signal analysis and statistical libraries. LabWindows/CVI developers can focus on their application architecture rather than spend additional man-months creating their own analysis IP.
Similarly, user interface controls are extremely time-consuming to create from scratch. This effort can be avoided when using LabWindows/CVI user interface controls which have a professional appearance, are highly customizable and designed for engineering applications.
Lastly, the seamless integration between LabWindows/CVI software and NI hardware drivers for measurement and control provide a solid hardware-software interface so that programmers need not waste time wrapping low-level hardware functions.
Large projects often consist of multiple source files that include the same header files. The time the compiler takes to process header files over and over again can account for nearly all of the time required to build a project. To reduce compilation times, LabWindows/CVI allows users to precompile header files, store the compiled state in a file, and, during subsequent compilations, combine the precompiled code with code that is still under development.
Creating strong and professional applications, you need to thoroughly test and troubleshoot the code; better debugging tools streamline this long process and help identify error cases.
LabWindows/CVI features the Set Next Statement command, which you can use to skip over code you know is going to fail or investigate code that failed when you executed it. This command changes the next statement to execute while you are debugging.
With the LabWindows/CVI variables window, you can inspect and modify the values of program variables when a program is suspended at a breakpoint to interactively troubleshoot variable values. LabWindows/CVI also includes editable data tooltips. As you debug your application, you can hover over a variable name in the source window to view and change the variable value using the tooltip. Additionally, programmers may create Watch variables and expressions to better monitor the behavior of specific program elements.
Figure 4. LabWindows/CVI provides comprehensive debugging tools
The resource tracking window helps you locate potential resource/memory leaks earlier in the development process. This tool records and tracks all resources allocated at run time including dynamic memory, file handles, panels, GPIB/TCP handles, and thread pools. You can also use the tool to easily go to source code, view memory, break on deallocation, and log tracked resources to disk for later review.
LabWindows/CVI provides an attach-to-process tool, which you can use to debug applications in a “just-in-time” fashion. You can attach the LabWindows/CVI debugger to a process that is already running and begin debugging if you notice issues with your application. This helps you get better insight into application failures by accessing code variables and assessing the state of the application as soon as a crash occurs. This flexible debugging feature is especially useful because crashes can be difficult to replicate and can take hours to reproduce.
Ansi C developers often spend a large amount of time analyzing source code to evaluate the execution speed and make changes in an attempt to fully optimize applications for better performance. Execution Profiler helps developers save time by simplifying the analysis of LabWindows/CVI application run-time performance. This tool provides a graphical profile of time spent in individual threads and functions during run-time to help identify bottlenecks in the application and indicate areas that need optimization. You can use the profiled data to debug and optimize the execution speed of your program.
Figure 5. Meet execution timing requirements and fix slow code by enabling profiling of your LabWindows/CVI application to investigate function execution speeds
The mark LabWindows is used under a license from Microsoft Corporation. Windows is a registered trademark of Microsoft Corporation in the United States and other countries.