Home

LabWindows/CVI User Manual

image

Contents

1. eee netten entren 5 19 Togsgle Tag e S E Labi ERE ED E RE 5 19 Next Tag iiber OR REOR PH 5 19 Previous KEE 5 20 Tag EE 5 20 Clear Tags tags eebe E ER E UE 5 20 Function Panel History iier hee 5 20 National Instruments Corporation xi LabWindows CVI User Manual Contents Function Panel K oes ee Hee tertie dE AEN 5 20 Recall Function Panel asezet cette nete een eei ehe 5 20 Invoking the Recall Function Panel Command 5 20 Recalling a Function Panel from a Function Name Only 5 21 Multiple Panels for One Function esee 5 21 Multiple Functions in One Function Panel Window 5 21 Syntax Requirements for the Recall Function Panel Command 5 21 Find Function Panel 5 2 2 tette petente ei 3 raet 5 22 Find UI OBjeCt a rte mite dre en itt e tees 5 22 Build Menu hito erre Pp eH e EHE ere 5 23 Compile T ete tnit Use AER ke opens 5 23 Create Debuggable Executable AA 5 23 Create Debuggable Dynamic Link Library seen 5 24 Create Release Executable s zaosneg rera 5 24 Create Release Dynamic Link Libar 5 24 Create Static Library cogente ied en dette ries prts 5 24 Mark File for Compilation sss sese eee ee eee eee 5 24 Clear Interactive Declarapons sssssssesssscsezevezesssscszre serverez erenn rentrent 5 24 Insert Include Statements eese 5 25 Add Missing Includes
2. Figure 7 9 View Menu To use one of these commands select a particular array or string by clicking on it with the mouse or using the up and down arrow keys and then access the command from the View menu Expand Variable The Variables and Watch windows can display arrays strings and structures in closed form or expanded form In closed form you see only the name and address of the aggregate variable next to the triangle icon as shown in Figure 7 10 tw Variables OF x File Edit View Format Run Window Options Help 0141BCA0 double Figure 7 10 Closed Array in the Variables Window National Instruments Corporation 7 11 LabWindows CVI User Manual Chapter 7 Variables and Watch Windows In expanded form the icon changes to a circle and you see the individual elements and their values as shown in Figure 7 11 tw Variables File Edit View Format Run Window Options Help 0141BCA0 0 513855000000000 0 172572000000000 0 308624000000000 1 234350000000000 Figure 7 11 Expanded Array in the Variables Window The Expand Variable command expands a currently closed aggregate variable so you can see its contents Clicking on the triangle icon has the same effect as selecting View Expand Variable Close Variable Refer to the Expand Variable earlier in this section for a discussion of expanded and closed variables The View Close Variable command closes the currently expanded aggregate variab
3. ee eie moneret 5 25 Generate Prototypes uec teet dea me etae EENS 5 25 Next Previous Build Error eese ene 5 25 Build Errors in Next T eee e eet teretes 5 25 Run Menu becuse REDORIERDO REO PRI rie HEP e PD re sabes 5 26 Introduction to Breakpoints and Watch Expressions essseesesseeeseererereeeeeee 5 26 Breakpoint State se i teet ed reote tts 5 27 Setting and Clearing Breakpoints sss sese esse eee eee 5 27 Conditional Breakpoint eee 5 27 Watch Expressions racte oeiee oetra toreen e ore a a EEEE ekar REEKS RERS 5 28 Debug Run Interactive Statemente eee eese 5 28 Running in a Source WIndOW sss sees eee 5 28 Running in the Interactive Execution Window 5 28 Run Time Error Reporting esse see sees ee eee eee eee 5 29 GOntinle ss eege e ROI PETER P RERO ER nd 5 29 G To CUST eode dite e tege debe 5 29 Step ON Eis oerni r a ep DEPO 5 29 Step Into EE 5 29 Finish Function ien EEN eren tipo ees 5 30 Terminate Execution ete Er eine etel e cured 5 30 Break at First Statement 2 nece tette rhe det ripe rites 5 30 Toggle Break pointes iie i ec Ce uei e tct tete veta 5 30 Breakpoints lt aera aR raa HR TEST ra bene tehetenppit retirees 5 30 Stack RE 5 32 Up Calls EE 5 32 LabWindows CVI User Manual Xii www ni com Contents Down Gall Stack 2e et ete tosta tee iet te eet EE 5 32 View Variable Value eee eee eee 5 32 Add Watch Expression isinin eeren nne 5 32 Thread
4. Variables Window Only Figure 7 15 Options Menu To use one of these commands select a particular variable by clicking on it with the mouse or using the up and down arrow keys then access the command from the Options menu Variable Size The Variable Size command displays the number of bytes the variable consumes If you declare the variable as a buffer the variable size is the total size of the buffer If you declare the variable as a pointer the Variable Size command displays the number of bytes the pointer itself consumes and the number of bytes in the object that the pointer references For example if your code contains the following declaration static double y_array 4 Variable Size displays a variable size of 32 bytes for y_array LabWindows CVI User Manual 7 16 www ni com Chapter 7 Variables and Watch Windows Assume your code defines db1Ptr as follows static double dblPtr dblPtr malloc 2 sizeof double Variable Size displays a variable size of 4 bytes for db1Ptr pointing to 16 bytes 2 elements Interpret As The Interpret As command displays a variable as if it were another type Selecting a type from the Available Types dialog box displays the variable as the new type If Interpret As does not offer the exact type you want you can use a watch expression Estimate Number of Elements The Variables window normally cannot expand variables for which LabWindows CVI does not have us
5. Command Line Arguments Figure 3 25 Add Edit Tools Menu Item Dialog Box Menu Item Name The string that appears in the Tools menu To specify an accelerator key for the menu item insert two underscores in front of the designated letter Program Name The pathname of the program to execute when you select the menu entry You can specify full pathname simple filename or a relative pathname You can use the Browse button to look for the program on disk Command Line Arguments Arguments you want to pass to the program You can leave this entry blank LabWindows CVI saves your Tools menu entries from one session to another not in the project LabWindows CVI User Manual 3 70 www ni com Chapter 3 Project Window Source Code Control Options The Source Code Control Options command brings up the Source Code Control Options dialog box as shown in Figure 3 26 w Source Code Control Options Provider Project 7 Create Perform same actions for h file as for uir file fk IZ Do not include pt file in Source Code Control actions Suppress CVI Error Messages Use default comment OK Cancel Figure 3 26 Source Code Control Options Dialog Box e Provider The name of the source code control system that contains the source code control project attached to the currently loaded LabWindows CVI project e Project The name of the source code con
6. ANSI C The ANSI C Library contains the ANSI C functions available in LabWindows CVI Refer to the LabWindows CVI Online Help for more information User Libraries You can install your own libraries into the Library menu A user library has the same form as an instrument driver Anything that can be loaded into the Instrument menu can be loaded as a user library provided the program is in compiled form Refer to the Using Instrument Drivers section earlier in this chapter for more information on loading files with the Instrument menu The main difference between modules you load as instrument drivers and those you load as user libraries is that you can unload instrument drivers with the Unload command in the Instrument menu but you cannot unload user libraries Also because user libraries must be in compiled form you cannot edit them when they are in the Library menu Refer to the LabWindows CVI Instrument Driver Developers Guide for detailed information about writing an instrument driver You install user libraries by selecting Options Library Options in the Project window Once a library is installed the next time you launch LabWindows CVI the libraries will load automatically and appear at the bottom of the Library menu Dummy fp Files for Support Libraries If you develop a library module to provide support functions for the modules in your project you can install it as a user library By doing so you ensure that the library is
7. If you try to execute an instrument driver function panel when no program is associated with the instrument LabWindows CVI reports a run time error It is possible to associate a c file with a fp file after you load the fp file Refer to the Edit command in the Instrument Menu section later in this chapter for more information Modules that Contain Non Instrument Functions Although the LabWindows CVI instrument driver mechanism is primarily for program modules that control instruments you can use it for any module that contains a set of high level functions Suppose for instance you write a set of specialized analysis functions If you develop function panels and a h file for the module you can load the module from the Instrument menu and call the functions from the function panels Modifying an Instrument Driver You might want to modify an instrument driver that you received from National Instruments or elsewhere If you want to modify the instrument driver program file you must have the c file for the instrument driver Before modifying an instrument driver familiarize yourself with the LabWindows CVI Instrument Driver Developers Guide You can modify four parts of an instrument driver e You can modify the function tree by selecting the p file using the File Open Function Tree fp command by selecting Instrument Edit or by selecting Tools Edit Function Tree from a Source window that contains the instrumen
8. LabWindows CVI User Manual 3 36 www ni com Chapter 3 Project Window Loading Unloading Instrument Drivers You can load and unload instrument drivers manually using the Instrument menu Instrument drivers loaded through the Instrument menu do not have to be listed in the project and you can load or unload them at any time except during program execution You can incorporate instrument drivers into the project by selecting File Add to Project in a Function Panel window or the Function Tree Editor window or by selecting Edit Add Files to Project in the Project window The fp file represents the instrument driver in the project list If the fp file is in the project list when you open the project LabWindows CVI automatically loads the instrument driver and removes it when you unload the project Precedence Rules for Loading the Instrument Driver Program File When you load a fp file LabWindows CVI loads the instrument driver program file In some cases you might have an instrument driver program file in more than one format For instance you might have 18840a obj and 18840a c in the same directory This can occur when you obtain the source code for the instrument driver and then compile it LabWindows CVI chooses which file to load according to the following rules e Ifan instrument driver program file is in the project LabWindows CVI loads it There can be at most one unexcluded program file with the same base name as the
9. Most Recently Closed Files For your reference two lists appear in the File menu Alist of the four most recently closed files other than project files e A list of the four most recently closed project files Exit LabWindows CVI Use the Exit LabWindows CVI command to close the current LabWindows CVI session If you have modified any open files since the last save or if any windows contain unnamed files LabWindows CVI prompts you to save them National Instruments Corporation 3 7 LabWindows CVI User Manual Chapter 3 Project Window Edit Menu This section explains how to use the commands in the Project window Edit menu as shown in Figure 3 5 File MESE View Build Run Instrument Library Tools Window Options Help Add Files To Project Select All Ctrl Exclude File From Build CHE Remove File Del Move Item Up Ctrl Up Move Item Down Ctrl Down Figure 3 5 Edit Menu Add Files to Project The Add Files to Project command has a submenu as shown in Figure 3 6 IZ View Build Run Instrument Library Tools Window Options Help Add Files To Project Source c Include Ph Select All Ci Object obj Exclude File From Build CHE Library lib User Interface uir Remove File Del Instrument fp All Files Move Item Up Ctrl Up Move Item Down Ctrl Down Figure 3 6 Add Files to Project Command Submenu Use the Add
10. p file LabWindows CVI loads compiles and attaches the c file as the instrument driver program file The c file appears in a new Source window e Detach Program LabWindows CVI detaches the instrument driver program file from the fp file e Reattach Program LabWindows CVI detaches the current instrument driver program file if any from the fp file LabWindows CVI then reloads a program file using the rules outlined in the Precedence Rules for Loading the Instrument Driver Program File section earlier in this chapter Edit Function Tree LabWindows CVI displays the function tree for the selected fp file e Done Closes the Edit Instrument dialog box National Instruments Corporation 3 41 LabWindows CVI User Manual Chapter 3 Project Window Accessing Function Panels from the Instrument Menu When you select an instrument name in the Instrument menu the Select Function Panel dialog box appears as shown in Figure 3 16 i Configure WithSecondary Configure With Secondary i ConfigureT rigger Configure Trigger i ConfigureCompare Configure Compare Modifier i ConfigureDecibel Configure Decibel Modifier i ConfigureHold Configure Hold Modifier i ConfigureMinMax Configure Min Max Modifier i ConfigureRelative Configure Relative Modifier i Capabilities i Set Get Check Attribute IV Function Names T Alphabetize T Flatten Eu Figure 3 16 Select Function Panel Dialog Box The Se
11. Constant names link user GUI objects and your program The User Interface Editor writes all assigned constant names to a header file corresponding to the uir file When you select the Immediately Assign Constant Names for New Objects option the User Interface Editor generates constant names for each object as you create it For panels and controls the generated constant name appears in the Edit dialog box the first time you bring it up For menu bars the constant names are assigned only when you exit the Menu Bar Editor In all cases you can freely modify the generated constant names It is recommended that you leave the Immediately Assign Constant Names for New Objects option selected This makes it easier for you to use the other LabWindows CVI features that have been designed to help you write your program to operate your user interface National Instruments Corporation 4 35 LabWindows CVI User Manual Chapter 4 User Interface Editor Window Notice that when the Immediately Assign Constant Names for New Objects option is enabled the Assign Constant Names from User Defined Control Labels When Possible option has no effect That is because you do not have a chance to customize the control labels before the User Interface Editor generates the constant name Consequently the User Interface Editor bases the constant name on the control type If you choose to disable the Immediately Assign Constant Names for New Objects option
12. The Edit Value command operates the same way as it does in the Variables window Refer to the Edit Menu for the Variables Window section earlier in this chapter for more information on this command Add Watch Expression Add Watch Expression invokes the Add Edit Watch Expression dialog box The Watch Window section earlier in this chapter explains this dialog box Edit Watch Expression Edit Watch Expression invokes the Add Edit Watch Expression dialog box for the selected watch expression The Watch Window section earlier in this chapter explains this dialog box Delete Watch Expression Delete Watch Expression removes the selected watch variable expression from the Watch window This command is not available in the Variables window Find The Find command operates the same as it does in the Variables window Refer to Edit Menu for the Variables Window section earlier in this chapter for more information on this command LabWindows CVI User Manual 7 10 www ni com Chapter 7 Variables and Watch Windows View Menu This section contains a detailed description of the View menu for the Variables and Watch windows Figure 7 9 shows the View menu File Edit Format Run Window Options Help Expand Variable Ctrl Enter Eollow Pointer Chain Ctrl Right Retrace Pointer Chain Ctrl Left Go To Execution Position Ctrl P Go To Definition Ctrl SS EENEG Array Display F4 String Display Shift F4 Memory Display Ctrl F4
13. This section explains how to use the commands in a Source or Interactive Execution window Edit menu as shown in Figure 5 6 Use the commands in the Edit menu to edit text in Source windows and the Interactive Execution window Ei Note The Selecting Text in the Source and Interactive Execution Window section earlier in this chapter describes the procedures for moving the cursor scrolling and selecting text File Edit Undo Cl Redo Ctrl BkSp View Build Run Instrument Library Tools Window Options Help Cut IR Copy Ctrl C Paste Ctrl V Delete Del Select All Ctrl Shift A Clear Window Toggle Exclusion Ru Resolve All Excluded Lines Insert Construct Balance Ctrl B Diff E Go To Definition Ctrl Find Shift F3 Replace Shift F11 Next File CT Ei Note LabWindows CVI disables Undo and Redo until you make an edit Figure 5 6 Edit Menu LabWindows CVI disables the Cut and Copy commands until you select text and disables Paste until you place text on the Clipboard If you select an edit command while it is disabled nothing happens LabWindows CVI User Manual 5 10 www ni com Chapter 5 Source and Interactive Execution Windows Undo and Redo The Undo command reverses your last edit action LabWindows CVI stores editing actions in a stack so that sequential Undo commands reverse a history of your edit actions You can set the size of this stack using the Options Editor
14. eese 7 12 Figure 7 12 Parent Structure Pointer in a Cham 7 13 Figure 7 13 Child Structure Pointer in a Chain eee 7 13 Figure 7 14 Format Mem ie cede e obe intr Recette tete edits 7 15 Figure 7 15 Options Menu eee tete en terere eine 7 16 Figure 8 1 Array Display for a Double Precision Array eee 8 2 Figure 8 2 Array Display for a Three Dimensional Array eese 8 3 Figure 8 3 Reset Indices Dialog Box for a Three Dimensional Array 8 3 Figure 8 4 String Display for a String Variable sess 8 4 Figure 8 5 File Menu ete eR REPE reden 8 5 National Instruments Corporation Xix LabWindows CVI User Manual Contents Figure 8 6 Edit Menu for the Array Display Window sse 8 6 Figure 8 7 Find Dialog Box in the Array Display Window sssesesseeesseeererees 8 7 Figure 8 8 Edit Menu for the String Display Window sese 8 7 Figure 8 9 Format Menn nere tide tre pre e I RES reb 8 8 Figure 8 10 Format Menu for a Real Array in the Array Display Window 8 9 Figure 8 11 Options Menu T 8 10 Tables Table 1 1 LabWindows CVI Startup Options eene 1 1 Table 1 2 Subdirectories that LabWindows CVI Requires sees 1 4 Table 3 1 Platforms Where Utility Functions Require the Low Level Support Driver seen 3 26 Table
15. Expand tabs to spaces when saving files Convert leading spaces to tabs when loading files Line Terminator Line terminator for this file CR LF DOS and windows Line terminator for new files E CR LF DOS and windows Cancel Figure 5 18 Editor Preferences Undoable Actions Per File Next Session Use this option to set the number of actions per file that you can undo Purge Undo Actions When Saving File Use this option to clear the accumulated list of editing actions each time you save a file Move Cursor to the End of Pasted Text Use this option to put the cursor at the end of the pasted text Leave this option blank to put the cursor at the beginning of the pasted text Tab Length Use this option to set the tab length Activate the options to request LabWindows CVI to convert tab characters into spaces when saving files and convert leading spaces to tab characters when loading files These options are convenient if you use another editor or a printer that does not support tab characters Line Terminator for This File and Line Terminator for New Files LabWindows CVI can read source files with any of the commonly used line termination sequences It remembers what line termination sequence was found in LabWindows CVI User Manual 5 36 WWW ni com Chapter 5 Source and Interactive Execution Windows each file and uses the same sequence when saving each file If you want to change that
16. This option sets LabWindows CVI to prompt you to make a manual search for any header files listed in the include lines that the compiler cannot find When you find them you can automatically insert the appropriate path into the Include Paths list for the project e Stop on First File with Errors This option sets the LabWindows CVI compiler to terminate compilation after it finds one file with errors Using this option you can correct build errors in your project one file at a time e Show Build Error Window for Warnings This option sets the LabWindows CVI compiler to open the Build Error window when warnings occur even if no errors exist If you deactivate it warnings can occur without being brought to your attention Display Status Dialog Box During Build This option displays a status dialog box during the build that shows the name of the file being compiled the number of errors and warnings encountered and a percent completed value Your project compiles faster when you disable this feature Compiler Defines The LabWindows CVI compiler accepts compiler defines through the Compiler Defines command in the Options menu of the Project window Compiler defines have the following syntax Dx or Dx y The variable x is a valid c identifier You can use x in your source code as a predefined macro For example you can use x as the argument to the if or ifdef preprocessor directive for conditional complication If y contains
17. View Menu This section explains how to use the commands in the Project window View menu as shown in Figure 3 7 MICE Build Run Instrument Library Tools Window Options Help Show Full Path Names Show Full Dates Sort By Date Sort By Name Sort By Pathname Sort By File Extension No Sorting Figure 3 7 View Menu Show Full Path Names Use this command to toggle between displaying the project list with full pathnames and displaying the project list with simple base filenames Show Full Dates Use this command to toggle between displaying the project list with short file dates such as 06 15 93 and full file dates such as Tue Jun 15 1993 Sort By Date If you sort by date the project list appears in chronological order Sort By Name If you sort by name the project list appears in alphabetical order by filename Sort By Pathname If you sort by pathname the project list appears in alphabetical order by directory pathname LabWindows CVI User Manual 3 10 www ni com Chapter 3 Project Window Sort By File Extension If you sort by file extension the project list appears in alphabetical order by file extension No Sorting If you choose No Sorting you can list your project files in any order by using the Move Item Up and Move Item Down items in the Edit menu Build Menu This section explains how to use the commands in the Project window Build menu as shown in Figure 3 8 Use c
18. YF LabWindows CVI User Manual Qr NATIONAL December 1999 Edition y INSTRUMENTS Part Number 320681E 01 Worldwide Technical Support and Product Information www ni com National Instruments Corporate Headquarters 11500 North Mopac Expressway Austin Texas 78759 3504 USA Tel 512 794 0100 Worldwide Offices Australia 03 9879 5166 Austria 0662 45 79 90 0 Belgium 02 757 00 20 Brazil 011 284 5011 Canada Calgary 403 274 9391 Canada Ontario 905 785 0085 Canada Qu bec 514 694 8521 China 0755 3904939 Denmark 45 76 26 00 Finland 09 725 725 11 France 01 48 14 24 24 Germany 089 741 31 30 Greece 30 1 42 96 427 Hong Kong 2645 3186 India 91805275406 Israel 03 6120092 Italy 02 413091 Japan 03 5472 2970 Korea 02 596 7456 Mexico D F 5 280 7625 Mexico Monterrey 8 357 7695 Netherlands 0348 433466 Norway 32 27 73 00 Poland 48 22 528 94 06 Portugal 351 1 726 9011 Singapore 2265886 Spain 91 640 0085 Sweden 08 587 895 00 Switzerland 056 200 51 51 Taiwan 02 2377 1200 United Kingdom 01635 523545 For further support information see the Technical Support Resources appendix To comment on the documentation send e mail to techpubs ni com Copyright 1994 1999 National Instruments Corporation All rights reserved Important Information Warranty The media on which you receive National Instruments software are warranted not to fail to execute programming instructions due to defects in materials and workmansh
19. cw Find UIR Objects Search By Prefix Constant Name v i K Done Find Panels T wrap IV Find Controls Case Sensitive Find Menu Bars T Whole Word Find Menus T Regular Expression Find Menu Items Figure 4 13 Find UIR Objects Dialog Box Select the type or types of objects you want to search for by checking the appropriate checkboxes in the left column of the dialog box Search By Select the search criterion from the Search By ring control The choices available are Constant Prefix Valid for panels and menu bars Constant Name Valid for controls menus and menu items Prefix Constant Name Valid for all A Callback Function Name Valid for all except menu bars Label Valid for all except menu bars Enter the text you want to search for into the string control You can view a list of all the strings in the file that match the current Search By criterion by clicking on the arrow to the right of the string control or by using the up and down arrow keys Find Allows you to select which types of UIR objects to search for Wrap Continues your search at the beginning of the file after reaching the end of the file Case Sensitive Finds instances only of the specified text that match exactly Whole Word Finds the specified text only when it is surrounded by spaces punctuation marks or other characters not part of a word LabWindows CVI treats the characters A through Z
20. 0 through 9 and underscore _ as parts of a word Regular Expression Causes LabWindows CVI to treat certain characters in the search string control as regular expression characters instead of literal characters Refer to LabWindows CVI User Manual 4 18 WWW ni com Chapter 4 User Interface Editor Window Table 5 1 Regular Expression Characters in Chapter 5 Source and Interactive Execution Windows for more information e Find Click on the Find button to perform the search If any user interface objects match the dialog box is replaced by the one shown in Figure 4 14 wW Find UIR Objects Figure 4 14 Find UIR Objects Dialog Box after a Search Executes This dialog box allows you to browse through the list of matches As you come to each object its callback function name and label appear and the object is highlighted in the uir file The Find UIR Objects dialog box has the following buttons Find Prev Searches backward for the previously matched object Find Next Searches forward for the next matching object Edit Terminates the search and opens the Edit dialog box for the user interface object currently highlighted Stop tTerminates the search Show Hide Panels The Show Hide Panels command has a submenu as shown in Figure 4 15 Show Hide Panels Figure 4 15 Show Hide Panel Submenu Use this submenu to Show All Panels Hide All Panels or select individual panels you want to view in the
21. 4 23 Control Settings section Edit Control dialog box 4 13 to 4 14 Control Style command Edit menu 4 16 Control ZPlane Order command Arrange menu 4 22 controls preferences for 4 34 Controls command Create menu 4 17 conventions used in manual xxi xxii Copy command Edit menu 4 7 5 11 Copy Panel command Edit menu 4 7 Create ActiveX Automation Controller command Tools menu Project window 3 48 to 3 53 Advanced panel 3 49 to 3 53 Automation Controller Advanced Options dialog box 3 51 to 3 53 Choose Server panel 3 48 to 3 49 Configure panel 3 49 Source and Interactive Execution windows 5 33 Create Console Application Target Settings dialog box 3 14 to 3 15 Create Debuggable Dynamic Link Library command Build menu Source and Interactive Execution windows 5 24 Configuration submenu Build menu Project window 3 13 Create Debuggable Executable command Build menu Source and Interactive Execution windows 5 23 Configuration submenu Build menu Project window 3 13 Create Distribution Kit command Build menu 3 24 www ni com Create Distribution Kit dialog box 3 25 to 3 30 Advanced Distribution Kit options 3 29 to 3 30 Command Line Arguments 3 30 Executable Filename 3 30 Installation Name 3 30 Program Group Name 3 30 Script filename 3 29 Use Custom Script 3 29 Build Information section 3 25 to 3 27 Default button 3 30 File Groups section 3 27 to 3 29 illustration 3 25 Create IVI Instrument Dr
22. Diff Use the Diff command for comparing two source files to detect any differences The Diff command has a submenu as shown in Figure 5 7 Undo Cul Redo Ctrl BkSp Cut Clo Copy Ctrl C Paste Ctrl V Delete Del Select All Clear Window C Ctl E Toggle Exclusion Resolve All Excluded Lines Insert Construct L Balance Ctrl B Diff With Synchronize at Top Go To Definition Ctl4d Find Next Difference Synchronize Selections Find Shit F3 Match Criteria Replace Shift F11 onore White Space Nest File Ctrl T View Build Run Instrument Library Tools Window Options Help Recompare Ignoring White Space Ctrl Shift D Ctrl Shift T Ctrl Shift N Ctrl Shift S Ctrl Shift R Figure 5 7 Diff Submenu Use Diff With from a Source window to select another open source file and compare it against the current source file National Instruments Corporation 5 13 LabWindows CVI User Manual Chapter 5 Go To Find Source and Interactive Execution Windows After you select the two files to compare use Synchronize at Top to display both files starting at the top Select Find Next Difference to display the next point where a difference exists in the files Highlight a section from one of the files and select Synchronize Selections from that window to find a matching section in the other file Use Match Crite
23. Japan 03 5472 2970 Korea 02 596 7456 Mexico D F 5 280 7625 Mexico Monterrey 8 357 7695 Netherlands 0348 433466 Norway 32 27 73 00 Poland 48 22 528 94 06 Portugal 351 1 726 9011 Singapore 2265886 Spain 91 640 0085 Sweden 08 587 895 00 Switzerland 056 200 51 51 Taiwan 02 2377 1200 United Kingdom 01635 523545 B 2 WWW ni com Glossary Prefix Meaning Value n nano 10 u micro 10 6 m milli 10 3 A active window Array Display auto exclusion binary control bps breakpoint Breakpoint command button National Instruments Corporation G 1 The window that user input affects at a given moment The title of an active window is highlighted A mechanism for viewing and editing numeric arrays A mechanism that prevents pre existing lines from executing in the Interactive Execution Window A function panel control that resembles a physical on off switch and can produce one of two values depending on the position of the switch bits per second An interruption in the execution of a program A specific command that interrupts the execution of a program A dialog box item that when selected executes a command associated with the dialog box LabWindows CVI User Manual Glossary C checkbox Clipboard CodeBuilder common control compiler define control cursor cursor location indicator D default command dialog box LabWindows CVI User
24. Library to create an interface with other Windows applications using the DDE standard Refer to the LabWindows CVI Online Help for DDE function descriptions ActiveX Automation Use the ActiveX Automation Library in conjunction with the ActiveX Automation Controller Wizard to control ActiveX Automation servers Select Tools Create ActiveX Automation Controller to invoke the wizard The wizard allows you to browse an ActiveX Automation server and select which methods you want to use It then generates an instrument driver with a c API and function panels for using the selected methods The ActiveX Automation Library contains low level functions that the generated instrument drivers use and high level functions that you use to manipulate the data you pass to and from the instrument driver functions Refer to the LabWindows CVI Online Help for ActiveX Automation function descriptions LabWindows CVI User Manual 3 46 www ni com Chapter 3 Project Window Formatting and 1 0 Use the Formatting and I O Library functions to input and output data to files and manipulate the format of data in a program Refer to the LabWindows CVI Online Help for Formatting and I O function descriptions Utility The Utility Library contains functions that do not fit into any of the other LabWindows CVI libraries You can use these functions for file manipulation and other miscellaneous tasks Refer to the LabWindows CVI Online Help for Utility function descriptions
25. Open Save and Exit LabWindows CVI sese 4 4 SAVE AS o Weder ERE P IH rie Re ETE 4 5 Save Copy AS coiere EE 4 5 Closez nette ti eet er e eene t NE 4 5 SCAD EE 4 5 Add File to Project eene een ean es 4 5 Read Only ect mete tote Udo eae dissidere Green 4 5 Printiissuseeen eae nU ert cir 4 5 Et MON E 4 6 Undo and Redo 5 ever HU E NOE er 4 6 ER LE KE 4 7 Pastes vss eta Reichs se ee atit io ee reds 4 7 Delete 4 ihe eee E beet ec e e eee cede 4 7 Copy Panel and Cut Panel 4 7 Men Batts CR M 4 8 IS elei ue ER de A RT 4 11 Greii 4 12 T ab Ordet Rear e EH REED EEN EE IR ce 4 15 Set Default Font cte eerte erts Ete A oes e POPE EO ee 4 16 Apply Default Pont eis isa en ie i is ag e eed 4 16 Control Style T eed eae tear eee 4 16 Create Menu Letra che Ween ENEE ea eae eee a 4 16 Panel E 4 17 Men Bar nets Ree eal RA A erbe eae eae 4 17 Controls eee etit D ier c o ER Te a eee ve bee gie 4 17 National Instruments Corporation ix LabWindows CVI User Manual Contents RASA IRR T TTT 4 17 Find UIR OD CIS s rie rrr Fett rr Re DR RR S 4 18 Show Ehde Panels Ree eve A een 4 19 Bring Panel to Front ento ettet rtr es 4 20 Nep Hong ost eh A Et tetti e ects 4 20 Previous EE 4 20 Preview User Interface Header bie 4 20 Arrange Mem 2 en eret erri dep OR ese REESE soli ENEE 4 20 Alignment tester eee ee doe eus Ses eer
26. amp play framework directory Instrument Driver Support Only If you check this box your project does not link to the entire set of LabWindows CVI libraries but to a smaller set of functions Standalone executables and DLLs you create when the Instrument Driver Support Only command is enabled do not use the LabWindows CVI Run time Engine DLL cvirte dll Instead they use instrsup d11 which is much smaller This command is particularly useful for creating instrument driver DLLs It allows other applications to use instrument driver DLLs without having to load the large LabWindows CVI Run time Engine DLL If you use a standalone compiler and want to use instrsup dll include cvi extlib instrsup lib in your external compiler project instead of cvirt lib and cvisupp lib Remember that when you use an external compiler you link to that compiler s ANSI C library instrsup dll contains functions from the following libraries Formatting and I O Library RS 222 Library Utility Library selected functions only refer to the Utility Library Functions discussion later in this section ANSIC National Instruments Corporation 3 17 LabWindows CVI User Manual Chapter 3 Project Window Your project also can link to the following libraries Analysis or Advanced Analysis Library GPIB Library VXI Library VISA Library IVI Library Easy I O for DAQ Library Data Acquisition Library If you us
27. cab file LabWindows CVI stores the location in the Windows Registry The cdb file contains the locations of the source files at the time you created the DLL It also contains the LabWindows CVI installation directory and VXIplug amp play framework directory When LabWindows CVI has to display a DLL source file it looks for the file in the following places and order The project list if the current project target is the DLL you are debugging 2 The source file directory that LabWindows CVI stored in the cab file 3 Ifyou have moved the ca file the directory that is in the same relative position to the current cdb location as the stored source file directory was in relation to the original cdb file location 4 Ifthe source file was originally under the LabWindows CVI directory and the LabWindows CVI directory has changed the same relative position to the new LabWindows CVI directory 5 Ifthe source file was originally under the VXIplug amp play framework directory and the VXIplug amp play framework directory has changed the same relative position to the new VXIplug amp play framework directory If LabWindows CVI cannot find a DLL source file it reports an error Make sure that your files are in one of the preceding locations National Instruments Corporation 3 31 LabWindows CVI User Manual Chapter 3 Project Window In summary when you move a DLL to another machine and you want to debug it there you must al
28. for more information on using these commands LabWindows CVI User Manual 6 2 www ni com Chapter 6 Using Function Panels Figure 6 1 shows the Configure Measurements Function Panel window for a Fluke 45 Digital Multimeter It contains a function panel that corresponds to the 145_configMeas function You can use the controls on the function panels to specify parameters for the functions The generated code box at the bottom of the window displays the function calls these function panels generate amp Fluke 45 Digital Multimeter VISA 1 0 Configure Measurements File Code View Instrument Library Tools Window Options Help SEO alse 21S e fl45_configMeas Primary Display AC Current AC DC ms Current DC Current Continuity Diode Frequency Ohms Secondary Display AC Current DC Current Diode Frequency DC Volts Ohms AC Volts AC Volts Clear AC DC Volts DC Volts Status fl45S5ession fl45 configMeas fl45Session 9 4 ul Figure 6 1 Instrument Driver Function Panel Window Multiple Function Panels in a Window The Function Panel window can contain more than one function panel Each function panel corresponds to one function with the controls on that function panel manipulating the parameters to that function call You can disable individual functions by selecting Edit Edit Function and selecting the Function Disabled
29. frequently asked questions FAQs and their corresponding answers or solutions including special sections devoted to our newest products The database is updated daily in response to new customer experiences and feedback e Troubleshooting Wizards Step by step guides lead you through common problems and answer questions about our entire product line Wizards include screen shots that illustrate the steps being described and provide detailed information ranging from simple getting started instructions to advanced topics e Product Manuals A comprehensive searchable library of the latest editions of National Instruments hardware and software product manuals Hardware Reference Database A searchable database containing brief hardware descriptions mechanical drawings and helpful images of jumper settings and connector pinouts Application Notes A library with more than 100 short papers addressing specific topics such as creating and calling DLLs developing your own instrument driver software and porting applications between platforms and operating systems National Instruments Corporation B 1 LabWindows CVI User Manual Appendix B Technical Support Resources Software Related Resources Instrument Driver Network A library with hundreds of instrument drivers for control of standalone instruments via GPIB V XI or serial interfaces You also can submit a request for a particular instrument driver if it does not alre
30. it is recommended that you enable the Fill In Missing Constant Names When Saving option Assign Missing Constants The Assign Missing Constants command assigns constant names to all of the objects in the User Interface Editor window that currently do not have constant names A confirmation dialog box appears showing the number of items that have no constant names Save In Text Format The Save In Text Format command saves the contents of the User Interface Editor window in an ASCII text format A dialog box appears prompting you to enter the pathname under which to save the text file The extension tui is recommended for such files Do not use the uir extension The ASCII text file contains descriptions of all the objects in the User Interface Editor window You can call LoadPanel and LoadPanell Ex on tui files KL Note If you have a large number of objects in your User Interface Editor window loading a tui file can take significantly longer than loading a comparable uir file KI Note The tui file format in LabWindows CVI 5 0 and later differs from previous versions If you use tui files to find differences between versions of your uir files and you created tui files in previous versions of LabWindows CVI create new baseline tui files for your uir files Load From Text Format The Load From Text Format command loads into a new User Interface Editor window the objects defined in a file saved using th
31. only when you load a panel as a child panel To change each of these three options in the User Interface Editor you can use the Paintbrush tool on the background frame or title bar of a panel To set these colors programmatically use SetPanelAttribute with the ATTR_BACKCOLOR ATTR FRAMI E COLOR and ATTR_TITLI E BACKCOLOR attributes e Use the Preferences for New Controls section of the Editor Preferences dialog box to set initial attribute values for each control that you create in the User Interface Editor The Control Text Style and Label Text Style command buttons allow you to select the initial font and text style for all new controls LabWindows CVI User Manual 4 34 WWW ni com Chapter 4 User Interface Editor Window e Click on the More button to open the Other User Interface Editor Preferences dialog box shown in Figure 4 28 u Other User Interface Editor Preferences Figure 4 28 Other User Interface Editor Preferences Dialog Box Use the Undo Preferences section of the Other User Interface Editor Preferences dialog box to set the number of actions you can undo for each file If you want the undo buffer to empty every time you save a file select the option to Purge Undo Actions When Saving File The Constant Name Assignment section of the Other User Interface Editor Preferences dialog box allows you to set preferences for constant name assignment when you do not assign constant names yourself
32. window 4 3 pProcessID option table 1 2 predefined macros for writing platform dependent code 3 63 Preferences command Code menu 4 30 to 4 31 Always Append Code to End option 4 31 Default Control Events option 4 30 Default Panel Events option 4 30 Preferences menu figure 4 30 Options menu 4 33 to 4 36 Preview User Interface Header File command View menu 4 20 Previous Build Error command View menu 5 25 Previous Function Panel command View menu 6 22 Previous Function Panel Window command View menu 6 22 Previous Panel command View menu 4 20 6 2 Previous Scope command Edit menu 7 9 Previous Tag command View menu 5 20 Print command File menu 4 5 Project window 3 7 Source and Interactive Execution windows 5 9 problem solving and diagnostic resources online B 1 Project command Window menu 3 56 project files optional files 3 1 options for displaying 3 10 to 3 11 LabWindows CVI User Manual 1 22 required files 3 1 saving automatically 3 7 Project Move Options command Options menu 3 72 Project window Build menu 3 11 to 3 30 debugging DLLs 3 30 to 3 33 Edit menu 3 8 to 3 10 File menu 3 4 to 3 7 Help menu 3 74 icons 3 2 to 3 3 illustration 2 5 3 2 Instrument menu 3 39 to 3 43 Library menu 3 43 to 3 48 opening with New command 3 5 with Open command 3 6 optional files 3 1 Options menu 3 59 to 3 73 overview 3 1 to 3 3 purpose and use 2 4 required files 3 1 Run menu 3 33
33. 3 2 VXIplug amp play Framework Subdirectories esses 3 37 Table 3 3 Libraries in the bin Directory of LabWindows CVI 3 68 Table 5 1 Regular Expression Characters sese eee eee 5 15 Table A 1 Keyboard Help iR ct Rieti REI HERR A 1 LabWindows CVI User Manual XX www ni com About This Manual Conventions The LabWindows CVI User Manual is a reference manual that contains detailed descriptions of LabWindows CVI features and functionality To use this manual effectively you should be familiar with the Getting Started with LabWindows CVI manual DOS and Windows fundamentals Begin by reading Chapter 1 Configuring LabWindows CVI and Chapter 2 LabWindows CVI Overview because subsequent chapters build on the information in the first two chapters bold italic monospace monospace bold The following conventions appear in this manual The symbol leads you through nested menu items and dialog box options to a final action The sequence File Page Setup Options directs you to pull down the File menu select the Page Setup item and select Options from the last dialog box This icon denotes a note which alerts you to important information This icon denotes a caution which advises you of precautions to take to avoid injury data loss or a system crash Bold text denotes items that you must select or click on in the software such as menu items and dialog
34. 5 33 LabWindows CVI User Manual Chapter 5 Source and Interactive Execution Windows Create IVI Instrument Driver Use the Create IVI Instrument Driver command the Instrument Driver Development Wizard to create the source file include file and function panel file for controlling an instrument You can base the new instrument driver on one of the following e Anexisting driver for a similar instrument e The core IVI driver template e An IVI instrument class template The Instrument Driver Development Wizard copies the template or existing driver files and replaces all instances of the original instrument prefix with the prefix you select for your new driver Refer to the LabWindows CVI Instrument Driver Developers Guide for more information on the Instrument Driver Development Wizard Edit Instrument Attributes Use the Edit Instrument Attributes command to add delete or edit attributes for an IVI instrument driver You can invoke this command only if the file in the Source window has the same path and base filename as an instrument driver function panel fp file and its associated sub file The command is useful only if you used the Create IVI Instrument Driver command to generate the instrument driver files The Edit Instrument Attributes command analyzes the instrument driver files to find all the attributes the driver uses It then opens a dialog box that displays the attributes and various information about them In the di
35. 6 10 Number of Elements 6 10 OK button 6 11 Set Target File button 6 11 Variable Name 6 10 Variable Type 6 10 __DEFALIGN macro 3 63 Default All command Options menu 6 24 Default calling convention option 3 59 to 3 60 Default Control command Options menu 6 24 Default Control Events option Preferences command 4 30 Default Panel Events option Preferences command 4 30 Delete command Edit menu 4 7 5 11 Delete Watch Expression command Edit menu 7 10 Detach Program command Edit Instrument dialog box 3 41 diagnostic resources online B 1 DialogFontBold option 1 5 DialogFontName option 1 5 DialogFontSize option 1 5 Diff command Edit menu 5 13 to 5 14 Diff With 5 13 Find Next Difference 5 14 Ignore White Space 5 14 Match Criteria 5 14 Recompare Selections Ignoring White Space 5 14 Synchronize at Top 5 14 Synchronize Selections 5 14 Dimmed field Edit Menu Bar dialog box 4 10 directory configuration option 1 3 to 1 4 Display Entire Buffer command Options menu 8 10 Display status dialog during build option 3 62 www ni com Distribute Vertical Centers command Arrange menu 4 22 distributing standalone executables See standalone executables creating and distributing Distribution command Arrange menu 4 21 to 4 22 Distribution Kit See Create Distribution Kit dialog box DLL File option Target Settings dialog box 3 17 DLLMain function generating 4 27 DLLs adding to project 3 9 Create
36. Advanced Options Dialog Box The Automation Controller Advanced Options dialog box has the following options Instrument Prefix This list box contains the instrument prefix for the generated ActiveX Automation Controller instrument driver You must either leave the control empty or enter a valid c identifier of up to eight characters e Objects in ActiveX Automation Server This list box displays the objects in the ActiveX Automation server Indicate the object s to include in the generated instrument driver by checking the list box entries The second column of this list box indicates which objects are top level objects or event objects For each selected top level object the ActiveX Automation Controller Wizard generates NewObject OpenObject and Act iveObject functions You must use one of these functions to create an ActiveX Automation object before you can use any of the National Instruments Corporation 3 51 LabWindows CVI User Manual Chapter 3 Project Window other functions in the instrument driver You create all other objects in the ActiveX Automation server through methods and properties of the top level objects Event objects are a collection of events generated by the ActiveX Automation server For each selected event object the wizard generates a set of functions you can use to register callbacks for each event The callbacks are called when the server fires the events Object Tag This list box c
37. All OK GoTo Line Delete All Enable All Cancel Figure 5 14 Breakpoints Dialog Box LabWindows CVI User Manual 5 30 www ni com Chapter 5 Source and Interactive Execution Windows Use the Add Edit Item button to edit a single breakpoint with the Edit Breakpoint dialog box as shown in Figure 5 15 cw Edit Breakpoint E tempsys c v Line 104 Pass Count 0 Condition Disabled Iv Figure 5 15 Edit Breakpoint Dialog Box e File Use this control to select the source file that contains the breakpoint you want to edit e Line Use this control to select the line that contains the breakpoint you want to edit s Pass Count Use this control to select the number of times that the source code line executes before the breakpoint occurs e Condition Use this box to enter an optional expression that LabWindows CVI evaluates before it executes the source code line If the condition is true your program enters a breakpoint state otherwise execution continues Refer to the Conditional Breakpoints section earlier in this chapter for examples of conditional expressions e Disabled Use this checkbox to disable the breakpoint The breakpoint icon in the Source window changes color to indicate that you disabled it e After you set all the breakpoint attributes in the Edit Breakpoint dialog box you can Replace the breakpoint with the new attributes Add the breakpoint to the breakpoint list or
38. Box 3 51 Figure 3 21 Window Menn iesise ierste siset aises reae cient piede 3 55 National Instruments Corporation xvii LabWindows CVI User Manual Contents Figure 3 22 Options L 3 59 Figure 3 23 Library Options Dialog Box esse 3 67 Figure 3 24 Tools Menu Options Dialog Box 3 69 Figure 3 25 Add Edit Tools Menu Item Dialog Bon 3 70 Figure 3 26 Source Code Control Options Dialog Box 3 71 Figure 3 27 Help Menu sse ai NEEN 3 74 Figure 4 1 Sample LabWindows CVI Graphical User Interface 4 1 Figure 4 2 User Interface Editor Window essere 4 2 Figure4 3 PileMemn insecure ient eU ER 4 4 Figure 4 4 Edit Menu entro EENS teme er t RU 4 6 Figure 4 5 Menu Bar List Dialog Bon 4 8 Figure 4 6 Edit Menu Bar Dialog Box sss 4 0 Figure 4 7 Edit Panel Dialog Box essere rnn 4 11 Figure 4 8 Sample Edit Numeric Knob Control Dialog Box 4 13 Figure 4 9 Edit Label Value Pairs Dialog Bos 4 14 Figure 4 10 Edit Tabbing Order Dialog Bon 4 15 Figure 4 11 Create Menn dE EENS creer e OSERE aS 4 16 Fig re4 12 View Menu eere suse n eere o e ERE entier E ENEKE EEEN 4 17 Figure 4 13 Find UIR Objects Dialog Box 4 18 Figure 4 14 Find UIR Objects Dialog Box after a Search Executes 4 19 Figure 4 15 Show Hide Panel Submenu sese ese eee 4 19 Figure 4 16 Arrange Men
39. CVI User Manual 1 2 WWW ni com Chapter 1 Configuring LabWindows CVI A configuration string value is associated with each option as shown in Figure 1 1 Registry Editor Regist Edi View Help My Computer Y HKEY CLASSES BOOT Y CH HKEY CURRENT USER H E HKEY LOCAL MACHINE SOFTWARE 3 National Instruments p c3 evi E 2 CC CVI Run Time Engine G cvite Data value not set d nalysis Installed p ab CompatibilityM ode Msvc ab Cl Objects Installed eh ab InstallDir d cvib5 ab ProgramFolder National Instruments CvI ab SDK Objects Installed p ab VI Installed hp Ej Mu Computer HKEY_LOCAL_MACHINE SOFTWARE National Instruments CVI 5 5 Figure 1 1 Registry for Windows You do not have to include an unused configuration string in the Registry You must specify an absolute pathname including a drive letter for configuration strings that take a directory name Option Descriptions When configuring LabWindows CVI you can make changes to the directory options date and time options timer options and the font options Directory Options This section contains detailed descriptions of the directory options available in LabWindows CVI cvidir You have to set the cvidir option only if the subdirectories that LabWindows CVI requires shown in Table 1 2 are not in the directory that contains the LabWindows CVI
40. Chapter 2 LabWindows CVI Overview User Interface Library You can use the User Interface Library in conjunction with the User Interface Editor in the LabWindows CVI environment In the User Interface Editor you can create command bars pull down menus dialog boxes controls graphs and strip charts Then you can save these objects to a User Interface Resource uir file The functions in the User Interface Library allow you to load these objects from the uir file display them receive user input from them and display program data and results in them The User Interface Library also has functions for programmatic creation of a graphical user interface Refer to the LabWindows CVI Online Help for more information on the User Interface Library and Editor Easy 1 0 for DAQ Library The Easy I O for DAQ Library contains functions that make writing simple DAQ programs easier than if you use the Data Acquisition Library Although the function panels for the Easy I O for DAQ Library come with LabWindows CVI the library requires the NI DAQ DLL which comes with your National Instruments data acquisition board The function panel help for the Easy I O for DAQ Library describes the library functions Data Acquisition Library The Data Acquisition Library which comes with National Instruments data acquisition boards contains high level functions for controlling National Instruments plug in data acquisition boards The NI DAQ Function Reference Manu
41. Display Entire Buffer Array Display Window You can use the Array Display window to view and edit the contents of an array or string From the Variables window use the View Array Display command to invoke the Array Display window for the currently highlighted array You also can double click on an array to invoke the Array Display window Select Run View Variable Value in a Source window or Code View Variable Value in a Function Panel window to invoke the Array Display window when the name of an array variable is under the keyboard cursor or is in the active function panel control National Instruments Corporation 8 1 LabWindows CVI User Manual Chapter 8 Array and String Display Windows Figure 8 1 shows the Array Display window for a single dimensional array cw Array Display y File Edit Format Run Window Options Help double y 10 Slice R Index 2 D 083862304687500 LEE EE ere el O CH G G G GOGO G Ob 303649902343750 573425292968750 665151132812500 565185546875000 118957519531250 594458007812500 0 1 2 3 4 5 6 7 8 9 Figure 8 1 Array Display for a Double Precision Array The Slice indicator shows the dimension that appears You can display a single dimensional array by row R or column C using the Options Reset Indices command The Index indicator shows the currently selected element LabWindows CVI User Manual 6 2 www ni com Chapter 8 Array and String Display W
42. Distribution command 4 22 Vertical Gap option Distribution command 4 22 View command Code menu 4 29 to 4 30 View menu Function Panel windows 6 20 to 6 22 Current Tree command 6 21 Error command 6 21 Find Function Panel command 6 21 First Function Panel Window command 6 22 First Panel command 6 2 Function Panel History command 6 21 illustration 6 20 Include File command 6 21 Last Function Panel Window command 6 22 Last Panel command 6 2 Next Function Panel command 6 22 Next Function Panel Window command 6 22 Next Panel command 6 2 www ni com National Instruments Corporation Previous Function Panel command 6 22 Previous Function Panel Window command 6 22 Previous Panel command 6 2 Toolbar command 6 21 Project window 3 10 to 3 11 illustration 3 10 No Sorting command 3 11 Show Full Dates command 3 10 Show Full Path Names command 3 10 Sort By Date command 3 10 Sort By File Extension command 3 11 Sort By Name command 3 10 Sort By Pathname command 3 10 Source and Interactive Execution windows Beginning End of Selection command 5 19 Build Errors in Next File command 5 25 Clear Tags command 5 20 Find Function Panel command 5 22 Find UI Object command 5 22 Function Panel History command 5 20 Function Panel Tree command 5 20 illustration 5 18 Line command 5 19 Line Icons command 5 19 5 27 Line Numbers command 5 19 Next Tag command 5 19 Previous Tag command 5 20 Recall Fun
43. Figure 4 11 Create Menu 4 16 www ni com Chapter 4 User Interface Editor Window Panel The Panel command places a new untitled panel into the User Interface Editor window Refer to the Edit Menu section earlier in this chapter for more information on editing the panel Menu Bar The Menu Bar command opens the Edit Menu Bar dialog box Refer to the Menu Bars section earlier in this chapter for more information on editing the menu bar Controls The remaining options in the Create menu allow you to create GUI controls After you create acontrol you can modify it using the items in the Edit menu Refer to the Edit Menu section earlier in this chapter for more information on editing controls View Menu This section explains how to use the commands in the User Interface Editor window View menu as shown in Figure 4 12 File Edit Create MIZUM Arrange Code Run Library Tools Window Options Help Find UIR Objects Shift F3 Show Hide Panels E Bring Panel To Front Next Panel CtrleShift Right Previous Panel Ctrl Shift Left Preview User Interface Header File Figure 4 12 View Menu National Instruments Corporation 4 17 LabWindows CVI User Manual Chapter 4 User Interface Editor Window Find UIR Objects Use the Find UIR Objects command to locate objects in user interface resource uir files When you select this command the Find UIR Objects dialog box opens as shown in Figure 4 13
44. Figure 8 3 om Reset Indices x Cancel Figure 8 3 Reset Indices Dialog Box for a Three Dimensional Array The dialog box shows the size and display index for each array dimension The letter R indicates the dimension displayed as rows and the letter C indicates the dimension displayed as columns The indices for the remaining dimensions those dimensions not specified as National Instruments Corporation 8 3 LabWindows CVI User Manual Chapter 8 Array and String Display Windows either row or column remain constant at the specified value For the three dimensional array shown in Figure 8 2 there is one remaining dimension If you enter an invalid character such as a non alphanumeric character or any alphabetic character besides R r C or c an error message appears Likewise if you enter an index out of the range of a dimension an error message appears Press lt Enter gt to remove the error message If you want to close the Reset Indices dialog box without changing the indices click on Cancel String Display Window You can use the String Display window to view and edit the contents of a string variable or string array From the Variables window select View String Display to invoke the String Display window for the currently highlighted string variable Double click on a string to invoke the String Display window Select Run View Variable Value in a Source window or select Code View Variable Value i
45. File command View menu 5 25 Next Build Error command View menu 5 25 Previous Build Error command View menu 5 25 Show Build Error window for warnings option 3 62 Build Information section Create Distribution Kit dialog box 3 25 to 3 27 Build menu Project window Compile File command 3 21 Configuration command 3 11 to 3 13 Create Distribution Kit command 3 24 to 3 30 External Compiler Support command 3 21 to 3 24 illustration 3 11 Mark All for Compilation command 3 21 Mark File for Compilation command 3 21 Target Settings command 3 14 to 3 21 Target Type command 3 14 National Instruments Corporation I 3 Index Source and Interactive Execution windows Add Missing Includes command 5 25 Clear Interactive Declarations command 5 4 5 24 Compile File command 5 23 Create Debuggable Dynamic Link Library command 5 24 Create Debuggable Executable command 5 23 Create Release Dynamic Link Library command 5 24 Create Release Executable command 5 24 Create Static Library command 5 24 Generate Prototypes command 5 25 illustration 5 23 Insert Include Statements command 5 25 Mark File for Compilation command 5 24 Next Build Error command 5 25 Previous Build Error command 5 25 Build Options command Options menu 3 59 to 3 62 Button Bar option Find command Source and Interactive Execution windows 5 17 Variables window 7 9 buttons adding and positioning on toolbar 5 2 C Callback Function
46. Function Panels Select the action options you want When you select the Execute Declaration option LabWindows CVI executes the variable declaration immediately in the Interactive Execution window When you select the Add Declaration to Top of Target File filename option LabWindows CVI inserts a copy of the declaration at the top of the file you select using the Set Target File button When you select the Add Declaration to Current Block in Target File filename option LabWindows CVI inserts a copy of the declaration at the beginning of the code block that contains your current position Click on the Set Target File button to set the destination file for the Insert Function Call command Set Target File brings up a dialog box from which you can select from any open Source window or the Interactive Execution window Click on the OK button to declare the variable according to the options you have selected Click on the Cancel button to cancel the operation and remove the Declare Variable dialog box from the screen When you use the Declare Variable command LabWindows CVI always declares the variable using the static storage class unless you select the Add Declaration to Current Block in Target File option In addition to generating the variable declaration the Declare Variable command also places the variable name in the currently active control overwriting the previous contents of the control If the currently active control al
47. In LabWindows CVI you can use either function as your program entry point When linking your application in an external compiler it is easier to use WinMain If your project target is a DLL neither winMain or main are generated Instead CodeBuilder generates a DLLMain function and places the bulk of the User Interface function calls in a function called InitUIForDLL Call InitUIForDLL in your DLL at the point you want to load and display panels National Instruments Corporation 4 27 LabWindows CVI User Manual Chapter 4 User Interface Editor Window When you link your executable or DLL in an external compiler you must include a call to InitCVIRTE in WinMain main or DLLMain or DLLEntryPoint for Borland C C In a DLL you must also include a call to CloseCVIRTE Refer to Chapter 3 Compiler Linker Issues in the LabWindows CVI Programmer Reference Manual CodeBuilder automatically generates the necessary calls to InitCVIRTE and CloseCVIRTE in your WinMain main or DLLMain function It also automatically generates a include statement for the cvirte h file Use the All Callbacks command to generate code for all the callback functions and write them to the target file When you select Code Generate All Callbacks LabWindows CVI produces the include statements and the callback function skeletons and places them in the target file Use the Panel Callback command to generate code for the callback function associat
48. Panel Window The Last Function Panel Window command displays the last Function Panel window in the Function Tree Instrument Menu The Instrument menu in Function Panel windows works the same way as the Instrument menu in the Project window Refer to the Instrument Menu and Using Instrument Drivers sections in Chapter 3 Project Window for command descriptions LabWindows CVI User Manual 6 22 www ni com Chapter 6 Using Function Panels Library Menu The Library menu for Function Panel windows behaves the same way as the Library menu in the Project window Refer to the Library Menu section in Chapter 3 Project Window for command descriptions Tools Menu The Tools menu for Function Panel windows behaves the same way as the Tools menu in the Project window Refer to the Tools Menu section in Chapter 3 Project Window for command descriptions Window Menu The Window menu in Function Panel windows behaves the same way as the Window menu in the Project window Refer to the Window Menu section in Chapter 3 Project Window for command descriptions Options Menu This section contains a detailed description of the Options menu for Function Panel windows as Shown in Figure 6 11 File Code View Instrument Library Tools Window Ss Default Control Default All Toolbar Exclude Function Ctrl E Toggle Control Style Ctrl T Change Format E Edit Function Panel Window Figure 6 11
49. Return button 5 18 Stop button 5 18 Require function prototypes option 3 60 to 3 61 5 5 National Instruments Corporation 1 23 Index Require return values for non void functions option 3 61 Reset Indices command Options menu description 8 10 displaying multi dimensional arrays 8 3 displaying single dimensional arrays 8 2 specifying index for string array 8 4 specifying plane and dimensions for multi dimensional arrays 8 2 Reset Indices dialog box 8 3 to 8 4 Resolve All Excluded Lines command Edit menu 5 12 Retrace Pointer Chain command View menu 7 3 7 13 return value controls 6 5 return values requiring for non void functions 3 61 Right Edges option Alignment command 4 21 Distribution command 4 22 ring control parameters specifying 6 6 RS 232 command Library menu 3 45 RS 232 Library 3 45 Run Function Panel command Code menu 6 10 Run Interactive Statements command Run menu 5 28 to 5 29 Run menu Array and String Display windows 8 9 Project window Break at First Statement command 3 34 Breakpoints command 3 34 Continue command 3 34 Debug command 3 33 to 3 34 Execute command 3 35 illustration 3 33 Select External Process command 3 34 5 28 Terminate Execution command 3 34 Threads command 3 35 LabWindows CVI User Manual Index Source and Interactive Execution windows Add Watch Expression command 5 32 Break at First Statement command 5 27 5 30 Breakpoints command 5 27
50. SYSTEM FAILURE WOULD CREATE A RISK OF HARM TO PROPERTY OR PERSONS INCLUDING THE RISK OF BODILY INJURY AND DEATH SHOULD NOT BE RELIANT SOLELY UPON ONE FORM OF ELECTRONIC SYSTEM DUE TO THE RISK OF SYSTEM FAILURE TO AVOID DAMAGE INJURY OR DEATH THE USER OR APPLICATION DESIGNER MUST TAKE REASONABLY PRUDENT STEPS TO PROTECT AGAINST SYSTEM FAILURES INCLUDING BUT NOT LIMITED TO BACK UP OR SHUT DOWN MECHANISMS BECAUSE EACH END USER SYSTEM IS CUSTOMIZED AND DIFFERS FROM NATIONAL INSTRUMENTS TESTING PLATFORMS AND BECAUSE A USER OR APPLICATION DESIGNER MAY USE NATIONAL INSTRUMENTS PRODUCTS IN COMBINATION WITH OTHER PRODUCTS IN A MANNER NOT EVALUATED OR CONTEMPLATED BY NATIONAL INSTRUMENTS THE USER OR APPLICATION DESIGNER IS ULTIMATELY RESPONSIBLE FOR VERIFYING AND VALIDATING THE SUITABILITY OF NATIONAL INSTRUMENTS PRODUCTS WHENEVER NATIONAL INSTRUMENTS PRODUCTS ARE INCORPORATED IN A SYSTEM OR APPLICATION INCLUDING WITHOUT LIMITATION THE APPROPRIATE DESIGN PROCESS AND SAFETY LEVEL OF SUCH SYSTEM OR APPLICATION Contents About This Manual CONVENTIONS ee ee e xxi LabWindows CVI Documentation Set xxii Standard Documentation Set xxii Related Documentation sss sese eee eee xxii Chapter 1 Configuring LabWindows CVI LabWindows CVI Startup Opttons eee eee eee 1 1 How to Set the Configuration Options esse eee eee eee 1 2 Option Descriptions onde eR SE i eei cete cued estes 1 3 Directory Options eee domne dee 1 3 NIE e EIER DINI UE RR
51. Settings dialog box The Target Settings dialog box contains different controls based on the item checked in Target Type menu item When you set the Target Type to Executable and select Build Target Settings the Target Settings dialog box has the following options e Application File The name of the executable files for the debug and release versions of your program Changing the value of the ring control displays the filename and allows you to edit the filename for the debug and release configurations You can use the Browse button to select an existing filename e Application Title A descriptive title for your program This title appears in the Start menu of Windows if you create a distribution kit using the Create Distribution Kit command in the Build menu The operating system registers it when a user starts the application Application Icon File A file that contains a descriptive graphical icon for your program You can double click on the icon in the Windows shell to start your executable You can use the Browse button to select an existing icon file e Icon The graphical representation of the Application Icon File You can double click on this control to browse for an icon file on disk The sample program samples apps V iconedit exe ships with LabWindows CVI so that you can create your own icon files e Create Console Application lIf you leave this box unchecked your executable is created as a Windows GUI application If
52. Use this command to remove the selected files from the source code control project attached to the currently loaded LabWindows CVI project e Show History Use this command to view the source code control history for the selected file LabWindows CVI User Manual 3 54 WWW ni com Chapter 3 Project Window Show Differences Use this command to view the differences between the selected file on disk and the latest version in the source code control system e Properties Use this command to view the source code control properties and status of the selected file e Refresh Status Use this command to have LabWindows CVI update the source code control status of the files If you use the source code control system GUI to change the status files in your source code control system LabWindows CVI may not know about these changes until you select Refresh Status e Source Code Control Use this command to launch the GUI interface provided by your source code control system Clear Source Code Control Error Window Use this command to clear the contents of the Source Code Control Error window User Defined Entries in the Tools Menu You can install your own entries in the Tools menu Each entry invokes an executable with optional command line arguments Select Options Tools Menu Options in the Project window to add your own entries to the Tools menu Window Menu You use commands in the Window menu shown in Figure 3 21 to bring any
53. User Interface Editor window National Instruments Corporation 4 19 LabWindows CVI User Manual Chapter 4 User Interface Editor Window Bring Panel to Front The Bring Panel to Front command has a submenu that lists all panels and allows you to select a panel to bring to the front for editing Next Panel The Next Panel command brings the next panel in the current uir file to the front for viewing and editing Previous Panel The Previous Panel command brings the previous panel in the current uir file to the front for viewing and editing Preview User Interface Header File The Preview User Interface Header File command opens a Source window with a preview of the header file that LabWindows CVI generates when you save the uir file in the User Interface Editor window Arrange Menu This section explains how to use commands in the Arrange menu of the User Interface Editor window as shown in Figure 4 16 File Edit Create View Es Code Run Library Tools Window Options Help Alignment L Align Horizontal Centers Ctrl Distribution E Distribute Vertical Centers Ctrl D Control ZPlane Order id Center Label Shift F9 Control Coordinates Shift F10 Figure 4 16 Arrange Menu LabWindows CVI User Manual 4 20 www ni com Chapter 4 User Interface Editor Window Alignment The Alignment command allows you to align controls on a panel You can use the mouse to select a group of controls by dr
54. Variables window shows the contents of all variables currently defined in LabWindows CVI You can access the Array Display and String Display windows from the Variables window The Variables window is useful for debugging programs LabWindows CVI updates the Variables window at each breakpoint and you can modify the variables while in a breakpoint state Refer to Chapter 7 Variables and Watch Windows for more information about the Variables window Watch The Watch command brings the Watch window to the front The Watch window shows a set of variables and expressions that you specify You can access the Array Display and String Display windows from the Watch window The Watch window is useful for debugging programs Watch variables and expressions update at each breakpoint unless you set them to update continuously Refer to Chapter 7 Variables and Watch Windows for more information about the Watch window Array Display and String Display If any Array Display or String Display windows are active they appear in the View menu Selecting one of these windows from the Window menu brings it to the front for viewing and editing Refer to Chapter 8 Array and String Display Windows for a complete description of Array Display and String Display windows National Instruments Corporation 3 57 LabWindows CVI User Manual Chapter 3 Project Window User Interface All open User Interface Resource uir files dynamically appear in the
55. WWW ni com Chapter 5 Source and Interactive Execution Windows Instrument Menu The Instrument menu for Source and Interactive Execution windows works the same as the Instrument menu in the Project window Refer to the Instrument Menu section of Chapter 3 Project Window for information on the Instrument menu Library Menu The Library menu for Source and Interactive Execution windows works the same as the Library menu in the Project window Refer to the Library Menu section of Chapter 3 Project Window for information on the Library menu Tools Menu This section explains how to use the commands in a Source window Tools menu as shown in Figure 5 16 File Edit View Build Aun Instrument Library MEWS Window Options Help Create Activex Automation Controller Create IVI Instrument Driver Edit Instrument Attributes IR Edit Function Tree Edit Function Panel Source Code Control Figure 5 16 Tools Menu Create ActiveX Automation Controller Use the Create ActiveX Automation Controller command to generate a new instrument driver for an ActiveX Automation server The Create ActiveX Automation Controller command for Source and Interactive Execution windows works the same as the Create Active X Automation Controller in the Project window Refer to the Create ActiveX Automation Controller section of Chapter 3 Project Window for information on this command National Instruments Corporation
56. Window menu If the file is in the project only the filename appears If the file is not in the project the full pathname appears Select a uir file from this menu to bring the corresponding User Interface Editor window to the front Refer to Chapter 4 User Interface Editor Window for a complete description of User Interface Editor windows Function Panel All open Function Panel windows dynamically appear in the Window menu Select a Function Panel window from this menu to bring that window to the front Refer to Chapter 6 Using Function Panels for a complete description of Function Panel windows Function Tree All open Function Tree files dynamically appear in the Window menu If the file is in the project only the filename appears If the file is not in the project the full pathname appears Select a fp file from this menu to bring the corresponding Function Tree Editor window to the front Refer to Chapter 2 The Function Tree Editor in the LabWindows CVI Instrument Driver Developers Guide for a complete description of Function Tree Editor windows Help Editor All open Help Editor windows dynamically appear in the Window menu Select a Help Editor window from this menu to bring that Help Editor window to the front Refer to Chapter 4 Adding Help Information in the LabWindows CVI Instrument Driver Developers Guide for more information about the Help Editor window Interactive Execution Use the Interactive Execution comman
57. always available in the LabWindows CVI development environment If you do not want to develop function panels for the library create a p file without any classes or functions In that case LabWindows CVI loads the library at startup but does not include the library name in the Library menu National Instruments Corporation 3 47 LabWindows CVI User Manual Chapter 3 Project Window System Libraries LabWindows CVI includes some low level system functions The prototypes for the functions are in 1owlvlio h and the function panels are in the ANSI C Library You can call Windows SDK functions If you have installed the LabWindows CVI Full Development System from CD ROM you have access to the full set of Windows SDK functions Otherwise you have access only to a subset Refer to Chapter 3 Compiler Linker Issues of the LabWindows CVI Programmer Reference Manual for more information Tools Menu This section explains how to use the commands in the Project window Tools menu as shown in Figure 3 19 File Edit View Build Run Instrument Library WOR Create Activex Automation Controller Window Options Help Create IVI Instrument Driver Source Code Control Figure 3 19 Tools Menu Create ActiveX Automation Controller Use the Create ActiveX Automation Controller command to generate a new instrument driver for an ActiveX Automation server When you select the Create ActiveX Automation Contr
58. are listed in the Methods of Object listbox and this listbox is empty Property Tag LabWindows CVI appends this string to the Object Tag to construct the generated name for this property This string must contain only valid c identifier characters Property Description This list box is a description of the currently selected property Some ActiveX Automation servers do not provide this description Context Sensitive Help Buttons These buttons labeled with a question mark display help for the server object method or property If the server does not provide help for an item the corresponding context sensitive Help button dims Cancel This button discards the changes you made and closes the Automation Controller Advanced Options dialog box Help This button displays help for the Automation Controller Advanced Options dialog box Create IVI Instrument Driver Select Tools Create IVI Instrument Driver to open the Instrument Driver Development Wizard to create the source file include file and function panel file for controlling an instrument You can base the new instrument driver on one of the following An existing driver for a similar instrument The core IVI driver template An IVI instrument class template The Instrument Driver Development Wizard copies the template or existing driver files and replaces all instances of the original instrument prefix with the prefix you select for your new driver Refer to the Lab
59. box as shown in Figure 4 6 appears when you click on the Create or Edit buttons on the Menu Bar List cw Edit Menu Bar Menu Bar Constant Prefix Insert New Item Wee Below Above Constant Name Insert Separator Callback Function Below Above Modifier Key None Shortcut Key S No Shortcut Key T Dimmed Checked lt lt lt Figure 4 6 Edit Menu Bar Dialog Box The Edit Menu Bar dialog box has the following options e Menu Bar Constant Prefix Sets the resource ID for the menu bar You pass this resource ID to LoadMenuBar to load the menu bar into memory The menu bar constant prefix is defined in the h file that LabWindows CVI generates when you save the uir file If you do not assign a menu bar constant prefix the User Interface Editor assigns one for you when you save the uir file Item Sets the name of the current menu submenu or menu command If you type a double underscore before any letter in the Item field the letter appears underlined in the label The user can select the menu item by pressing Alt and that letter National Instruments Corporation 4 9 LabWindows CVI User Manual Chapter 4 User Interface Editor Window Constant Name Sets the constant name of the item which is appended to the menu bar constant prefix to form the ID for the current item You pass the ID to functions such as GetMenuBarAttribute and SetMenuBarAttribute GetUserEvent returns t
60. box if you want to include only a subset of the server s objects in the instrument driver or if you want to make changes to the default source code identifiers Use the Automation Controller Advanced Options Dialog box to select the objects you want to include in the instrument driver and to change the names of the generated functions and properties Refer to your server documentation to determine which objects you want to use Many servers provide online help that you can access from the dialog box Selecting a large number of server objects results in large source files and longer compile times National Instruments Corporation 3 49 LabWindows CVI User Manual Chapter 3 Project Window The ActiveX Automation Controller Wizard generates various types of functions You can use a method function to invoke a method of an object The driver contains a separate method function for each method of each object You can use the object creation functions to create top level objects After you have created a top level object you can create other objects using the property and methods functions Three object creation functions exist for each top level object If you chose Call Methods Directly Through the Dual Interface in the Call Mechanism control on the Configure panel of the ActiveX Automation Controller Wizard the wizard generates individual functions to get and set each property in the server If you choose Call Methods Through Dispatch Invoke i
61. box options Bold text also denotes parameter names Italic text denotes variables emphasis a cross reference or an introduction to a key concept This font also denotes text that is a placeholder for a word or value that you must supply Text in this font denotes text or characters that you should enter from the keyboard sections of code programming examples and syntax examples This font is also used for the proper names of disk drives paths directories programs subprograms subroutines device names functions operations variables filenames and extensions and code excerpts Bold text in this font denotes the messages and responses that the computer automatically prints to the screen This font also emphasizes lines of code that are different from the other examples National Instruments Corporation xxi LabWindows CVI User Manual About This Manual monospace italic Italic text in this font denotes text that is a placeholder for a word or value that you must supply LabWindows CVI Documentation Set Standard Documentation Set You should begin by reading Getting Started with LabWindows CVI which gives you a hands on introduction to LabWindows CVI This manual shows you how to develop applications in LabWindows CVI The LabWindows CVI User Manual is a reference manual that describes the features and functionality of LabWindows CVI The LabWindows CVI Instrument Driver Developers Guide describes how to creat
62. bring up pop up menus e If you click on the User Interface Editor window background a pop up menu appears containing commands to create a panel or a menu bar e If you click on a panel background a pop up menu appears with each of the control types you can create s If you click on a control a pop up menu appears with commands to generate or view the callback function for the control CodeBuilder Overview With the LabWindows CVI CodeBuilder you can create automatically complete C code that compiles and runs based on a user interface uir file you are creating or editing By choosing certain options in the Code menu you can produce skeleton code Skeleton code is syntactically and programmatically correct code that compiles and runs before you have typed a single line of code With the CodeBuilder feature you save the time of typing in standard code included in every program eliminate syntax and typing errors and maintain an organized source code file with a consistent programming style Because a CodeBuilder program compiles and runs immediately you can develop and test the project you create concentrating on one function at a time When you choose Code Generate All Code LabWindows CVI places the include statements variable declarations callback function skeletons and main function in the source code file you specify as the target file Each function skeleton contains a switch construct with a case statement for ever
63. can be an additional sub file that contains attribute information displayed in the function panels National Instruments Corporation 3 35 LabWindows CVI User Manual Chapter 3 Project Window s The function variable and defined constant declarations are in an include file with a h extension e The instrument driver program can be in one of several different types of files A source file with a c extension Anobject file that contains one or more compiled C modules with a obj extension or a library file with a 1ib extension The compilation must be done by LabWindows CVI or a compatible external compiler Refer to Chapter 3 Compiler Linker Issues in the LabWindows CVI Programmer Reference Manual for more information on compatible external compilers For example the instrument module files for a Fluke 8840A multimeter are 18840a fp 18840a c and 18840a h You can load an instrument driver into the LabWindows CVI interactive program whether the instrument program is in the form of a c obj or 1ib file The presence of the n file is essential because you must include it in your program to reference functions global variables and constants in the instrument driver VXIplug amp play Instrument Driver Files When you install a VXIplug amp play instrument driver the installation program does not place the include 1 file in the same directory as the p file The installation program places it i
64. command Code menu 4 23 to 4 24 6 20 Set Target File dialog box 4 24 Shortcut Key field Edit Menu Bar dialog box 4 10 Show Build Error window for warnings option 3 62 Show Differences command Source Code Control submenu 3 55 National Instruments Corporation 1 25 Index Show Full Dates command View menu 3 10 Show Full Path Names command View menu 3 10 Show Info command Edit Instrument dialog box 3 41 Show Hide Panels command View menu Bring Panel to Front command 4 20 Hide All Panels command 4 19 Next Panel command 4 20 Previous Panel command 4 20 Show All Panels command 4 19 signed unsigned pointer mismatch warning enabling 3 61 single dimensional array displaying in Array Display window figure 8 2 skeleton code definition 2 6 4 3 function skeletons 4 26 placement in target file 4 26 Sleep Policy CVI Environment option 3 65 slide controls definition 6 6 specifying parameters 6 6 software related resources B 2 Sort By Date command View menu 3 10 Sort By File Extension command View menu 3 11 Sort By Name command View menu 3 10 Sort By Pathname command View menu 3 10 Source Code Connection Edit Control dialog box 4 13 Edit Panel dialog box 4 11 Source Code Control command Tools menu Source and Interactive Execution windows 5 34 Source Code Control submenu 3 55 Source Code Control Errors window 3 57 Source Code Control Options command 3 71 LabWindows CVI User Manual I
65. command to specify to which file LabWindows CVI generates code Selecting this command opens the Set Target File dialog box shown in Figure 4 18 By default LabWindows CVI places the generated code in a new window unless a source code c file is open Then that source file is the default target file CodeBuilder uses the National Instruments Corporation 4 23 LabWindows CVI User Manual Chapter 4 User Interface Editor Window same target file as the function panel target file except when the function panel target file is the Interactive Execution window Set Target File Figure 4 18 Set Target File Dialog Box To set a target file select a file from the list of options in the Set Target File dialog box and then click on OK The options include all open source files and a new window Generate You access the CodeBuilder features of LabWindows CVI in the Generate menu item The commands in the Generate menu produce code based on the uir file Figure 4 19 shows the Generate submenu The code produced by the Generate menu uses the bracket styles you specify with the Bracket Styles command in the Options menu of the Source window for your project Code Generate Figure 4 19 Generate Submenu LabWindows CVI User Manual 4 24 WWW ni com Chapter 4 User Interface Editor Window Use the All Code command to generate code to accompany the uir file Selecting Code Generate All Code opens the Generate All C
66. develop function panels for the library create a fp file without any classes or functions In that case LabWindows CVI loads the library at startup but does not include the library name in the Library menu Tools Menu Options Use the Tools Menu Options command to add your own menu items to the Tools menu Each entry consists of a menu item name and an associated command line to execute Each command line consists of a program name and optional arguments When you execute an item from the Tools menu LabWindows CVI calls a system function to start the program as another process The Tools Menu Options command invokes the Tools Menu Options dialog box as shown in Figure 3 24 om Tools Menu Options Menu Item Name NotePad E ditor Command Line co WINDOWS NOTEPAD EXE OK Cancel Figure 3 24 Tools Menu Options Dialog Box National Instruments Corporation 3 69 LabWindows CVI User Manual Chapter 3 Project Window Menu Item Name A list box that contains your current Tools menu entries Command Line An indicator that shows the command line for the currently selected menu item name Add Click on this button to add a new entry Edit Click on this button to edit the selected entry The Add and Edit buttons open the Add Edit Tools Menu Item dialog box as shown in Figure 3 25 cw Add Edit Tools Menu Item x NotePad Editor Program Name c WINDOWS NOTEPAD EXE Browse
67. eee ee i Ee se E 7 6 COUP UES gerne 7 6 ln M 7 6 Save THT 7 6 Most Recently Closed les 7 7 Exit LabwWimndowaiCNl eene enne enne 7 7 Edit Menu for the Variables WindoW essere 7 1 Edit TT Eee ttt eC ER pi edente nena 7 7 Pind erieih eho 2 A i ee A ee eB a i i 7 8 NeXxt9SCOD6 ced te det e He eei SE e teats outs fee E rn 7 9 Previous SCOPC oes ben ege 7 9 Edit Menu for the Watch Wmndow esse eee 7 10 Edit Value sss chet he ied ein IIR 7 10 Add Watch EXpressiOD oet rete erred eite ette e eee e 7 10 Edit Watch Expression sees eee 7 10 Delete Watch Expression seele eet LSU ITA T aeii 7 10 mt ii nese Mie ae AA i eB ERE ORIG dais 7 10 Naew O TT 7 11 Expand Variable et Ren er perpe ETE 7 11 Close Vatrlable eed rette eme e te Hie Hate cete ee S 7 12 Follow Pointer Cham 7 12 Retrace Pointer Chan 7 13 Go To Execution Position Variables Wimdow sess 7 14 National Instruments Corporation XV LabWindows CVI User Manual Contents Go To Definition Variables Window eee 7 14 Array DISplay i icti este ter RIEN IPLE HE FUR ORBE 7 14 Sting Display ueterem ate PE Re eee tee et 7 14 Memory Dis EE 7 14 Format Mem ee Sinead n eosdebet Sea ake 7 15 R n Menu Sei 7 15 Mme eeh eege EDI 7 16 Options M nu ite oet e PEE ERE UE EO DAR ERR pete eR 7 16 Maria Ble SIZ eege cee tte 7 16 Interpret AS 5 ise ert et EET OE RETRO Ee detur perd Res 7 17 Estimate Number
68. example DialogFontSize 30 DialogFontBold DialogFontBold specifies whether the font LabWindows CVI uses in dialog boxes and the built in pop up panels is bold as in the following example DialogFontBold Yes National Instruments Corporation 1 5 LabWindows CVI User Manual LabWindows CVI Overview This chapter describes the components of LabWindows CVI including the LabWindows CVI environment and how to create applications with LabWindows CVI Components of LabWindows CVI LabWindows CVI is a programming environment for developing instrument control automated test and data acquisition applications in ANSI C LabWindows CVI has the following components e Standard libraries and interactive function panels for the following components GPIB RS 232 VISA Virtual Instrument Software Architecture Data acquisition distributed with National Instruments PC based data acquisition boards Data analysis Transport Control Protocol TCP DataSocket Windows Dynamic Data Exchange DDE communication File I O Data formatting ANSIC e A graphical User Interface Editor CodeBuilder Wizard and library for building displaying and controlling a graphical user interface e A wizard and library for controlling ActiveX Automation servers e A wizard and library for creating IVI instrument drivers which are highly structured VXIplug amp play compatible instrument drivers that use an attribute model to enable advanced feat
69. executable The cvidir option specifies the directory that contains the subdirectories National Instruments Corporation 1 3 LabWindows CVI User Manual Chapter 1 Configuring LabWindows CVI Table 1 2 Subdirectories that LabWindows CVI Requires Name of Directory Contents bin Resource files cvi rsc cvimsgs txt National Instruments function panels 1 p files National Instruments libraries obj and 1ib font Font description files include C header files for National Instruments libraries sdk Windows SDK If you do not specify a directory LabWindows CVI assumes that the directory that contains the executable file cvi exe or cvi also contains the directories in Table 1 2 tmpdir tmpdir sets the location for temporary files If you do not specify a directory LabWindows CVI uses the value of the environment variable TMP If the value of TMP is not defined or is invalid LabWindows CVI uses the value of the environment variable TEMP If the value of TEMP is not defined or is invalid LabWindows CVI uses the directory that contains cvi exe If you run LabWindows CVI across a network you must set tmpdir to one of your local directories Date and Time Option DSTRules The DSTRules option allows you to specify the portions of the year daylight savings time is in effect in your area This affects ANSI C Library functions such as mkt ime and localtime Refer to the Time and Date Functions se
70. execute the Goto command a dialog box appears where you can enter the row and column number of the desired location For a single string you specify only the column Edit Menu for the String Display Window This section contains a detailed description of the Edit menu for the String Display window Figure 8 8 shows the Edit menu for the String Display window File Format Run Window Options Help Edit Character Enter Edit Mode Ctrl E v Overwrite Ins Find Goto Shift F3 Figure 8 8 Edit Menu for the String Display Window National Instruments Corporation 8 7 LabWindows CVI User Manual Chapter 8 Array and String Display Windows Edit Character Use the Edit Character command in the String Display window to change one character at a time Edit Mode The Edit Mode command places the String Display window in edit mode so you can directly edit the string from the keyboard This mode is valid only when you select the ASCII display format from the Format menu Also you can edit one character at a time using the Options Edit Character command Overwrite Find Goto Use the Overwrite command in the String Display window to toggle between the overwrite and insert modes of editing The Overwrite command has no effect unless you activate the Edit Mode command The Find command invokes the Find dialog box and operates the same way as it does in the Variables window but with few
71. expression occurrence of character in the search followed by Multiple Files Includes open source files and source files from the project in the search e Selected Text Only Searches only within the region of highlighted text when the highlighted text extends beyond one line LabWindows CVI automatically enables this option when you open the Find dialog box after selecting multiple lines of text in the Source window LabWindows CVI User Manual WWW ni com Chapter 5 Source and Interactive Execution Windows e Wrap Specifies to continue searching from the beginning of the file once the search has reached the end of the file Button Bar Use this option to enable or disable the built in dialog box for interactive searching as shown in Figure 5 9 Find Prev and Find Next operate the same as they do in the main Find dialog box Stop terminates the search leaving the keyboard cursor at the current position Return terminates the search leaving the keyboard cursor at the original position where you began the search Use the Keyboard Help command in the Source Editor window Options menu for a list of the search hot keys Find Prev Ctrl F3 E Stop Esc Retum Found next Figure 5 9 Find Button Bar You can bypass the Find dialog box using the keyboard commands Refer to Appendix A Source Window Keyboard Commands Replace The Replace command operates the same as the Find command exc
72. fp files for support libraries 3 69 illustration 3 67 National Instrument Libraries 3 67 to 3 68 User Libraries section 3 68 to 3 69 Line command View menu 5 19 Line Icons command View menu 5 19 5 27 Line Numbers command View menu 5 19 Line Select mode 5 6 Line Terminator option Editor Preferences command 5 36 to 5 37 lines of code excluding 5 4 5 12 Load command Instrument menu 3 39 to 3 40 Load From Text Format command Options menu 4 36 LoadExternalModule option External Compiler support dialog box 3 23 Target Settings dialog box Target Type Dynamic Link Library 3 19 Target Type Executable 3 16 loading unloading instrument drivers 3 37 to 3 38 instruments without instrument program 3 38 precedence rules 3 37 www ni com _M_IX86 macro 3 63 macros for writing platform dependent code 3 63 Main Function command Generate menu 4 26 to 4 27 manual See documentation Mark All for Compilation command Build menu 3 21 Mark File for Compilation command Build menu Project window 3 21 Source and Interactive Execution windows 5 24 Maximum number of compile errors option 3 60 maximum stack size setting 3 60 Memory Display command Tools menu Project window 3 57 View menu Variables and Watch windows 7 14 Menu Bar Constant Prefix field Edit Menu Bar dialog box 4 9 Menu Bars command Create menu 4 17 Edit menu 4 8 to 4 10 Menu Bars List dialog box available command buttons 4 8 illustrati
73. information on the Configuration submenu The following three debugging levels exist for the source modules in your application No Run time Checking In this mode you can set breakpoints and use the Variables window You have no protection from run time memory errors and you cannot use the Break on Library Errors option Standard In this mode you can set breakpoints use the Variables window and use the Break on Library Errors option You also have protection from run time memory errors Refer to Chapter 1 LabWindows CVI Compiler of the LabWindows CVI Programmer Reference Manual for more information Extended This mode has the same benefits as Standard mode with added user protection that validates every attempt to free dynamically allocated memory by verifying that the address you pass is actually the beginning of an allocated block Require Function Prototypes This option requires you to precede all function references with a full prototype declaration A full prototype includes the function return type and the types of each parameter If a function has no parameters a full prototype must have the void keyword to indicate this case A new style function definition one in which you declare parameters directly in the parameter list can serve as a prototype LabWindows CVI User Manual 3 60 WWW ni com Chapter 3 Project Window Missing prototype errors can occur at the following places Q0 Function po
74. instructions demonstrate e Edit integers and longs in the format in which they appear e Edit real numbers in either scientific or floating point format regardless of the display format e Edit individual array elements by expanding the array using the View Expand Variable command e Edit individual bytes of a string by expanding the string using the View Expand Variable command The bytes appear in the integer format you specify in the Format menu National Instruments Corporation 7 7 LabWindows CVI User Manual Chapter 7 Variables and Watch Windows Find The Find command invokes the dialog box shown in Figure 7 6 Find Prev Case Sensitive MV Name Whole Word v Value Cancel M Wrap M Type Regular Expression v Button Bar Figure 7 6 Find Dialog Box in the Variables Window Enter the text you want to find in the Find What text box If you select text on a single line before you execute the Find command the selected text appears in the Find What text box Otherwise the text you last searched for appears in the box You can access a history of selections for the Find What text box by clicking the mouse on the arrow to the right of the Find What text box or by using the up or down arrow keys on your keyboard e CaseSensitive Finds only the instances of the specified text that match exactly For example if CHR is the specified text the Case Sensitive option finds CHR but not Chr Whole Wor
75. is newer than the version number in the existing file If the file in the distribution kit has a version resource but the existing file does not the installation program replaces the existing file When the file in the distribution LabWindows CVI User Manual 3 28 WWW ni com Chapter 3 Project Window kit does not have a version resource the installation program replaces the existing file if the date of the file in the distribution kit is newer Add Group This button lets you add a new group to your distribution kit Edit Group This button lets you edit the selected group Delete Group This button lets you delete the selected group from your distribution kit e Advanced When you click on this button the Advanced Distribution Kit Options dialog box appears as shown in Figure 3 11 tw Advanced Distribution Kit Options Installation Script File v Use Custom Script Script Filename c NcvibD binNtemplate inf Browse Executable to Run After Setup Executable Filename none Select d i Command Line Arguments Help Installation Titles Program Group Name sample3 ru Installation Name sample3 T Use Default Figure 3 11 Advanced Distribution Kit Options Dialog Box The dialog box has the following options Use Custom Script Select this option to enter the name of a customized installation script file for your distribution
76. keyboard entry necessary when using function panels When you execute the Select Variable command the Select Variable or Expression dialog box appears as shown in Figure 6 9 cw Select Variable or Expression Data Type of Contro ViSession Variable or Expression Data Type l scope er int Show Project Variables Cancel Figure 6 9 Select Variable or Expression Dialog Box e Data Type of Control Indicates the data type of the currently active function panel control e Variable or Expression Contains the variables and expressions that have data types compatible with the data type of the control e Data Type Indicates the data type of each variable and expression e Show Project Variables Adds to the list box global variables static and non static defined in project files that have been successfully compiled National Instruments Corporation 6 17 LabWindows CVI User Manual Chapter 6 Using Function Panels OK Dismisses the dialog box and copies the variable or expression into the function panel control It might add a leading ampersand amp when the function panel control is an output control It might add one or more leading asterisks or a trailing array indexation 0 when necessary to correctly match the data type of the control Cancel Cancels the operation What is Included in a List Box Select Variable considers the following items for inclusion in the list box Variable
77. menu item is displayed if the Release item is checked in the Configuration submenu and the Static Library item is checked in the Target Type submenu Use this menu item to compile and build a static library without debugging information This command ignores the value of the Debugging level control on the Build Options dialog box You can set the filename of the static library as well as other static library settings using the Target Settings dialog box displayed by the Target Settings menu item You can set other compile and run options using the menu items in the Options menu of the Project window LabWindows CVI User Manual 3 12 www ni com Chapter 3 Project Window B Note If you include a 1i file in a static library project LabWindows CVI includes all object modules from the 1ibin the static library This differs from creating an executable or DLL in which LabWindows CVI includes only the 1ib modules that other modules in the project reference In addition LabWindows CVI reports an error if you attempt to build a static library when you have a DLL import library in your project Selecting Debug from the Configuration submenu changes the Create command to Create Debuggable Executable or Create Debuggable Dynamic Link Library depending on the Target Type setting iyi Note The Debug and Execute commands in the Run menu start debugging or executing the target file for the current configuration e The Create Debuggable Executab
78. of Elements essen eene 7 17 Add Watch Expression Variables Window eese 7 17 mum 7 17 Chapter 8 Array and String Display Windows Array Display WindowW iiscieete npn teet teer E RHET RR RR TP RR ees 8 1 Multi Dimensional Arrays esee eren eene 8 3 String Display Window esses ener nennen nennen treten treten eren 8 4 Multi Dimensional String Aan 8 4 ET E 8 5 ET 8 5 Open oen ene ERE eee Ea Sette 8 5 inp M 8 5 Input Array Display Wmdouw eene 8 6 a c 8 6 Save All c op AREE eae eae 8 6 Most Recently Closed Files e D Ire He Ce aZe 8 6 Exit LabWindows CVI essere ene er ir 8 6 Edit Menu for the Array Display Window sss esse sees 8 6 Edit Value eese emque Une ees 8 6 Find 8 7 Le c SERRE aed eode dete Ip p epe 8 7 Edit Menu for the String Display Window esee 8 7 Edit Characters iu oce tUe RR RU 8 8 Edit MOG sn eem ns et meme oe n P ie eec ins 8 8 OVerWrIlte eege EE dh 8 8 Find ene eee e den d ees 8 8 E01 EE 8 8 Format TTT 8 8 Run Mente ccna hea nie ei Ge AS RA eeiSES 8 9 Window Men nes cone dbi etr gedet P LA seve CHER e ete reta 8 9 LabWindows CVI User Manual Xvi www ni com Contents Options Menu iet terret e cei e une 8 10 Reset Indices nire eee tee tute timere Ond 8 10 Display Entire Buffer S
79. on OK a small gap the separator appears in the toolbar to the right of the selected button Other Positioning Controls You can select any item in the list box on the right and use the Remove button to remove it from the toolbar If you remove a button it moves to the list box on the left If you remove a separator it disappears from the list Your modifications take effect on the toolbar when you click on OK Click on Default to restore the default toolbar configuration for LabWindows CVI To position any item on the toolbar select it in the list box and click on Move Up or Move Down Your modifications take effect on the toolbar when you click on OK Notification of External Modification If you have externally modified a file since you last loaded or saved it in LabWindows CVI and the file is in a Source window a dialog box appears when you switch back to LabWindows CVI from another Windows application You are given the option of updating the Source window from the file on disk overwriting the file on disk with the contents of the Source window or doing nothing Context Menus You can open a context menu in the Source window by clicking the right mouse button The context menu contains a set of the most commonly used menu commands from the Source window menu bar The set of commands is different depending on whether the mouse is over the text editing area or over the line number or line icon area National Instrumen
80. p file in the project list Thus x obj and x c cannot be in the project list at the same time unless you exclude one or both of them s fboth of the following conditions apply the lib file is associated with the fp file The fp file is under the VXIplug amp play framework directory A 1ib file is in the appropriate VXIplug amp play framework subdirectory Table 3 2 shows the corresponding subdirectories Table 3 2 VXIplug amp play Framework Subdirectories Corresponding Subdirectory that Compatible Compiler Contains the lib File Visual C C lib msc Borland C C C Builder lib be Watcom C C lib we Symantec C C libNsc e Ifan instrument driver program file is on disk in the same directory as the fp file LabWindows CVI loads it with the following precedence l it 2 0obj National Instruments Corporation LabWindows CVI User Manual Chapter 3 Project Window Loading an Instrument without an Instrument Program You can load a fp file as an instrument even if no program file exists for it In this case LabWindows CVI does not associate a program with the fp file Nevertheless the fp file appears in the Instrument menu This is useful if you want to use fp files for documenting functions in your project When you do not provide a program file for the fp file you cannot execute the function panels but you can insert code into Source windows from them
81. same manner Running an External Process To debug a DLL that an external process uses load the DLL project into LabWindows CVI Select Run Select External Process in the Project window A dialog box appears that allows you to enter the pathname of an external process and command line arguments LabWindows CVI stores this information in the project After you have specified the pathname of an external process the Debug Project item in the Run menu changes to Debug xxx exe where xxx exe is the filename of the external process Execute the Debug xxx exe command LabWindows CVI starts the external process and attaches to it for debugging If you have set any breakpoints in the source files for the DLL LabWindows CVI honors them If the external process loads other debuggable DLLs you can debug them even though a project for a different DLL is open LabWindows CVI handles the other DLLs as described in the Running a Program in LabWindows CVI discussion earlier in this section LabWindows CVI User Manual 3 32 WWW ni com Chapter 3 Project Window B Note The command line arguments that you set in the Select External Process dialog box are the same command line arguments that you set using Options Command Line in the Project window Run Menu This section explains how to use the commands in the Project window Run menu as shown in Figure 3 12 You can use commands in the Run menu to run your program and assign breakpoints For more info
82. same way as the Help menu in the Project window Refer to the Help Menu section of Chapter 3 Project Window for information on the Help menu LabWindows CVI User Manual 8 10 www ni com Source Window Keyboard Commands The following table can help you quickly identify common Source window keyboard commands that are not in the menus Table A 1 Keyboard Help Category Action Shortcut Key s Finding Searching Find again up lt Ctrl F3 gt Find again down lt F3 gt Use selected text as lt Ctrl Shift F3 gt search string Replace selected text lt Ctrl F11 gt Replace selected text and lt F11 gt find again Use selected text as lt Ctrl Shift F11 gt replace string Windowing Next window lt Ctrl F6 gt Previous window lt Crtl Shift F6 gt Switch subwindows lt F6 gt National Instruments Corporation A 1 LabWindows CVI User Manual Appendix A Source Window Keyboard Commands Table A 1 Keyboard Help Continued Category Action Shortcut Key s Editing Change text selection mode lt Ctrl Ins gt Toggle insert overwrite mode lt Ins gt Delete to end of line lt Ctrl D gt Backspace to beginning of word lt Ctrl Shift BkSp gt Cut line to Clipboard lt Ctrl Y gt Insert a new line above lt Shift Enter gt Insert a new line below lt Ctrl Enter gt Select text lt Shift arrow key gt Remove text sele
83. sequence because you want to load the file into another editor use the Line Terminator option as follows Ifyou want to load your text file into DOS Windows editors select CR LF termination Ifyou want to load your text file into a Macintosh editor select CR termination Toolbar Use the Toolbar command to select which icons appear in the Source window toolbar Bracket Styles The Bracket Styles command allows you to set the location of curly brackets when the following commands generate them in your program s The Edit Insert Construct command in a Source window s The Code Generate command in a the User Interface Editor window You can specify two bracket styles one for functions and another for statements such as i and switch statements Font Use the Font command to select the font and font size for text in Source windows Interactive Execution windows and Variables windows You can select from a list of monospace fonts Colors The Colors command for the Source and Interactive Execution windows works the same as the Colors command in the Project window Refer to the Options Menu section of Chapter 3 Project Window for a more information Syntax Coloring When you enable the Syntax Coloring command LabWindows CVI color codes the various types of tokens in your source and include files The following are different types of tokens that can be color coded e C keywords e Identifiers e Comments e In
84. that displays a value returned from a function as a return value rather than as a formal parameter LabWindows CVI User Manual Glossary ring control S scroll bars scrollable text box select shortcut key commands slide control slider Source window Standard Input Output window standard libraries String Display window T text box LabWindows CVI User Manual A function panel control that represents a range of values much like the slide control but displays only a single item in a list rather than displaying the whole list at once as the slide control does Each item has a different value associated with it This value is placed in the function call Areas along the bottom and right sides of a window that show your relative position in the file Scroll bars can be used with a mouse to move about in the window A dialog box item that displays text in a scrollable display To choose the item that the next executed action will affect by moving the input focus highlight to a particular item or area A combination of keystrokes that provide a means of executing a command without accessing a menu in the menu bar A function panel control that resembles a physical slide switch A slide control is a means for selecting one item from a list of options it inserts a value in a function call that depends on the position of the crossbar on the switch The crossbar on the slide control that determines the value p
85. the Variables window except that you can select your own set of variables and expressions to view in the Watch window By default LabWindows CVI updates variables and expressions in the Watch window at each breakpoint but you also can set them to update continuously and cause a breakpoint when their values change To activate the Watch window select Window Watch in the active LabWindows CVI window Figure 7 2 shows an example of the Watch window File Edit View Format Run Window Options Help glob Current Project Figure 7 2 Watch Window Select Watch window variables from the Variables window using the Options Add Watch Expression command The Add Watch Expression command opens the dialog box shown in Figure 7 3 tw Add Edit Watch Expression Le Scope 4 Local Update display continuously Project DLL Current Project ei Break when value changes File x Function vi Replace Figure 7 3 Add Edit Watch Expression Dialog Box LabWindows CVI User Manual 7 4 www ni com Chapter 7 Variables and Watch Windows The Add Edit Watch Expression dialog box has the following options e Variable Expression Contains the variable or expression to place in the Watch window e Scope Corresponds to whether the variable or expression variables are global to the project global to a file local to a function or global to the Interactive Execution window Executable DLL I
86. the currently selected control Pressing the lt Tab gt key selects the next control Pressing lt Shift Tab gt selects the previous control To select a control with the mouse click on the control Pressing lt Page Up gt or lt Page Down gt moves the input focus across multiple function panels in one window Pressing lt Ctrl Page Up gt and lt Ctrl Page Down gt moves from one Function panel window to the next LabWindows CVI User Manual 6 4 www ni com Chapter 6 Using Function Panels The way you specify parameter values differs for each type of control The following sections contain instructions for specifying parameters for each type of control Specifying a Return Value Control Parameter A return value control displays a value that a function returns as a return value rather than as a formal parameter For scalar return values you can leave the control blank LabWindows CVI generates a temporary variable when you run the function panel If you type a variable name into a return control you must define the variable statically in the Interactive Execution window or define it elsewhere and declare it as extern in the Interactive Execution window before you execute the function You can select Code Declare Variable to define the variables in the Interactive Execution window You can select Code Select Variable to choose a variable or expression that you have used before The type of value you enter must agree with the data type o
87. this control to If Needed the files required to use the DataSocket Library will be included in your distribution only if your project uses the DataSocket library Set this control to Always and the DataSocket files will always be included in your distribution Set this control to Never and the DataSocket files will never be included in your distribution Install NI Reports Support JC you set this control to If Needed the files required to use the NI Reports instrument driver will be included in your distribution only if your project uses the NI Reports instrument driver Set this control to Always and NI Reports files will always be included in your distribution Set this control to Never and the NI Reports files will never be included in your distribution Table 3 1 Platforms Where Utility Functions Require the Low Level Support Driver Platforms that Require the Function Low Level Support Driver inp Windows 2000 NT inpw Windows 2000 NT outp Windows 2000 NT outpw Windows 2000 NT ReadFromPhysicalMemory All ReadFromPhysicalMemoryEx All LabWindows CVI User Manual www ni com Chapter 3 Project Window Table 3 1 Platforms Where Utility Functions Require the Low Level Support Driver Continued Platforms that Require the Function Low Level Support Driver WriteToPhysicalMemory All WriteToPhysicalMemoryEx All apPhysicalMemory All UnMapPhysicalMemory All DisableInt
88. through the project remain in memory while the project is open Use the All Files command to add any file to your project The All Files command brings up the Add Files to Project dialog box and lists all files available in the selected directory Select All Use the Select All command to select all of the files in the project You select specific files using the keyboard and mouse as described in the Selecting Multiple Files in the Project Window section earlier in this chapter Exclude File from Build Include File in Build The Exclude File from Build command excludes the highlighted code module file from the build This command does not apply to h fp or uir files Excluded files appear in a different color in the Build window LabWindows CVI does not compile or link them into the project When you exclude a file the command toggles to Include File in Build so you can include the file in the build again Remove File Use the Remove File command to remove the selected files from the project list Move Item Up Use the Move Item Up command to move the selected files up one line in the project list To activate this menu item select No Sorting from the View menu National Instruments Corporation 3 9 LabWindows CVI User Manual Chapter 3 Project Window Move Item Down Use the Move Item Down command to move the selected files down one line in the project list To activate this menu item select No Sorting from the View menu
89. to 3 35 selecting multiple files 3 3 Tools menu 3 48 to 3 55 using instrument drivers 3 35 to 3 39 View menu 3 10 to 3 11 Window menu 3 55 to 3 58 Prompt for include file paths option 3 62 Properties command Source Code Control submenu 3 55 Purge Undo Actions When Saving File option Editor Preferences command 5 36 Q Quick Edit Window Edit Control dialog box 4 14 Edit Panel dialog box 4 12 www ni com R Read Only command File menu Source and Interactive Execution windows 5 9 User Interface Editor 4 5 Reattach Program command Edit Instrument dialog box 3 41 Recall Function Panel command View menu invoking 5 20 multiple functions in one function panel window 5 21 multiple panels for one function 5 21 purpose 5 20 recalling from function name only 5 21 syntax requirements 5 21 Redo command Edit menu 4 6 to 4 7 5 11 Refresh Status command Source Code Control submenu 3 55 regular expression characters table 5 15 to 5 16 Regular Expression option Find command Source and Interactive Execution windows 5 15 to 5 16 Variables window 7 8 Regular Expression option Find UIR Objects dialog box 4 18 to 4 19 Release option Configuration command 3 11 to 3 12 Remove File command Edit menu 3 9 Remove From Source Control command Source Code Control submenu 3 54 Replace command Edit menu button bar figure 5 17 Find Next button 5 17 Replace button bar figure 5 17 Replace All button 5 17
90. to another compiler Help Menu The Help menu for Source and Interactive Execution windows works the same way as the Help menu in the Project window except that it also includes Keyboard Help Refer to the Help Menu section of Chapter 3 Project Window for information on the Help menu Keyboard Help The Keyboard Help command invokes a scrollable list of keyboard shortcut keys Appendix A Source Window Keyboard Commands shows these shortcut keys LabWindows CVI User Manual 5 40 www ni com Using Function Panels This chapter describes how to use LabWindows CVI function panels to generate code to call functions in any of the LabWindows CVI libraries A function panel is an interface to the functions in the LabWindows CVI libraries and instrument drivers You can use function panels to help generate and test function calls within LabWindows CVI A Function Panel window generates one or more function calls with function parameters you specify in the function panel LabWindows CVI can execute these functions immediately in the Interactive Execution window When you execute a function panel LabWindows CVI copies the generated code to the Interactive Execution window and executes it The first time you execute a function panel for an instrument driver or library LabWindows CVI creates and executes an include statement for the header file associated with the instrument driver or library Other sections of this chapter discuss the rela
91. window figure 7 12 Exports option Target Settings dialog box 3 20 expressions See also watch variables expressions regular expressions table 5 15 to 5 16 External Compiler Support command 3 21 External Compiler Support dialog box 3 22 to 3 24 ANSI C Library 3 23 CVI Libraries 3 23 illustration 3 22 LabWindows CVI User Manual Index Other Symbols 3 23 Header File field 3 23 Object File field 3 23 UIR Callbacks Object File 3 22 Using LoadExternalModule to Load Object and Static Library Files 3 23 external process debugging DLLs 3 22 selecting 3 34 5 28 eyedropper tool 4 2 F file extensions displaying project files in order of 3 11 File Groups section Create Distribution Kit dialog box 3 27 to 3 29 File menu Array and String Display windows Close command 8 6 Exit LabWindows CVI command 8 6 illustration 8 5 Input command 8 6 most recently closed files list 8 6 New command 8 5 Open command 8 5 Output command 8 5 Save All command 8 6 Function Panel windows Add FP File to Project command 6 8 Add Program File to Project command 6 9 Close command 6 8 Exit LabWindows CVI command 6 9 illustration 6 8 most recently closed files list 6 9 New command 6 8 LabWindows CVI User Manual I 12 Open command 6 8 Save All command 6 8 Project window 3 4 to 3 7 Auto Save Project command 3 7 Exit LabWindows CVI command 3 7 illustration 3 4 most recently closed files list 3 7 Ne
92. www ni com Chapter 3 Project Window When you select the Create Distribution Kit command the Create Distribution Kit dialog box appears as shown in Figure 3 10 tw Create Distribution Kit Build Information Installation Directory Browse Media Size 1 44 MB kBytes Reserved on First Disk z 0 Installation Language English Install Run Time Engine Install in Windows System Directory Install Low Level Support Driver T E Install Data Socket Support 4 If Needed Install NI Reports Support 4 If Needed File Groups Group Destination Application Directory Relative Path IV Install Program Manager Icons Distribute Objects Libraries For All Compilers amp lempsvs Files gl Replace Existing Files Sich Add Group Edit Group Delete Group Advanced Default Cancel Figure 3 10 Create Distribution Kit Dialog Box e The Build Information section of the Create Distribution Kit dialog box has the following options Installation Directory The default directory that appears in the user installation Target Path The path into which you want to build your distribution kit 3 Note When you define a target path to a floppy disk you must specify the root directory Browse This button lets you browse for a target path on disk Media Size The media size of your distribution disks When you choose a floppy d
93. you check this box your executable is created as a console application Console applications create a Windows console window Command Prompt or MS DOS Prompt and default the standard I O port to the console LabWindows CVI User Manual 3 14 www ni com Chapter 3 Project Window Refer to the LabWindows CVI Online Help for Set StdioPort for information on standard I O port options Create a console application if you want to be able to redirect the standard input or output of your program e Instrument Driver Support Only If you check this box your project does not link to the entire set of LabWindows CVI libraries but to a smaller set of functions Standalone executables and DLLs you create when the Instrument Driver Support Only command is enabled do not use the LabWindows CVI Run time Engine DLL cvirte dll Instead they use inst rsup d11 which is much smaller This command is particularly useful for creating instrument driver DLLs It allows other applications to use instrument driver DLLs without having to load the large LabWindows CVI Run time Engine DLL If you use a standalone compiler and want to use inst rsup d11 include cvi extlib instrsup lib in your external compiler project instead of cvirt 1ib and cvisupp lib Remember that when you use an external compiler you link to that compiler s ANSI C library instrsup dl1l contains functions from the following libraries Formatting and I O Library Except ArrayToFile and Fil
94. 10 Insert Separator field Edit Menu Bar dialog box 4 10 instrsup dll libraries supported by 3 15 Utility Library functions contained in 3 16 Instrument command 3 9 Instrument Directories command Options menu 3 64 instrument driver function panel fp files adding to project list 6 8 dummy fp files for support libraries 3 47 3 69 purpose and use 3 1 Instrument Driver Support Only option Target Settings dialog box Target Type Dynamic Link Library 3 17 to 3 18 Target Type Executable 3 15 to 3 16 instrument drivers See also IVI instrument drivers compared with user libraries 3 68 definition 3 35 files for instrument drivers 3 35 to 3 36 forcing source code for loaded driver into Interactive window 3 66 loading unloading 3 37 to 3 38 instruments without instrument program 3 38 precedence rules 3 37 modifying 3 38 to 3 39 www ni com modules containing non instrument functions 3 38 programming 3 1 VXIplug amp play instrument driver files 3 36 Instrument Help dialog box figure 3 43 Instrument Library 2 4 Instrument menu accessing function panels 6 2 Function Panel windows 6 22 illustration 3 39 Project window accessing function panels 3 42 to 3 43 Edit command 3 40 to 3 41 illustration 3 39 Load command 3 39 to 3 40 loading user libraries 3 47 Unload command 3 40 Source and Interactive Execution windows 5 33 Intelligent Virtual Instrument drivers See IVI instrument drivers Intell
95. 13 LabWindows CVI User Manual Chapter 4 User Interface Editor Window Ring controls and list boxes have a Label Value Pairs button in the Control Settings section of the Edit control dialog box This button activates the Edit Label Value Pairs dialog box shown in Figure 4 9 W Edit Label alue Pairs a Figure 4 9 Edit Label Value Pairs Dialog Box Use the Edit Label Value Pairs dialog box to create and edit the contents of ring and list box controls Use the list control functions in the User Interface Library to control rings and list boxes The Control Appearance section of the Edit control dialog box for a numeric control displays specific attributes for the type of control that you are editing It contains attributes pertaining to the physical appearance of the control e From the Quick Edit Window you can perform high level edits on the control The tools in the tool bar operate like the tools in the main User Interface Editor window The Quick Edit Window also immediately reflects any changes you make in other sections of the dialog box Simply stated the Edit control dialog box of any control allows you to interactively set all of the attributes of the control The control types discussion in the LabWindows CVI Online Help describes these attributes in detail e The Label Appearance section of the Edit control dialog box contains attributes pertaining to the physical appearance of the control label LabWindows CVI User M
96. 3 Project Window In the National Instruments section click on the selection box to the left of the library name s that you want LabWindows CVI to load at startup Use the National Instruments Libraries section of the Library Options dialog box to specify whether or not to load these libraries into memory when you start LabWindows CVI A checkmark next to the library name indicates that you want the library to be loaded Changes do not take effect until the next time you launch LabWindows CVI If you do not load a library you cannot call any of the functions in that library and you cannot access any of its function panels If LabWindows CVI fails to load a requested library it is probably because LabWindows CVI cannot find the appropriate files The files in Table 3 3 belong in the bin directory of the LabWindows CVI installation directory Table 3 3 Libraries in the bin Directory of LabWindows CVI Library Windows Analysis or Advanced Analysis analysis lib Data Acquisition dataacq lib Easy I O for DAQ easyio lib VXI nivxi lib GPIB GPIB 488 2 gpib lib You must also install the drivers that came with your Data Acquisition VXI and GPIB GPIB 488 2 hardware to use the optional libraries User Libraries The User Libraries section of the Library Options dialog box contains the pathnames of user libraries that load automatically when you start LabWindows CVI The entries must be the pathnames of the fun
97. 3 16 www ni com Chapter 3 Project Window e OK This button accepts the current inputs and closes the dialog box e Cancel This button cancels the operation and removes the dialog box When you set the Target Type to Dynamic Link Library and select Build Target Settings the Target Settings dialog box has the following options DLL File The name of the DLL files for the debug and release versions of your program Changing the value of the ring control allows you to edit the filename for the debug and release configurations You can use the Browse button to select an existing filename Import Library Base Name Normally the name of the import library is the same as the name of the DLL except that the extension is 1ib There might be some cases however where you want to use a different name For example you might want to append _32 to the name of your DLL to distinguish it as a 32 bit DLL but not append it to the import library name This is in fact the convention used for VXIplug amp play instrument driver DLLs If you want to enter a different name for the import library deselect the Use Default option Enter a name without any directory names e Where to Copy DLL Use this ring control to instruct LabWindows CVI to copy the DLL to a different directory after creating it Your choices are the following Do not copy Windows System directory VXlIplug amp play directory the bin directory under the VXIp ug
98. 3 42 6 2 LabWindows CVI User Manual Index Follow Pointer Chain command View menu 7 3 7 12 to 7 13 Font command Options menu Project window 3 73 Source and Interactive Execution windows 5 37 font directory table 1 4 font options DialogFontBold 1 5 DialogFontName 1 5 DialogFontSize 1 5 fonts setting and applying defaults 4 16 format conversion of files during loading 3 40 Format menu Array and String Display windows 8 8 to 8 9 Variables and Watch windows 7 15 Formatting and I O command Library menu 3 47 Formatting and I O Library 3 47 fp files See instrument driver function panel fp files function classes 6 2 Function command Help menu 6 25 function panel recalling See Recall Function Panel command View menu function panel controls binary control parameter 6 6 common control panel 6 7 global control 6 7 illustration 6 4 input control parameter 6 5 numeric control parameter 6 5 output control parameter 6 7 overriding with Toggle Control Style command 6 24 restoring default value 6 24 return value control parameter 6 5 ring control parameter 6 6 slide control parameter 6 6 types of controls figure 6 4 LabWindows CVI User Manual 1 14 viewing arrays structures and variables 6 7 Function Panel Editor window 2 5 Function Panel Help Editor window 2 5 Function Panel History command View menu Function Panel windows 6 21 Source and Interactive Execution windows 5 20 Func
99. 4 20 Figure 4 17 Code Men eee eet rrt VEER 4 23 Figure 4 18 Set Target File Dialog Box esee 4 24 Figure 4 19 Generate Submenu nennen nennen 4 24 Figure 4 20 Generate All Code Dialog Box 4 25 Figure 4 21 Generate Main Function Dialog Box 4 27 Figure 4 22 Generate Code Dialog Box 4 29 Figure4 23 View Menu secet eee Depp Up poire 4 29 Figure 4 24 Preferences Men 4 30 Figure 4 25 Run Menu psc een eere DIR EES EEN 4 31 Figure 4 26 Options Men 4 32 Figure 4 27 User Interface Preferences Dialog Box 4 33 Figure 4 28 Other User Interface Editor Preferences Dialog Box 4 35 Figure 5 1 Customize Source Window Toolbar Dialog Box 5 2 Figure 5 2 Selecting Text Using Character Select Mode A 5 6 Figure 5 3 Selecting Text Using Line Select Mode A 5 6 Figure 5 4 Selecting Text Using Column Select Mode 5 7 Figure 5 5 Fle Menu conoci ee EE EES 5 7 Figure5 6 EditMenu iiisnsheseee esee ne Cen eee tete gs 5 10 PFigure5 7 Duff Submenu itae die qe EE 5 13 Figure5 8 Find Dialog Box ence eerte 5 14 LabWindows CVI User Manual xviii www ni com Contents Figure 5 9 Find Button Bar 5 17 Figure 5 10 Replace Button Bar serez steerer raet trO nennen nennen 5 17 Figure5 Il View O Te T 5 18 Figure5 12 Build O TTT 5 23 Figure 5 13 Run Menu iiie ete ata Mache etd 5 26 Figure 5 14 Breakpoints Dialog Box esse sese 5 30 Figure 5 15 E
100. 4 21 Alignment command 4 21 Center Label command 4 23 Control Coordinates command 4 23 Control ZPlane Order command 4 22 Distribute Vertical Centers command 4 22 Distribution command 4 21 to 4 22 illustration 4 20 Array Display command View menu 7 14 8 1 Array Display window Edit menu 8 6 to 8 7 File menu 8 5 to 8 6 Format menu 8 8 to 8 9 LabWindows CVI User Manual Index Help menu 8 10 invoking 8 1 multi dimensional arrays illustration 8 3 Reset Indices dialog box 8 3 to 8 4 specifying dimensions 8 3 to 8 4 Options menu 8 10 purpose and use 2 5 8 1 Run menu 8 9 single dimensional array figure 8 2 View menu 3 57 Window menu 3 57 8 9 ASCII text format loading objects into User Interface Editor window 4 36 saving contents of User Interface Editor window in 4 36 Assign Missing Constants command Options menu 4 36 Attach and Edit Source command Edit Instrument dialog box 3 41 attribute constants selecting 6 13 to 6 16 Attributes for Child Panels section Edit Panel dialog box 4 12 Auto Save Project command File menu 3 7 Automation Controller Advanced Options dialog box 3 51 to 3 53 Cancel button 3 53 Context Sensitive Help buttons 3 53 Function Prototype 3 52 Help button 3 53 illustration 3 51 Instruments Prefix 3 51 Method Description 3 52 Method Names Too Long 3 52 Method Tag 3 52 Methods of Object 3 52 Methods Properties Menu Ring 3 52 Object Description 3 52 Object Ta
101. 4 27 Worldwide technical support B 2 Wrap option Find command Source and Interactive Execution windows 5 17 Variables window 7 8 Find UIR Objects dialog box 4 18 www ni com
102. 488 2 protocol You must have a National Instruments GPIB hardware interface and software driver Refer to the NI 488 2M Software Reference Manual and either the NI 488 2 Function Reference Manual for DOS Windows or the NI 488 2M Function Reference Manual for Windows included with your GPIB 488 2 controller board for a software overview and function descriptions Refer to the LabWindows CVI Online Help for a description of the Device Manager routines which ensure against device name conflicts when using instrument drivers RS 232 VISA IVI Use the RS 232 Library to control the RS 232 serial ports on your computer Refer to the LabWindows CVI Online Help for RS 232 function descriptions The VISA Library gives VXI and GPIB software developers particularly instrument driver developers a single interface library for controlling VXI GPIB and RS 232 instruments The NI VISA Programmer Reference Manual available upon request describes the functions The IVI Library gives developers a structured framework for creating VXIplug amp play instrument drivers with advanced features such as state caching simulation and compatibility with generic instrument classes The Create IVI Instrument Driver Wizard National Instruments Corporation 3 45 LabWindows CVI User Manual Chapter 3 TCP Project Window supplements the library automatically creating the skeleton of an IVI driver that includes source code and function panels The LabWi
103. 5 22 User Interface option Add Files to Project command 3 9 user interface resource uir files displayed in Window menu 3 58 optional for project file list 3 1 support in External Compiler Support dialog box 3 22 user libraries See also libraries dummy fp files for support libraries 3 47 3 69 installing into Library menu 3 47 instrument drivers vs 3 68 specifying in Library Options dialog box 3 68 UsingLoadExternalModule to Load Object and Static Library Files option External Compiler support dialog box 3 23 Utility command Library menu 3 47 Utility Library 3 47 V value constants selecting 6 15 to 6 16 Value option Find command 7 8 Variable Size command Options menu 7 16 to 7 17 variables selecting See Select Variable or Expression Dialog Box Variables command Window menu Project window 3 57 Variables window 7 1 Variables window 7 1 to 7 3 Edit menu 7 7 to 7 9 File menu 7 6 to 7 7 Format menu 7 15 Function subwindow 7 2 LabWindows CVI User Manual 1 30 Global subwindow 7 2 Help menu 7 17 icons associated with variables 7 3 illustration 7 2 Options menu 7 16 to 7 17 purpose and use 2 5 Run menu 7 15 to 7 16 View menu 7 11 to 7 14 viewing 7 1 Window menu 7 16 Version Info button Target Settings dialog box Target Type Dynamic Link Library 3 18 Target Type Executable 3 16 Vertical Centers option Alignment command 4 21 Distribution command 4 21 Vertical Compress option
104. 5 30 to 5 32 Continue command 5 29 Debug Run Interactive Statements command 5 28 to 5 29 Down Call Stack command 5 32 Finish Function command 5 30 Go To Cursor command 5 29 illustration 5 26 Run Interactive Statements command 5 28 to 5 29 Stack Trace command 5 32 Step Into command 5 29 Step Over command 5 29 Terminate Execution command 5 30 Threads command 5 32 Toggle Breakpoint command 5 27 5 30 Up Call Stack command 5 32 View Variable Value command 5 32 7 1 8 4 User Interface Editor 4 31 Variables and Watch windows 7 15 to 7 16 Run Options command Options menu 3 65 Break On First Chance Exceptions 3 65 Break on library errors option 3 65 Hide windows 3 65 Save changes before running 3 65 run startup option table 1 1 run_then_exit startup option table 1 1 run time error reporting Run menu Project window 3 33 to 3 34 Source and Interactive Execution windows 5 29 LabWindows CVI User Manual 1 24 Run Time Errors command Window menu 3 56 S Save command File menu Project window 3 7 Source and Interactive Execution windows 5 8 User Interface Editor 4 4 Save All command File menu Array and String Display windows 8 6 Function Panel windows 6 8 Project window 3 7 Source and Interactive Execution windows 5 9 User Interface Editor 4 5 Variables and Watch windows 7 6 Save As command File menu Project window 3 7 Source and Interactive Execution windows 5 8 User Interface Edi
105. 9 Generate Prototypes command Build menu 5 25 Generate Visual Basic Include command Options menu 5 39 Generate WinMain Instead of Man checkbox Generate Main Function dialog box 4 27 generated code box Function Panel window 6 4 Get Latest Version command Source Code Control submenu 3 54 Get Latest Version of All command Source Code Control submenu 3 54 global control 6 7 Global subwindow Variables window 7 2 Go To Cursor command Run menu 5 29 Go To Definition command Edit menu 5 14 View menu 7 14 National Instruments Corporation Index Go To Execution Position command View menu 7 14 Goto command Edit menu Array Display window 8 7 String Display window 8 8 GPIB Library 3 45 GPIB GPIB 488 2 command Library menu 3 45 H header files including in project 3 9 optional in project file list 3 1 previewing 4 20 Help dialog box for functions windows or classes 3 43 Help Editor windows displayed in Window menu 3 58 Help menu Array and String Display windows 8 10 Function Panel windows Control command 6 25 Function command 6 25 Project window About LabWindows CVI command 3 74 Contents command 3 74 Search for Help On command 3 74 Tip of the Day 3 74 Web Links 3 74 Windows SDK 3 74 Source and Interactive Execution windows 5 40 Keyboard Help command 5 40 User Interface Editor window 4 37 Variables and Watch windows 7 17 Hide All Panels command 4 19 LabWindows CVI User
106. Below Old Skip Stop Figure 4 22 Generate Code Dialog Box View Use the Code View command to look at code for a given callback function Figure 4 23 shows the View submenu File Edit Create View Arrange ESSE Run Library Tools Window Options Help Set Target File Generate Panel Callback Ctrl P Control Callback Ctrl B Preferences E Figure 4 23 View Menu To view the code for a function from the uir file select a panel or control and then select View Panel Callback or View Control Callback The source file containing the callback function appears with the function name highlighted You also can view the code for a control callback function by clicking on the control with the right mouse button and selecting the View Control Callback command from the pop up menu National Instruments Corporation 4 29 LabWindows CVI User Manual Chapter 4 User Interface Editor Window When you choose the View command for a callback function LabWindows CVI searches for that function in all open Source windows in all the source files in the project and in any other open source files If the function is found in a closed project file that file is opened automatically The View command is useful because the callback functions for one user interface can be in several different files and scrolling the source code is not efficient With the View command you can move instantly from the user inte
107. Cancel the operation The Go to Line button takes you to the source code location of the currently selected breakpoint The Delete Item button deletes the currently selected breakpoint The Delete AII button deletes all the breakpoints The Disable All button forces LabWindows CVI to ignore all the breakpoints The breakpoint icons in the Source window change color to indicate that you disabled them The Enable All button activates all the breakpoints The breakpoint icons in the Source window change color to indicate that you enabled them National Instruments Corporation 5 81 LabWindows CVI User Manual Chapter 5 Source and Interactive Execution Windows The OK button accepts the current breakpoint attributes and the Cancel button cancels the current operation Stack Trace You can use the Stack Trace command only when in a breakpoint state Stack Trace opens a dialog box that lists the currently active functions in the program displaying the most recently called function at the top and the initial function at the bottom If you highlight a function in the list and select Display a Source window appears with the file that contains that function LabWindows CVI highlights the last statement that your program executed in that function Up Call Stack You can use the Up Call Stack command only when in a breakpoint state Up Call Stack moves up one level in the function call stack Down Call Stack You can use the Down Call St
108. Compile File You must compile your source code before you execute your project Use the Compile File command to compile the selected source files If LabWindows CVI encounters any build errors the Build Errors window appears with a list of errors Refer to the descriptions of Build Options and Compiler Defines in the Options Menu section of this chapter for a discussion of compiler options and defines Mark File for Compilation When LabWindows CVI marks a source file for compilation a C appears next to the filename in the Project window LabWindows CVI recompiles marked files the next time you build the project When you modify a source file LabWindows CVI automatically marks the file for compilation You can force LabWindows CVI to compile a source file on the next build with the Mark File for Compilation command Mark All for Compilation Use the Mark All Files for Compilation command to force LabWindows CVI to recompile all source files in the project the next time you build the project External Compiler Support Use the External Compiler Support command to help you build your executable or DLL in one of the four compatible external compilers For more information on this topic refer to Chapter 3 Compiler Linker Issues of the LabWindows CVI Programmer Reference Manual National Instruments Corporation 3 21 LabWindows CVI User Manual Chapter 3 Project Window When you execute the command the External Compiler Support dia
109. Control command 6 24 Edit Function Panel Window command 6 25 Exclude Function command 6 24 illustration 6 23 Toggle Control Style command 6 24 Toolbar command 6 24 Project window Build Options command 3 59 to 3 62 Colors command 3 73 Command Line command 3 65 Compiler Defines command 3 62 to 3 64 Environment command 3 42 3 65 to 3 66 Font command 3 72 illustration 3 59 Include Paths command 3 64 Instrument Directories command 3 64 Library Options command 3 47 3 67 to 3 69 Project Move Options command 3 72 Run Options command 3 65 Source Code Control Options 3 71 to 3 72 Tools Menu Options command 3 69 to 3 70 www ni com National Instruments Corporation Source and Interactive Execution windows Bracket Styles command 5 37 Colors command 5 37 Create Object File command 5 39 to 5 40 Editor Preferences command 5 36 to 5 37 Font command 5 37 Generate DLL Import Library command 5 39 Generate DLL Import Source command 5 38 to 5 39 Generate Visual Basic Include command 5 39 Help menu 5 42 illustration 5 35 Syntax Coloring option 5 37 to 5 38 Toolbar command 5 37 Translate DOS LW program command 5 38 User Defined Tokens for Coloring command 5 38 User Interface Editor Assign Missing Constants command 4 36 illustration 4 32 Load From Text Format command 4 36 Next Tool command 4 32 Operate Visible Panels command 4 32 Preferences command 4 33 to 4 36 Save in Text Format comma
110. DLL as soon as the program starts The import source code operates in such a way that the DLL does not load until the user makes the first function call into it Generate DLL Import Library This command generates a DLL import library LabWindows CVI enables Generate DLL Import Library only when you have an include file in the Source window The include file must contain declarations of all the functions and global variables you want to access from the DLL When you execute the command a dialog box appears giving you the option to generate an import library for each of the compatible external compilers rather than just for the current compatible compiler Enter the pathname of the DLL in the file dialog box that appears The Generate DLL Import Library command generates a 1ib file with the same base filename as the include file If you choose to create an import library for each compiler LabWindows CVI creates the files in subdirectories named msvc borland watcom and symantec LabWindows CVI creates a copy of the library for the current compatible compiler in the directory of the DLL Generate Visual Basic Include This command generates a Visual Basic include file from the h file of an instrument driver Use this command if you are porting an instrument driver to a DLL for use in Visual Basic Create Object File You can use the Create Object File command to compile the contents of a Source window into an object file Compiled files
111. Debuggable Dynamic Link Library command 3 13 5 24 Create Release Dynamic Link Library command 3 12 5 24 debugging 3 30 to 3 33 location of required files 3 31 to 3 32 running external process 3 32 to 3 33 running program in LabWindows CVI 3 32 generating DLL import library 5 39 generating source code for DLL import library 5 38 to 5 39 Where to Copy DLL option 3 17 documentation conventions used in manual xxi xxii LabWindows CVI documentation set xxii xxiii Down Call Stack command Run menu 5 32 DSTRules option 1 4 E Easy I O for DAQ command Library menu 3 44 Easy I O for DAQ Library definition 3 44 National Instruments Corporation I 9 Index purpose and use 2 3 Edit Breakpoint dialog box 5 31 to 5 32 Edit Character command Edit menu 8 8 Edit command Instrument menu 3 40 to 3 41 See also Edit Instrument dialog box Edit Control dialog box Control Appearance section 4 14 Control Settings section 4 13 to 4 14 Edit Label Value Pairs dialog box 4 14 Label Appearance section 4 14 to 4 15 Quick Edit Window 4 14 Source Code Connection 4 13 Edit Function Panel Window command Options menu 6 25 Tools menu 5 35 Edit Function Tree command Edit Instrument dialog box 3 41 Tools menu 5 34 Edit Instrument Attributes command Tool menu 5 34 Edit Instrument dialog box Attach and Edit Source command 3 41 Detach Program command 3 41 Edit Function Tree command 3 41 illustration 3 40 Reattach
112. Dynamic Link Library command is displayed in the Build menu When you use the Create Debuggable Dynamic Link Library command LabWindows CVI includes debug code in your DLL and generates an extra file that contains a symbol table and source position information necessary for debugging The extra file has the same pathname as the DLL except that its extension is cdb LabWindows CVI User Manual 3 30 WWW ni com Chapter 3 Project Window In the LabWindows CVI development environment you can debug only DLLs you create in LabWindows CVI with the Create Debuggable Dynamic Link Library command Other development environments cannot debug DLLs you create in LabWindows CVI The amount of debugging information included in the DLL and debug file depends on the value of the Debugging Level control in the Build Options dialog box Location of Files Required for Debugging DLLs To debug a DLL in LabWindows CVI the cdb file and the source files for the DLL must be available LabWindows CVI looks for the cab file in the following locations and order The directory from which LabWindows CVI loaded the DLL The directory in which you created the DLL The directory of the current project target if the current project target is the DLL The Windows directory SE ele E Za The Windows system directory If LabWindows CVI cannot find the cdb file in any of these locations a dialog box prompts you to browse for it After you enter the location of the
113. EF UE 1 3 MPAT ES 1 4 Date and Time Option DSTRules A 1 4 Timer Options useDefaultTimer esee 1 4 Font le 1 5 DialogFontName teret t etre ror tete 1 5 DialogFontSize 55 n eee ih AIA EES 1 5 DialogFontBold 5 erede POTE 1 5 Chapter 2 LabWindows CVI Overview Components of LabWindows CVI esses eene eene nennen nennen 2 1 Standard Libraries eoi ee ee ete ree 2 2 User Interface Li Diary ie eee een et 2 3 Easy UO for DAQ Library sss sees sees 2 3 Data Acquisition Library sss sees sese eee 2 3 VISA Te TE 2 3 TV N EI 2 3 Instrument Library ege T TT 2 4 LabWindows CVI Environment 2 4 How to Create Applications with LabWindows CVI seen 2 5 Creatine a User Interface is dices sd otn etie reet lestie eiu ted 2 6 Creating Standalone Programs and DLLs eee 2 6 National Instruments Corporation V LabWindows CVI User Manual Contents Chapter 3 Project Window Project Window OverVIew iie eth ee tte beate b peter oE ha 3 1 Selecting Multiple Files in the Project Window ees 3 3 File Menu ede nei aenea EE CIEN RP ee etd terea 3 4 lc H taney 3 5 Open Semen 3 6 SAVE 3 6 DAVE AS nosset iude dete us EB 3 7 EE 3 7 Auto Save Project ose onere ere EEUU eS 3 7 usn MEM Cm 3 7 Most Recently Closed Files sese 3 7 E
114. Files to Project item to add any type of file to the project list Choose any one of the file types listed in the menu to invoke a dialog box and then select a file from the dialog box Use the Source Object and Library items to add code modules to your project Refer to Chapter 2 Using Loadable Compiled Modules in the LabWindows CVI Programmer Reference Manual for information about using object library and DLL files in LabWindows CVI LabWindows CVI User Manual 3 8 www ni com Chapter 3 Project Window An import library 1ib file must accompany each DLL If you want to use a DLL in your project you must list the import library rather than the DLL You cannot add DLL and DLL path pth files to the project If you load a project that was created in Windows 3 1 and contains dllor pth files LabWindows CVI displays a warning message and excludes the files For more detailed information on using DLLs in LabWindows CVI refer to Chapter 3 Compiler Linker Issues in the LabWindows CVI Programmer Reference Manual Use the Include item to add header files to your project It is a good idea to list header files in your project because this makes access to you header files much easier Use the User Interface item to add uir files to your project You can list uir files in your project to make access to the files easier Use the Instrument command to add instrument drivers to your project Instrument drivers that LabWindows CVI loads
115. I User Manual 5 22 WWW ni com Chapter 5 Source and Interactive Execution Windows Build Menu This section explains how to use the commands in a Source or Interactive Execution window Build menu as shown in Figure 5 12 Use the commands in the Build menu to compile files and to build and link projects File Edit View RIDER Run Instrument Library Tools Window Options Help Compile File Ctrl K Create Release Executable Ctrl M Mark File For Compilation Clear Interactive Declarations Insert Include Statements Add Missing Includes Generate Prototypes Next Build Error F4 Previous Build Error Ctrl F4 Build Errors in Next File Shift F4 Figure 5 12 Build Menu Compile File You must compile your source code before executing it in a Source window or the Interactive Execution window The Compile File command adds the file to the project if necessary checks it for syntax errors and compiles it If the file has any build errors after LabWindows CVI completes compilation a Build Errors dialog box appears When you want to call a function that you define in a Source window from another Source window from the Interactive Execution window or from a function panel you must first execute the Compile File command in the Source window where you define the function If you subsequently modify the function you must recompile the Source window before calling the function again Refer to the Build Options discussi
116. Instrument Library Tools Tip of the Day Web Links E About LabWindows CVI Figure 3 27 Help Menu Contents The Contents command invokes the LabWindows CVI Online Help The online help contains comprehensive information on LabWindows CVI library functions Search for Help On The Search for Help On command allows you to search for keywords used within the LabWindows CVI Online Help Windows SDK The Windows SDK command invokes online help for the Windows API functions Tip of the Day The Tip of the Day command invokes a dialog box containing tips to help you learn about features in the LabWindows CVI environment Web Links The Web Links command has a submenu that contains links to helpful National Instruments web sites About LabWindows CVI The About LabWindows CVI command displays a read only dialog box with information about your LabWindows CVI session LabWindows CVI User Manual 3 74 www ni com User Interface Editor Window A LabWindows CVI Graphical User Interface GUI can consist of panels command buttons pull down menus graphs strip charts knobs meters and many other controls and indicators Figure 4 1 shows a typical GUI created with LabWindows CVI EJ Temperature Monitoring System System Control Current Temperature 30 0 Readings Sec 77 61 20 ipn 800 __ Alarm High a Alarm Low cD gt Alarm Settings Statistics 80 75 m 85 9 Ro 90 80
117. Lower Limit 75 a 85 CR 0 V 70 3 Figure 4 1 Sample LabWindows CVI Graphical User Interface You can create your GUI programmatically using function calls or you can build a GUI in LabWindows CVI interactively using the User Interface Editor a drop and drag editor with tools for designing arranging and customizing user interface objects With the interactive User Interface Editor you can build an extensive GUI for your program without writing a single line of code When you are finished designing your GUI in the User Interface Editor you save the GUI as a User Interface Resource uix file This chapter tells you how to create a GUI interactively It describes the User Interface Editor and procedures for creating and editing panels controls and menu bars National Instruments Corporation 4 1 LabWindows CVI User Manual Chapter 4 User Interface Editor Window When you use the User Interface Editor you create and modify user interface resource uir files Enter the User Interface Editor by selecting New or Open from the File menu and choosing the User Interface uir menu item User Interface Editor Overview A User Interface Editor window appears in Figure 4 2 Ej Untitled1_uir GE x File Edi Create View Arange Code Run Library Tools Window Options Help SIE ale Figure 4 2 User Interface Editor Window From this window you can create and edit GUI panels controls and
118. Manual A dialog box item that allows you to toggle between two possible options A temporary storage area LabWindows CVI uses to hold text that is cut copied or deleted from a work area The LabWindows CVI feature that creates code based on a uir file to connect your GUI to the rest of your program This code can be compiled and run as soon as it is created A control on a Common Control Function Panel that specifies a parameter in all functions associated with a Function Panel window A command line argument passed to the compiler that defines an identifier as a macro to the preprocessor An input and output device that appears on a function panel for specifying function parameters and displaying function results The flashing rectangle that shows where you can enter text on the screen If you have a mouse installed there is also a mouse cursor An element of the LabWindows CVI screen that specifies the row and column position of the cursor in the window The action that takes place when Enter is pressed and no command is specifically selected Default command buttons are indicated in dialog boxes with an outline A prompt mechanism in which you specify additional information needed to complete a command G 2 www ni com E entry mode indicator excluded code F fp file function panel Function Panel Editor window Function Panel window function tree Function Tree Editor window G generat
119. Manual Index Hide command File menu Interactive Execution and Standard Input Output windows note 5 8 Variables and Watch windows 7 6 Hide Windows option Run Options command 3 65 hierarchy buttons Edit Menu Bar dialog box 4 10 HKEY_LOCAL_MACHINE SOFTWARE National Instruments CVI Run Time Engine cvirte 1 2 HKEY_LOCAL_MACHINE SOFTWARE National Instruments CVI version 1 2 Horizontal Centers option Alignment command 4 21 Distribution command 4 22 Horizontal Compress option Distribution command 4 22 Horizontal Gap option Distribution command 4 22 Icon control Target Settings dialog box 3 14 icons associated with variables 7 3 Project window 3 2 to 3 3 Import Library Base Name option Target Settings dialog box 3 17 Import Library Choices button Target Settings dialog box 3 19 include directory table 1 4 Include File command View menu 6 21 Include File in Build command Edit menu 3 9 include files adding missing files 5 25 generating for Visual Basic 5 39 prompting for path 3 62 tracking dependencies 3 62 Include option Add Files to Project command 3 9 LabWindows CVI User Manual 1 16 Include Paths command Options menu 3 64 Input command File menu 8 6 input control parameters specifying 6 5 Insert Construct command Edit menu 5 12 Insert Function Call command Code menu 6 19 Insert Include Statements command Build menu 5 25 Insert New Item field Edit Menu Bar dialog box 4
120. Options Menu National Instruments Corporation 6 23 LabWindows CVI User Manual Chapter 6 Using Function Panels Default Control Default Control resets a control to its default value and configuration Default All Default All resets all the controls on the current Function Panel window to their default values and configurations Toolbar Use the Toolbar command to select which icons appear in the Function Panel window toolbar Refer to the Toolbars in LabWindows CVI section in Chapter 5 Source and Interactive Execution Windows for more details on editing the toolbar Exclude Function The Exclude Function command disables the current function panel so that the function call does not appear in the generated code box and is not in effect when you select Code Run or Insert Toggle Control Style Slide binary and ring controls insert a number into a function call in the generated code box The value of this number depends on the item you select in the control You can override the configured values of these controls by using the Toggle Control Style command Toggle Control Style replaces a slide binary or ring control with an input control You can use this input control to enter a variable name constant or expression This entry appears in the generated code box in the same position as the parameter that the original control produced The variable name or constant that you enter must match the type specified for the contr
121. Panel dialog box contains a Help button Click on the button to get help information about the functions and classes listed in the dialog box Select Help or press F1 to display the Help dialog box for a selected function panel Figure 3 17 shows an Instrument Help dialog box cw Instrument Help Instrument Name Tektronix TDS300 Series DSO VISA 1 0 This instrument module provides programming support for the Tek 4 iTDS310 TDS320 and TDS350 oscilloscopes The module is divided jinto the following functions iFunctions Classes 1 Initialize iThis function initializes the instrument and sets it to a idefault configuration i 2 Configuration Functions Class iThis class of functions configures the instrument by setting jacquisition and system configuration parameters 1 3 Action Status Functions Class iThis class of functions begins or terminates an acquisition also provides functions which allow the user to determine the icurrent status of the instrument 1 4 Data Functions Class Figure 3 17 Instrument Help Dialog Box To close the Help dialog box click on the Done button press the Enter key or press the Esc key Library Menu This section explains how to use the commands in the Project window Library menu as shown in Figure 3 18 Use the Library menu commands to access function panels for the LabWindows CVI libraries Use library function panels to interactively run library functions an
122. Preferences command The maximum capacity of this stack is 1 000 operations The Redo command reverses your last Undo command If you go too far in using the Undo command you can use Redo to reverse your edit actions LabWindows CVI enables the Redo command only when the previous action was the Undo command Any other action even moving the cursor disables the Redo command Cut and Copy To cut or copy text to the Windows Clipboard select the text you want to place on the Clipboard and then select Cut or Copy from the Edit menu LabWindows CVI places the selected text on the Clipboard If you used the Copy command the text remains in the window Use the Cut command to delete text from the window Controls you cut or copy do not accumulate on the Clipboard Every time you cut or copy a control it replaces the previous contents of the Clipboard Paste The Paste command inserts text from the Clipboard e Ifyou Paste in character select mode the characters appear at the cursor on the current line e Ifyou Paste in line select mode the new lines appear above the current line e Ifyou Paste in column select mode the new block of characters appears at the cursor on the current line e If you select text before you execute the Paste command the contents of the Clipboard replace the selected text You can Paste the same information from the Clipboard as many times as you like Text remains on the Clipboard until you use Cut or Copy ag
123. Program command 3 41 Show Info command 3 41 Edit Label Value Pairs dialog box illustration 4 14 purpose and use 4 14 Edit menu Array Display window Edit Value command 8 6 Find command 8 7 Goto command 8 7 illustration 8 6 Project window 3 8 to 3 10 Add Files to Project command 3 8 to 3 9 LabWindows CVI User Manual Index Exclude File from Build command 3 9 illustration 3 8 Include File in Build command 3 9 Move Item Down command 3 10 Move Item Up command 3 9 Remove File command 3 9 Source and Interactive Execution windows Balance command 5 13 Clear Window command 5 4 5 12 Copy command 5 11 Cut command 5 11 Delete command 5 11 Diff command 5 13 to 5 14 disabled commands note 5 10 Find command 5 14 to 5 17 Go To Definition command 5 14 illustration 5 10 Insert Construct command 5 12 Next File command 5 18 Paste command 5 11 Redo command 5 11 Replace command 5 17 to 5 18 Resolve All Excluded Lines command 5 12 Select All command 5 12 Toggle Exclusion command 5 4 5 12 Undo command 5 11 String Display window Edit Character command 8 8 Edit Mode command 8 8 Find command 8 8 Goto command 8 8 Overwrite command 8 8 User Interface Editor Apply Default Font command 4 16 Control command 4 12 to 4 15 Control Style command 4 16 Copy command 4 7 LabWindows CVI User Manual I 10 Copy Panel command 4 7 Cut command 4 7 Cut Panel command 4 7 D
124. R 3 45 IVI Agno ne Eam pen m oW OE 3 45 ECP ES 3 46 IR e 3 46 DDEusBebue urea ee tines eae Golgi dei Ro eS 3 46 ActiveX Automation wore eR ERE EE TRT Tra pa TRT ahar 3 46 Formatting and UO 3 47 L teuer CHE eame EDO 3 47 ANSEG ig REPRE Dina iq E 3 47 Usetlabraries EE 3 47 National Instruments Corporation Vii LabWindows CVI User Manual Contents Dummy fp Files for Support Libraries eese 3 47 Systemi L lbtanteg ugeet ptite Og oie 3 48 Tools 0 iier ecd tite EE OU 3 48 Create ActiveX Automation Controller sss eee 3 48 Choose Server Panel stees eege EE reegt eio 3 48 Configure T d eese eedem 3 49 Advanced Panel 2 UPS 3 49 Create IVI Instrument Driver nennen enne 3 53 Source Code Conttol cette lan ea dea ea Oni Weit RETE 3 53 User Defined Entries in the Tools Men 3 55 ENT E EE 3 55 eat 3 56 Tile WINGO geet sese sectetur d ek GSO ERG RE 3 56 Minimize Al 3 56 CT OS EAT E 3 56 Project EE 3 56 Bled ST TT 3 56 Run Time ST TTT T 3 56 Debug Outputs nice epe dee eei 3 56 Source Code Control Errors sese 3 57 Memory Display c et ei eire de ehe e deg 3 57 Variables 2 52 hte euim sinu iHi 3 57 Watch siae RE ed D EO OR Eeer 3 57 Array Display and String Display eene 3 57 User Interfaceraco sitate ntes tret t dere Uv tet en 3 58 Function Panel z3 usado een Ren 3 58 F nction DTC i oec etre esee p eter e Su e UTC 3 58 Help Editor catene EE EE tdi tette bs 3 58 I
125. RIGHT TO RECOVER DAMAGES CAUSED BY FAULT OR NEGLIGENCE ON THE PART OF NATIONAL INSTRUMENTS SHALL BE LIMITED TO THE AMOUNT THERETOFORE PAID BY THE CUSTOMER NATIONAL INSTRUMENTS WILL NOT BE LIABLE FOR DAMAGES RESULTING FROM LOSS OF DATA PROFITS USE OF PRODUCTS OR INCIDENTAL OR CONSEQUENTIAL DAMAGES EVEN IF ADVISED OF THE POSSIBILITY THEREOF This limitation of the liability of National Instruments will apply regardless of the form of action whether in contract or tort including negligence Any action against National Instruments must be brought within one year after the cause of action accrues National Instruments shall not be liable for any delay in performance due to causes beyond its reasonable control The warranty provided herein does not cover damages defects malfunctions or service failures caused by owner s failure to follow the National Instruments installation operation or maintenance instructions owner s modification of the product owner s abuse misuse or negligent acts and power failure or surges fire flood accident actions of third parties or other events outside reasonable control Copyright Under the copyright laws this publication may not be reproduced or transmitted in any form electronic or mechanical including photocopying recording storing in an information retrieval system or translating in whole or in part without the prior written consent of National Instruments Corporation Trademarks CodeBuilde
126. Run Window Options Help lob staticGloh 00B114A4 0 p2 2 72 abcd 00B114A4 0 2 00511449 abcd abcd 1 0 1 0B114A4 abcd ALI Figure 7 1 Variables Window The Variables window shows all currently defined variables in LabWindows CVI LabWindows CVI updates variables in this window at each breakpoint The vertical bars separate the window into three scrollable fields name value and variable type You can change the width of the fields by dragging the vertical bars with the mouse The window is also divided into two horizontal sections the Global subwindow and the function subwindow The Global subwindow displays the following variables e Project globals that include all global variables not declared as static nteractive Execution window variables declared in the Interactive Execution window e Global variables declared as static The function subwindow displays function parameters and local variables from currently active functions The variable list for each function appears in a different section For any given function the Variables window lists formal parameters first followed by local variables Formal parameters appear in italics LabWindows CVI User Manual 7 2 www ni com Chapter 7 Variables and Watch Windows The following icons appear to the left of certain variables Y The variable on this line is the starting pointer to a block of defined data such as an arra
127. Select mode 5 6 text format Load From Text Format command 4 36 Save In Text Format command 4 36 Threads command Run menu Project window 3 35 Source and Interactive Execution windows 5 32 Tile Windows command Window menu 3 56 time option DSTRules 1 4 timer option useDefaultTimer 1 4 to 1 5 Tip of the Day command Help menu 3 74 tmpdir configuration option 1 4 Toggle Breakpoint command Run menu 5 27 5 30 Toggle Control Style command Options menu 6 24 Toggle Exclusion command Edit menu 5 4 5 12 Toggle Tag command View menu 5 19 tokens Syntax Coloring option Options menu 5 37 to 5 38 User Defined Tokens for Coloring command Options menu 5 38 Toolbar command Options menu Function Panel windows 6 24 Source and Interactive Execution windows 5 37 View menu Function Panel windows 6 21 Source and Interactive Execution windows 5 19 LabWindows CVI User Manual 1 28 toolbars 5 1 to 5 3 adding and positioning buttons and separators 5 2 to 5 3 Customize Source window Toolbar dialog box illustration 5 2 displaying names of button or icons 5 1 function panels 6 4 modifying 5 2 to 5 3 removing items 5 3 Tools menu Project window 3 48 to 3 55 Create ActiveX Automation Controller command 3 48 to 3 53 Create IVI Instrument Driver command 3 53 installing user defined entries 3 55 Source Code Control 3 53 to 3 55 user defined entries 3 55 Source and Interactive Execution windows 5 33 to 5 35 Cr
128. The external compilers each define one of these macros If you port code originally developed under one of these external compilers to LabWindows CVI you might have to manually define one of these macros The default Compiler Defines string contains the following definition DWIN32 MEAN AND LEAN National Instruments Corporation 3 63 LabWindows CVI User Manual Chapter 3 Project Window This definition reduces the time and memory taken when compiling Windows SDK include files For more information refer to Chapter 3 Compiler Linker Issues in the LabWindows CVI Programmer Reference Manual for more information Include Paths The Include Paths command invokes a dialog box in which you can list paths that the compiler uses when searching for header files with simple pathnames The Include Paths dialog box has two lists of paths in which to search for include files LabWindows CVI saves the top list with the project file LabWindows CVI saves the bottom list from one session to another on the same machine regardless of the project Refer toChapter 1 LabWindows CVI Compiler of the LabWindows CVI Programmer Reference Manual for a description of the entire include path search precedence Instrument Directories Use the Instrument Directories command to list directories that LabWindows CVI can search for instrument drivers on which other instrument drivers depend The fp files of the dependent drivers store the names of the
129. User Interface Editor Window Panel The Panel command opens the Edit Panel dialog box as shown in Figure 4 7 cu Edit Panel Untitled Panel None ooo 572 z z z 227 O s z Raised Outlined B we ce rad E r E c2 co p Figure 4 7 Edit Panel Dialog Box e The Source Code Connection section of the Edit Panel dialog box has the following options Constant Name Sets the resource ID for the panel You pass this resource ID to LoadPanel to load the panel into memory The constant name is defined in the h file that LabWindows CVI generates when you save the uir file If you do not assign a constant name the User Interface Editor assigns a constant name when you save the uir file Callback Function Specifies the name of the function to be called when an event is generated on the panel Naming a callback function is optional National Instruments Corporation 4 11 LabWindows CVI User Manual Chapter 4 User Interface Editor Window The Panel Settings section of the Edit Panel dialog box has the following options Panel Title Sets the title of the panel Menu Bar Sets the name of the menu bar Close Control Designates which control on your panel causes the panel to close Top Sets the barrier for the top edge of the panel in pixels Left Sets the barrier for the left edge of the panel in pixels Height Sets the barrier for the height of the
130. View menu 5 18 to 5 22 Window menu 5 35 space character difference from NUL byte note 7 1 8 1 stack size setting 3 60 Stack Trace command Run menu 5 32 standalone executables creating and distributing Create Distribution Kit command 3 24 to 3 30 Create Release Executable command 3 12 5 24 standard libraries See also specific libraries list of libraries 2 2 startup options for LabWindows CVI table 1 1 to 1 2 static library creating 3 12 to 3 13 5 24 status dialog box displaying 3 62 Step Into command Run menu 5 29 Step Over command Run menu 5 29 Stop on first file with errors option 3 62 String Display command View menu 7 14 8 4 WWW ni com String Display window displayed in View menu 3 57 Edit menu 8 7 to 8 8 File menu 8 5 to 8 6 Format menu 8 8 to 8 9 Help menu 8 10 illustration 8 4 multi dimensional strings 8 4 to 8 5 Options menu 8 10 purpose and use 2 5 8 4 Run menu 8 9 Window menu 3 57 8 9 structures child structure 7 3 child structure pointer in chain figure 7 13 Follow Pointer Chain command 7 12 to 7 13 parent pointer to structure 7 3 parent structure pointer in chain figure 7 13 pointer linked structures 7 12 replacing 7 13 Retrace Pointer Chain command 7 13 subwindows in Source and Interactive Execution windows 5 5 symbols options for exporting symbols in DLLs 3 20 specifying in External Compiler Support dialog box 3 23 Syntax Coloring option Opti
131. Windows CVI Instrument Driver Developers Guide for more information on the Instrument Driver Development Wizard Source Code Control The Source Code Control submenu contains menu items that you can use to perform operations with your source code control system LabWindows CVI does not provide a source code control system If you have a source code control system that implements the standard Source Code Control Interface you can attach a LabWindows CVI project to your source National Instruments Corporation 3 53 LabWindows CVI User Manual Chapter 3 Project Window code system using the Source Code Control Options dialog box Use the Source Code Control Options command in the Project window Options menu to bring up the Source Code Control Options dialog box The exact behavior of the commands in the Source Code Control submenu depends on the implementation of the Source Code Control Interface provided by your source code control system The commands are also affected by the settings in the Source Code Control Options dialog box Refer to the Source Code Control Options section later in this chapter for information on the Source Code Control Options dialog box Some of the source code control commands when selected from the Project window bring up a Select Files dialog box This dialog box is not displayed when the source code control commands are selected from source header function tree or user interface editor Source Code Control s
132. a list of functions including NewCtr1 SetCtrlVal GetCtrlVal and so on You can use a regular expression as your search string Refer to Table 5 1 earlier in this chapter for a list of regular expression characters If a function panel exists for the function LabWindows CVI displays the panel If two or more function panel windows exist for the function LabWindows CVI displays a list of the function panels The shortcut key for Find Function Panel is lt Ctrl Shift P gt Find UI Object You use the Find UI Object command to move directly from a Source window to a User Interface Editor window To use it place the cursor on the constant name or callback function name of the user interface panel control or menu object you want to view Then select View Find UI Object LabWindows CVI searches each uir file that is currently open or in the project for user interface objects with a matching constant name or callback function name If LabWindows CVI finds an object the User Interface Editor window that contains the object comes to the foreground If the matching object is a panel the panel title bar briefly flashes and the panel becomes active If the object is a control Find UI Object selects the control If Find UI Object finds a menu object or more than one matching object a dialog box that contains the list of matches appears In this dialog box you can view information about each of the objects or select one to edit LabWindows CV
133. abWindows CVI Environment The LabWindows CVI environment makes it easy for you to create and test applications that use the LabWindows CVI libraries The environment is a combination editor compiler and debugger with extensive run time checking A special feature called a function panel makes the task of developing programs much easier Using a function panel you can execute a LabWindows CVI library function interactively and generate code that calls the function Function panels also contain online help information for the functions and function parameters You can build execute test and debug the source code for your application in the LabWindows CVI environment The LabWindows CVI environment also has a User Interface Editor for creating a graphical user interface for your application programs You can control the user interface using functions in the User Interface Library Also you can use the LabWindows CVI environment to create instrument drivers The LabWindows CVI environment has the following windows each with its own menu bar e Project window This window appears when you start LabWindows CVI You use this window to open edit build run and save application project prj files A project file is a list of files your application uses Chapter 3 Project Window describes the Project window in detail e User Interface Editor windows You use these windows to build graphics mode command bars pull down menus dialog b
134. ability to debug code modules by varying the types of code modules you list in your project Creating a User Interface You can create user interface objects panels controls menus using the User Interface Editor window and save them in a uir file You can load display and modify these objects in your program using the functions in the User Interface Library Also you can specify callback functions that LabWindows CVI calls when events occur on these objects The LabWindows CVI CodeBuilder automatically generates complete C code that compiles and runs based on a user interface uir file you create or edit By choosing certain options presented to you in the Code menu you can produce skeleton code Skeleton code is syntactically and programmatically correct code that can compile and run before you type a single line of code With the CodeBuilder feature you save the time of typing standard code you must include in every program eliminate syntax and typing errors and maintain an organized source code file with a consistent programming style For more information refer to the CodeBuilder Overview section of the LabWindows CVI Online Help Creating Standalone Programs and DLLs With the LabWindows CVI Run time Engine you can create standalone executables dynamic link libraries and static libraries Refer to Chapter 4 Creating and Distributing Standalone Executables and DLLs in the LabWindows CVI Programmer Reference Manual for more
135. ack command only when in a breakpoint state Down Call Stack moves down one level in the function call stack View Variable Value View Variable Value is a convenient way to view the contents of arrays structures and global variables that appear in source code Highlight the variable that you want to see and select View Variable Value Depending on the type of the variable the Variables Array Display or String Display window appears with your selected variable highlighted Add Watch Expression Add Watch Expression is a convenient way to view the value of an expression that appears in source code Highlight the expression that you want to see and select Add Watch Expression The Watch window appears with the expression you selected Threads The Threads command brings up a dialog box listing the threads in the program being debugged Use this dialog box to select the threads whose local variables and call stack you wish to view When you select a thread from this dialog box and click on OK to close the dialog box LabWindows CVI displays the local variables for the selected thread in the variable display and displays the current source position of the thread in a Source window The Up Call Stack Down Call Stack and Call Trace commands in the Source windows Run menu display information on the currently selected thread The Watch display shows the thread specific values of the expressions in the Watch window LabWindows CVI User Manual 5 32
136. actions you want to take place when a menu bar item is selected LabWindows CVI User Manual 4 28 WWW ni com Chapter 4 User Interface Editor Window The All Callbacks command is available when any of the Panel Callback Control Callbacks or Menu Callbacks commands are available The Panel Callback command is available if you specified a callback function for the currently active panel The Control Callbacks command is available if you have specified callback functions for any of the currently selected controls The Menu Callbacks command is available if you have a menu bar that contains items for which you specified a callback When you generate code to accompany a uir file LabWindows CVI places the skeleton code in the target file You must save the uir file before you can generate any code based on that file When you save a uir file LabWindows CVI generates a header n file with the same name This file and userint h are included in the source file If you try to generate the same function more than once the Generate Code dialog box appears Figure 4 22 shows the Generate Code dialog box Each previously generated code fragment appears highlighted Click on the appropriate button in the Generate Code dialog box to replace the existing function insert a new function or skip to the next generated function tw Generate Code This function already exists What do you want to do with the new code Insert Above Old Insert
137. ady appear in the library e Example Programs Database A database with numerous non shipping example programs for National Instruments programming environments You can use them to complement the example programs that are already included with National Instruments products e Software Library A library with updates and patches to application software links to the latest versions of driver software for National Instruments hardware products and utility routines Worldwide Support LabWindows CVI User Manual National Instruments has offices located around the globe Many branch offices maintain a Web site to provide information on local services You can access these Web sites from www ni com worldwide If you have trouble connecting to our Web site please contact your local National Instruments office or the source from which you purchased your National Instruments product s to obtain support For telephone support in the United States dial 512 795 8248 For telephone support outside the United States contact your local branch office Australia 03 9879 5166 Austria 0662 45 79 90 0 Belgium 02 757 00 20 Brazil 011 284 5011 Canada Calgary 403 274 9391 Canada Ontario 905 785 0085 Canada Qu bec 514 694 8521 China 0755 3904939 Denmark 45 76 26 00 Finland 09 725 725 11 France 01 48 14 24 24 Germany 089 741 31 30 Greece 30 1 42 96 427 Hong Kong 2645 3186 India 91805275406 Israel 03 6120092 Italy 02 413091
138. agging over them or lt Shift Click gt on each item you want to include in the group Then you can select an alignment method from the submenu The options on the Alignment command submenu are as follows Left Edges vertically aligns the left edges of the selected controls to the left most control Horizontal Centers vertically aligns the selected controls through their horizontal centers Right Edges vertically aligns the right edges of the selected controls to the right most control Top Edges horizontally aligns the top edges of the selected controls to the upper most control 3 bl Ka P Vertical Centers horizontally aligns the selected controls through their vertical centers pa e H Bottom Edges horizontally aligns the bottom edges of the selected controls to the lower most control Align Horizontal Centers The Align Horizontal Centers command performs the same action as the Alignment command using the option you last selected in the Alignment command submenu Distribution The Distribution command allows you to distribute controls on a panel Select a group of controls by dragging the mouse over them or lt Shift Click gt on each item you want to include in the group Then you can select a distribution method from the submenu The options on the Distribution command submenu are as follows Top Edges sets equal vertical spacing between the top edges of the controls The upper most and lower most controls serve as anc
139. ain or until another application overwrites the Clipboard The New and Open commands do not erase the Clipboard To insert text from the Clipboard move the cursor to the place you want the text inserted and select Paste from the Edit menu Delete The Delete command deletes highlighted text without placing the text on the Clipboard National Instruments Corporation 5 11 LabWindows CVI User Manual Chapter 5 Source and Interactive Execution Windows Select All The Select All command selects all the text in the Source window and positions the keyboard cursor at the end of the file Clear Window Use the Clear Window command in the Interactive Execution window to clear the contents of the window The Clear Window command also clears any variables declared in the Interactive Execution window le Note The Clear Window command is disabled in Source windows Toggle Exclusion You can specify portions of code to exclude during compilation and execution LabWindows CVI ignores excluded code and displays it in a different color than included code The Toggle Exclusion command marks lines in Source windows and the Interactive Execution window as excluded or included code This command acts on single and multiple line selections You can exclude lines automatically when working in the Interactive Execution window Refer to the Interactive Execution Window section earlier in this chapter for more information on automatically excluding li
140. al for PC Compatibles distributed with National Instruments data acquisition boards describes the library functions VISA Library The VISA Library gives VXI and GPIB software developers particularly instrument driver developers a single interface library for controlling VXI GPIB RS 232 and other types of instruments The NI VISA Programmer Reference Manual available upon request describes the functions IVI Library The IVI Intelligent Virtual Instruments Library gives developers a structured framework for creating VXIplug amp play instrument drivers with advanced features such as state caching simulation and compatibility with generic instrument classes The Create IVI Instrument Driver Wizard supplements the library automatically creating the skeleton of an IVI driver for you that includes source code and function panels Refer to the LabWindows CVI Instrument Driver Developers Guide for more information on how to create IVI drivers National Instruments Corporation 2 3 LabWindows CVI User Manual Chapter 2 LabWindows CVI Overview Instrument Library The Instrument Library is a set of instrument drivers that each contain high level C functions for controlling a specific GPIB RS 232 or VXI instrument The high level functions encapsulate the low level steps necessary to control the instrument and read data You can use instrument drivers in the environment in the same way you use the other LabWindows CVI libraries L
141. alog box you can add or delete attributes modify their properties and enter help text for them When you apply the changes the command modifies the source include and function panel files for the instrument driver If you invoke the command when the text cursor is over the defined constant name or callback function name for one of the attributes the dialog box appears with that attribute selected in the list box Refer to the LabWindows CVI Instrument Driver Developers Guide for more information on the Edit Instrument Attributes command Edit Function Tree Use Edit Function Tree command to display the Function Tree Editor window for the function panel fp file associated with the file in the Source window The function panel file must have the same path and base filename as the file in the Source window LabWindows CVI User Manual 5 34 WWW ni com Chapter 5 Source and Interactive Execution Windows Edit Function Panel Use the Edit Function Panel command to display the Function Panel Editor window for a function defined in an instrument driver source file You can use this command only if the file in the Source window has the same path and base filename as an instrument driver function panel p file The text cursor must be over the name of a function for which there is a function panel in the p file Source Code Control The Source Code Control command for the Source and Interactive Execution windows works the same as
142. alog box appears You can enter version information for the executable file in this dialog box LabWindows CVI saves the version information in the executable as a standard Windows version resource You can obtain the information from the executable by using the Windows SDK functions GetFileVersionInfo and GetFileVersionInfoSize In the Version Info dialog box the entries for File Version and Product Version must be in the form Doch Ee E where n is a number from 0 to 255 Using LoadExternalModule The following options assist you in loading external modules Add Files to Executable This button lets you select additional module files you want to link into the Application File These are modules that your project files do not directly reference but that are referenced by modules you load at runtime by calling LoadExternalModule If you select Add Files to Executable to force a Windows SDK import library into your project your executable may not start or load The Windows SDK import libraries included in LabWindows CVI 5 5 contain functions that are not present on all versions of windows Therefore forcing an entire import library into your executable may cause it to fail to load or start because it is referencing a function that is not available in the system DLL on your system Help This button describes the use of LoadExternalModule in an executable and the Add Files to Executable button LabWindows CVI User Manual
143. anual 4 14 www ni com Chapter 4 User Interface Editor Window If you type a double underscore before any letter in the Label field the letter appears underlined in the label The user can select the control by pressing lt Alt gt and the underlined letter provided that no accessible menu bars contain a menu with the same underlined letter Tab Order Each control on a panel has a position in the tab order The tab order determines which control becomes the next active control when the user presses lt Tab gt or lt Shift Tab gt When you create a control it positions itself at the end of the tab order When you copy and paste a control the tab position of the pasted control is immediately before the control you copied Select Edit Tab Order to display the Edit Tabbing Order dialog box as shown in Figure 4 10 cw Edit Tabbing Order ox x Clicktosetto f Untitled Control Untitled Control Untitled Control Al 4 Figure 4 10 Edit Tabbing Order Dialog Box Click on a control with the pointer cursor to change the tab position of a control to the number in the Click To Set To box d Ke You can change the cursor to the eyedropper cursor by holding down the Ctrl key Click on a control with the eyedropper cursor to change the number in the Click To Set To box to the current tab position associated with the control Click on the OK button to accept the new tab order x 8 Click on the close button t
144. ars in LabWindows CVI The LabWindows CVI toolbar appears within function panels in the Function Panel Editor window and in Source windows Using the toolbar gives you quick access to common commands such as File Open and File Save You can configure the toolbar to meet your needs or choose not to display it at all To find out what a toolbar button does position the mouse cursor over that button and either hold the cursor there for a short period of time or right click on the toolbar button to display the name of the toolbar button National Instruments Corporation 5 1 LabWindows CVI User Manual Chapter 5 Source and Interactive Execution Windows Modifying Your Toolbars To modify a toolbar choose Options Toolbar to display the Customize Source Window Toolbar dialog box as shown in Figure 5 1 cw Customize Source Window Toolbar x Available Buttons Add Button Buttons on Toolbar Saai E Print Below Add Separator Above Al Cut Insert Construct Bee el Go To Definition BY Paste Move Up Ml Find UI Object Toggle Exclusion Move Down Recall Panel Balance amp Find Next c Bemwe OW Find EZ Default OK Cancel Figure 5 1 Customize Source Window Toolbar Dialog Box The list box on the left of the Customize Source Window Toolbar dialog box contains names and icons of toolbar buttons that do not currently appear in the toolbar The list box on th
145. ase Executable Create Release Dynamic Link Library or Create Release Static Library depending on the Target Type setting e The Create Release Executable menu item is displayed if the Release item is checked in the Configuration submenu and the Executable item is checked in the Target Type submenu Use this menu item to compile and build an executable without debugging information This command ignores the value of the Debugging level control on the Build Options dialog box You can set the executable s filename as well as other executable settings using the Target Settings dialog box displayed by the Target Settings menu item You can set other compile and run options using the menu items in the Options menu of the Project window e The Create Release Dynamic Link Library menu item is displayed if the Release item is checked in the Configuration submenu and the Dynamic Link Library item is checked in the Target Type submenu Use this menu item to compile and build a DLL without debugging information This command ignores the value of the Debugging level control on the Build Options dialog box You can set the filename of the DLL as well as other DLL settings using the Target Settings dialog box displayed by the Target Settings menu item You can set other compile and run options using the menu items in the Options menu of the Project window This command also generates a DLL import library for the DLL The Create Static Library
146. box Replace is available only when you invoke the dialog box from the Watch window e Add Inserts the variable or expression into the Watch window e Cancel Aborts the operation You can add watch expressions to the Watch window directly from a Source window or a Function Panel window To add a watch expression from a Source window highlight the expression and select Run Add Watch Expression To add a watch expression from a Function Panel window highlight the expression and select Code Add Watch Expression National Instruments Corporation 7 5 LabWindows CVI User Manual Chapter 7 Variables and Watch Windows File Menu This section contains a detailed description of the File menu for the Variables and Watch windows as shown in Figure 7 4 Edit View Format Run Window Options Help New D Open Output Hide COA Save All Exit LabWindows CVI Figure 7 4 File Menu New The New command operates the same way as the New command in the Project window Refer to the File Menu section of Chapter 3 Project Window for more information on the New command Open The Open command operates the same way as the Open command in the Project window Refer to the File Menu section of Chapter 3 Project Window for more information on the Open command Output The Output command writes the contents of the window to an ASCII file on disk When you select Output a dialog box appears prompting you to sp
147. box appears giving you the option to change to the function panel for the typesafe function that you can use with that attribute Notice that when you attempt to operate the Attribute ring control in the function panel as a normal ring control the same dialog box appears in place of the pop up menu that normally appears on a ring control Selecting Constants in a Value Control The Select UIR Constant command has special behavior on the Attribute Value input and output controls in panels for functions such as GetCtrlAttribute SetCtrlAttribute GetPanelAttribute and SetPanelAttribute When you execute the Select Attribute Constant command on an Attribute Value control the behavior depends on the attribute currently selected in the Attribute ring control on the same function panel National Instruments Corporation 6 15 LabWindows CVI User Manual Chapter 6 Using Function Panels If you set the Attribute ring control to an attribute for which there is no small discrete set of values a dialog box appears repeating the help information for the attribute If on the other hand there is a small discrete set of values the Select Attribute Value dialog box appears as shown in Figure 6 8 xOOFFOOO0 a xO000FFO0 xOO0000FF xOO00FFFF M xOOFFOOFF VAL YELLOW xOOFFFFOO Value help Red lt 255 Green 0 Blue 0 Attribute help Constant ATTR FILL COLOR Data Type int Description The RGB color value used to fill a control F
148. ce or Interactive Execution window Run menu as shown in Figure 5 13 Use the commands in the Run menu to run and debug your program File Edit View Build Saty Debug tempsys_dbg exe Shift F5 Continue F5 Go To Cursor Ei Step Over F10 Step Into F8 Einish Function Ctrl F10 Terminate Execution Ctrl F12 Instrument Library Tools Window Options Help Break at First Statement Toggle Breakpoint F3 Breakpoints Shift F9 Stack Trace Shift F10 Up Call Stack Ctrl Shift Up Down Call Stack Ctl Shift Down View Variable Value Shift F7 Add Watch Expression Ctrl F7 Threads Figure 5 13 Run Menu Introduction to Breakpoints and Watch Expressions It is important to understand the concepts of breakpoints and watch expressions before you learn about the commands in the Run menu You can pause the execution of a program without aborting it altogether by marking breakpoints in your code You can use these breakpoints to interrupt program execution for debugging Breakpoints can be either conditional or unconditional Breakpoints apply to specific lines of code but LabWindows CVI maintains them separately from your source file If you modify your source code outside of the LabWindows CVI environment you might invalidate breakpoint position information You can use the Breakpoint function to insert a breakpoint directly in your source file You also can use watch expressions for debugging With watch expressio
149. ception is that some function panel controls use meta data types such as numeric array any array or any type Such controls are equally compatible with a wide range of data types In this case the order of data types does not indicate differing degrees of compatibility Within each data type LabWindows CVI sorts the entries alphabetically by the variable expression text Insert Function Call The Insert Function Call command copies the generated code to the selected window at the current location of the keyboard cursor You can copy code to any open Source window or to the Interactive Execution window You determine the destination window by selecting Code Set Target File If the destination window contains selected text LabWindows CVI displays a dialog box that gives you the option of replacing the selected text or inserting the generated code after the selected text Refer to the discussion of the Recall Function Panel command in the View Menu section of Chapter 5 Source and Interactive Execution Windows for more information National Instruments Corporation 6 19 LabWindows CVI User Manual Chapter 6 Using Function Panels Set Target File Use the Set Target File command to set the destination file for the Insert Function Call command Set Target File brings up a dialog box from which you can select from any open Source window or the Interactive Execution window View Variable Value Use the View Variable Value command to vie
150. checkbox from the dialog box Disabled function calls do not appear in the generated code box therefore you cannot execute or insert them into a Source window National Instruments Corporation 6 3 LabWindows CVI User Manual Chapter 6 Using Function Panels Generated Code Box The generated code box at the bottom of the Function Panel window displays the code the function panels produce when you manipulate the panel controls The generated code box displays up to three lines of code at a time and is scrollable Toolbars in LabWindows CVI The LabWindows CVI toolbar appears within function panels in the Function Panel Editor window and in Source windows It gives you quick access to common commands such as File Open and File Save You can configure the toolbar to meet your needs or choose not to display it Refer to the Toolbars in LabWindows CVI section in Chapter 5 Source and Interactive Execution Windows for a full description of toolbar use and configuration Function Panel Controls Function panel controls specify parameters in a function call Figure 6 2 illustrates the eight types of function panel controls Sample 1 Return Value Control Input Control Numeric Control 0 20 Slide Control Ring Control Binary Control EUS d Value 3 On Value 2 Off Value 3 Output Control Global Control Figure 6 2 Function Panel Controls When you open a function panel input from the keyboard or mouse affects
151. compilers The installation program installs only the files for the compiler the user chooses You might want to use this feature if you distribute modules for use with the LabWindows CVI development environment or external compilers If you distribute a turnkey application this feature is not necessary Ei Note Do not use this feature for distributing DLL import libraries for VXIplug amp play instrument drivers When installing a VXIplug amp play instrument driver you have to install two import libraries one compatible with Visual C C and the other with Borland C C The two import libraries must be installed in the msc and bc subdirectories under the VXIplug amp play 1ib directory LabWindows CVI sets this up automatically for you if you use the Create DLL Project command in the Function Tree Editor window with the VXIplug amp play Style command enabled Replace Existing Files This control lets you configure the way the installation program replaces existing files The Replace Existing Files ring control has the following options Ask If Newer Always Check Version Never The Check Version option applies to files with a Windows version resource in other words DLLs and executables The installation program checks the file on the distribution kit and the existing file for a version resource If each has a version resource the installation program replaces the existing file if the version number of the file in the distribution kit
152. consume less memory and run faster than source files They are especially useful for instrument driver programs because they load faster Compiled files cannot be debugged however and they do not have run time error checking National Instruments Corporation 5 39 LabWindows CVI User Manual Chapter 5 Source and Interactive Execution Windows B Note Ifthe source file is in the project and you do not want to debug it use the Compile Without Debugging option in the Project window rather than the Create Object File command You enable the Compile Without Debugging option by double clicking in the O icon column to the right of the source filename in the Project window The Create Object File command gives you the option of creating an object file for each of the compatible external compilers rather than just for the current compatible compiler If you choose to create an object file for each compiler LabWindows CVI creates the files in subdirectories named msvc borland watcom and symantec LabWindows CVI creates a copy of the object file for the current compatible compiler in the parent directory You can compile your file using a third party compiler LabWindows CVI supports Refer to the LabWindows CVI Programmer Reference Manual for more information on compatible external compilers These compiled files are smaller and execute faster than object files LabWindows CVI creates You can use the Create Object File command if you do not have access
153. ct Operate Visible Panels again to return to edit mode Next Tool The Next Tool command in the Options menu cycles the User Interface Editor through its four modes For more information on the operating editing labeling and coloring tools refer to the User Interface Editor Overview section earlier in this chapter LabWindows CVI User Manual 4 32 www ni com Chapter 4 User Interface Editor Window Preferences Selecting Options Preferences opens the Editor Preferences dialog box as shown in Figure 4 27 c Editor Preferences Figure 4 27 User Interface Preferences Dialog Box e Usethe User Interface Editor Preferences section of the Editor Preferences dialog box to set options that affect the operation of the User Interface Editor Initial Editor Background Color Determines the initial background color of User Interface Editor windows Use Localized Decimal Symbol Replaces the traditional decimal symbol used by LabWindows CVI in numeric graph and table controls with the decimal symbol specified in the Regional Settings Properties configuration of your Windows Control Panel Usethe Preferences for New Panels section of the Editor Preferences dialog box to set initial attribute values for each panel that you create in the User Interface Editor Resolution Adjustment Specifies the degree to which LabWindows CVI scales your panels and their contents when you display them on screens with resolutions di
154. ction lt Esc gt Cursor Movement Up 1 line Up arrow Down 1 line Down arrow Left 1 column Left arrow Right 1 column Right arrow Scroll up 1 line Ctrl Up Scroll down 1 line Ctrl Down Left 1 word lt Ctrl Left gt Right 1 word lt Ctrl Right gt Top of window lt Ctrl PgUp gt Bottom of window lt Ctrl PgDown gt Beginning of line lt Home gt End of line lt End gt Move up page lt PgUp gt Move down page lt PgDown gt Top of file lt Ctrl Home gt Bottom of file lt Ctrl End gt LabWindows CVI User Manual A 2 www ni com Technical Support Resources This appendix describes the comprehensive resources available to you in the Technical Support section of the National Instruments Web site and provides technical support telephone numbers for you to use if you have trouble connecting to our Web site or if you do not have internet access NI Web Support To provide you with immediate answers and solutions 24 hours a day 365 days a year National Instruments maintains extensive online technical support resources They are available to you at no cost are updated daily and can be found in the Technical Support section of our Web site at www ni com support Online Problem Solving and Diagnostic Resources e KnowledgeBase A searchable database containing thousands of
155. ction Panel command 5 20 to 5 21 Tag Scope command 5 20 Toggle Tag command 5 19 Toolbar command 5 19 l 31 Index User Interface Editor Find UIR Objects command 4 18 to 4 19 illustration 4 17 Preview User Interface Header File command 4 20 Show Hide Panels command 4 19 to 4 20 Variables and Watch windows Array Display command 7 14 8 1 Close Variable command 7 3 7 12 Expand Variable command 7 3 7 11 to 7 12 Follow Pointer Chain command 7 3 7 12 to 7 13 Go To Definition command 7 14 Go To Execution Position command 7 14 illustration 7 11 Memory Display command 7 14 Retrace Pointer Chain command 7 3 7 13 String Display command 7 14 8 4 View Variable Value command Code menu 6 7 6 20 7 2 8 4 Run menu 5 32 7 1 8 4 VISA command 3 45 VISA Library 2 3 Visual Basic generating include file for 5 39 VXI command Library menu 3 45 VXIplug amp play instrument driver files 3 36 W Watch command Window menu Project window 3 57 Watch window 7 4 watch variables expressions Add Edit Watch Expression dialog box 7 4 to 7 5 LabWindows CVI User Manual Index applicable only in source code modules note 5 27 purpose and use 5 26 to 5 27 selecting 7 4 to 7 5 suspending program execution conditionally 5 28 Watch window 7 4 to 7 5 activating 7 4 Add Edit Watch Expression dialog box 7 4 to 7 5 Edit menu 7 10 File menu 7 6 to 7 7 Format menu 7 15 Help menu 7 17 illustration 7 4
156. ction in the LabWindows CVI Online Help for more information Timer Options useDefaultTimer If you set the useDefaultTimer option to True LabWindows CVI uses the default Windows timer to implement the LabWindows CVI timing related functions such as Timer and Delay The default Windows timer provides a resolution of 55 ms under Windows 98 95 and 10 ms under Windows 2000 NT If you set useDefaultTimer to False under Windows 98 95 LabWindows CVI uses the Windows multimedia library timer The multimedia library timer provides a resolution of 1 ms LabWindows CVI User Manual 1 4 www ni com Chapter 1 Configuring LabWindows CVI If you set useDefaultTimer to False under Windows 2000 NT LabWindows CVI attempts to use the performance counter timer The performance counter timer provides a resolution of 1 ms If the performance counter timer is not available LabWindows CVI uses the multimedia library timer which provides a resolution of ms The default value for useDefaultTimer is False Font Options Under Windows LabWindows CVI provides configuration options to set the fonts that LabWindows CVI uses in dialog boxes DialogFontName DialogFontName specifies the font LabWindows CVI uses in dialog boxes and the built in pop up panels as in the following example DialogFontName Courier DialogFontSize DialogFontSize specifies the font size LabWindows CVI uses in dialog boxes and the built in pop up panels as in the following
157. ction panel fp files for the library modules Because a user library has the same form as an instrument driver anything you can load from the Instrument menu also can be loaded as a user library provided it is in compiled form Refer to the Instrument Driver Files discussion in the Using Instrument Drivers section earlier in this chapter for more information about loaded p files The main difference between modules loaded as instrument drivers and those loaded as user libraries is that you can unload instrument drivers using the Unload command in the Instrument menu but you cannot unload user libraries Also because user libraries must be in compiled form you cannot edit them while they are loaded as libraries Refer to Chapter 3 Developing an Instrument Driver in the LabWindows CVI Instrument Driver Developers Guide for information about writing an instrument driver LabWindows CVI User Manual 3 68 WWW ni com Chapter 3 Project Window You specify user libraries using the Library Options command in the Options menu LabWindows CVI does not load the libraries or show them in the Library menu until the next time you launch LabWindows CVI Dummy fp Files for Support Libraries If you develop a library module to provide support functions for the modules in your project you can install it as a user library By doing so you ensure that the library is always available in the LabWindows CVI development environment If you do not want to
158. d Finds the specified text only when the characters that surround it are spaces punctuation marks or other characters not considered parts of a word LabWindows CVI treats the characters A through Z a through z 0 through 9 and underscore _ as parts of a word e Wrap Specifies to continue searching from the beginning of the window once the end of the window has been reached e Regular Expression lf you select this option LabWindows CVI treats certain characters in the Find What text box as regular expression characters instead of literal characters Table 5 1 Regular Expression Characters in Chapter 5 Source and Interactive Execution Windows describes the regular expression characters e Name Activate this option to include the variable name field of the Variables Watch window in the search e Value Activate this option to include the value field of the Variables Watch window in the search LabWindows CVI User Manual 7 8 www ni com Chapter 7 Variables and Watch Windows e Type Activate this option to include the variable type field of the Variables Watch window in the search e Button Bar Use this option to enable or disable the built in dialog box for interactive searching as shown in Figure 7 7 Find Prev P T Stop Retum Found next Figure 7 7 Find Button Bar Find Prev and Find Next search for the closest previous or next occurrence of the specified text Stop terminates the search
159. d Options You can set the LabWindows CVI compiler options by selecting Options Build Options in the Project window This command opens a dialog box that allows you to set the following LabWindows CVI compiler options e Compatibility With This option displays the current compiler compatibility mode For more information on external compiler compatibility refer to the Compatibility with External Compilers section in Chapter 3 Compiler Linker Issues of the LabWindows CVI Programmer Reference Manual e Default Calling Convention This option sets the compiler s default calling convention unless the compatible compiler is Watcom For other compilers the default calling convention is normally cdec1 but can be changed to st ca11 For Watcom it is always the stack based calling convention Do not change the default calling convention to stdcal1 if you plan to generate static library or object files for all four compatible external compilers Refer to Chapter 3 Compiler Linker Issues of the LabWindows CVI Programmer Reference Manual for more information National Instruments Corporation 3 59 LabWindows CVI User Manual Chapter 3 3 Ei Project Window Note Because you cannot set the default calling convention to__stdca11 in the Watcom compiler or in LabWindows CVI when in Watcom compatibility mode you must use cdec1 as the default convention when you create object files libraries or DLLs for all four external comp
160. d differs based on whether the Attribute or Value control is active National Instruments Corporation 6 13 LabWindows CVI User Manual Chapter 6 Using Function Panels Selecting Constants in an Attribute Control When you execute the command on an Attribute ring control the Select Attribute Constant dialog box appears as shown in Figure 6 7 tw Select Attribute Constant Control type L Numeric Control Appearance Digital Display Height Digital Display Left Digital Display Top Digital Display Width Fill Housing Color Frame Color Height Left Marker Start Angle Marker End Angle Marker Style Needle Color Show Hide Parts Flatten Attribute help Constant ATTR_FILL_COLOR Data Type int Description The RGB color value used to fill a control For numeric and ring slides knobs dials meters and gauges For slides the side that uses the fill color is specified by ATTR_FILL_OPTION RGB value is a 4 byte integer with the hexadecimal format OxOORRGGBB with the respective red green and Figure 6 7 Select Attribute Constant Dialog Box The Attributes list box displays the attributes you can use with the function The attributes are organized under classes A trailing ellipsis denotes a class To see a list of all the attributes without the classes and in alphabetical order select the Flatten option The name of the attribute is dim if it does not allow the type of access that the func
161. d insert these function calls into any open Source window When you select a library name in the Library menu you can access the library function panels For more information refer to the Accessing Function Panels section in Chapter 6 Using Function Panels National Instruments Corporation 3 43 LabWindows CVI User Manual Chapter 3 Project Window File Edit View Build Run Instrument SMJENA Tools Window Options Help User Interface Advanced Analysis Easy 1 0 For DAG Data Acquisition VXI GPIB GPIB 488 2 R5 232 VISA II BEDS DataSocket DDE Activex Automation Formatting and 1 0 Utility ANSI C Figure 3 18 Library Menu User Interface The User Interface Library is a set of functions for controlling a graphical user interface A graphical user interface is a collection of objects such as menu bars panels controls and graphs You can construct the user interface programmatically or with the User Interface Editor Refer to Chapter 4 User Interface Editor Window for more information on creating and controlling a user interface Analysis The Analysis Library includes functions for one dimensional 1D and two dimensional 2D array manipulation complex operations matrix operations and statistics Refer to the LabWindows CVI Online Help for analysis function descriptions Advanced Analysis The Advanced Analysis Library is an optional package that comes wit
162. d to bring the Interactive Execution window to the front Unlike the Source window you can execute incomplete programs in the Interactive Execution window For example you can execute variable declarations and assignment statements in C without declaring a main function Refer to Chapter 5 Source and Interactive Execution Windows for more information about the Interactive Execution window Open Source Files The Window menu lists open source files at the bottom If the file is in the project only the filename appears If the file is not in the project the full pathname appears Select a source file from this menu to bring its window to the front Refer to Chapter 5 Source and Interactive Execution Windows for more information about the Source window LabWindows CVI User Manual 3 58 WWW ni com Chapter 3 Project Window Options Menu You use commands in the Options menu to set up preferences in the LabWindows CVI environment and execute various utilities This section explains how to use the commands in the Project window Options menu as shown in Figure 3 22 File Edit View Build Aun Instrument Library Tools Window alse Build Options Compiler Defines Include Paths Instrument Directories Run Options Command Line Environment Library Options Tools Menu Options Source Code Control Options Project Move Options Font Colors Figure 3 22 Options Menu Buil
163. dee 4 21 Align Horizontal Centers o nneohemo ie ettet ipte Iter rd 4 21 TTS CID UE OMI 3 inte DR ENDO EE e EIER ten MERE US 4 2 Distribute Vertical Centers sese eee 4 22 Control ZPlane Otder eich hehe Ae EE tei ee a Rees 4 22 Centermbabel E tt cits Ma TT eae 4 23 Control Coordinates esses eene enne ern nnne entren 4 23 Code Menu ditus torn ended eve ie 4 23 set Target File cO Sas eno Auc OR RU ER 4 23 Generated sss debere mtt MAD etm 4 24 ET ie AE E ette T 4 29 Preferences teet resets ae BLS hett 4 30 Ruin Te 4 31 T brary Menl aree ono Une oe epregme 4 31 Tools Menu irt RE en aU 4 31 Wandow Menue dite meten tei mtem tte sm 4 32 Options MENU vest eee tete tea ipee EE 4 32 Operate Visible Panels 2 eoe teg riri eee pire 4 32 Nee Feel docte eti e OE te 4 32 Preferences cett ut estates H rei Eo aS e 4 33 Assign Missing Constant sese eene nennen 4 36 Save In Text Format ss sese sese eee 4 36 Load From Text bormat enne tn nennen 4 36 Help Men oet eret ro Pre EE EE eR ROTER RE 4 37 Chapter 5 Source and Interactive Execution Windows Source WJndOoWS EE 5 1 Toolbars in LabWindows CVI eee 5 1 Moditymg Yout Toolbars eerie eee ee eret edens 5 2 Adding and Positioning Buttons 5 2 Adding and Positioning Separators sss 5 3 Notification of External Modification sss sese eee 5 3 Context Menus ute tec tiec ee eee eee ere eee tete pe averte ee oe PE EN eie 5 3 I
164. destination directory in which to install the selected group Install Program Manager Icons This option lets you choose whether to create a Windows program group that contains icons for files in the selected file group The installation program can install the embedded icons for exe files and the default icons for pif com txt wri bat and hlp files National Instruments Corporation 3 27 LabWindows CVI User Manual Chapter 3 Project Window Distribute Objects Libraries For All Compilers This option helps you distribute object files static libraries and DLL import libraries for all the compatible external compilers When enabled this option affects all the obj and 1ip files listed in the selected file group LabWindows CVI includes four versions of each file in the distribution kit LabWindows CVI expects these versions to be in subdirectories under the specified location of each file The subdirectories must be named msvc borland watcom and symantec For example if you specify the file c myapp distr big 1lib in a file group and the Distribute Objects Libraries For All Compilers option is enabled when LabWindows CVI creates the distribution kit you must have the following files on your disk N c myapp distr msvc big lib c myapp distr borland big lib e c myapp distr watcom big lib e c myapp distr symantec big lib The installation program prompts the user to choose one of the compatible external
165. dit Breakpoint Dialog BOX sssssesseseseesesesssreresreresrenrerrnrerrsseereseeresreee 5 31 Figure 5 16 Tools Men eee geehrte 5 33 Figure 5 17 Options Menu 5 35 Figure 5 18 Editor Preferences eei eetetne teer reiten collo tret 5 36 Figure 6 1 Instrument Driver Function Panel Window sese 6 3 Figure 6 2 Function Panel Controls AAA 6 4 Figure 6 3 Function Panel Window File Men 6 8 Figure 6 4 Code Menit e RE EISE E 6 9 Figure 6 5 Declare Variable Dialog Box 6 10 Figure 6 6 Select UIR Constant Dialog Bon 6 12 Figure 6 7 Select Attribute Constant Dialog Box 6 14 Figure 6 8 Select Attribute Value Dialog Bon 6 16 Figure 6 9 Select Variable or Expression Dialog Box 6 17 Figure 6 10 View Menu 6 20 Figure 6 11 Options Menu enses teet ee tette pre aere coe 6 23 Figure 7 1 Variables Wind 7 2 Figure 7 2 Watch Window TT 7 4 Figure 7 3 Add Edit Watch Expression Dialog Box 7 4 Figure 7 4 File Menu sie Rete eU ERR ee 7 6 Figure 7 5 Edit Menu in the Variables Window eee 7 7 Figure 7 6 Find Dialog Box in the Variables Window esses 7 8 Figure 7 7 Find Button Bareer e greeted teg 7 9 Figure 7 8 Edit Menu in the Watch Wundow sese 7 10 Figure 7 0 View Men senken pea 7 11 Figure 7 10 Closed Array in the Variables Window eee 7 11 Figure 7 11 Expanded Array in the Variables Window
166. dow toolbar Line The Line command moves the cursor to the line that you specify When you select the Line command a dialog box appears in which you enter the number of the line where you want to position the cursor If you specify a line number greater than the total number of lines in the program the cursor moves to the last line of the program Beginning End of Selection The Beginning End of Selection command toggles the window between the beginning and the end of a highlighted block of text This is useful when you want to verify a selected block of text that is larger than the Source window Toggle Tag The Toggle Tag command toggles the tag associated with the active line Use tags to mark lines of code that you want to revisit quickly Next Tag Use the Next Tag command to go to the next tagged line Selecting Next Tag repeatedly takes you to all tagged lines in the windows you specify using the Tag Scope command National Instruments Corporation 5 19 LabWindows CVI User Manual Chapter 5 Source and Interactive Execution Windows Previous Tag Use the Previous Tag command to go to the previous tagged line Selecting Previous Tag repeatedly takes you to all tagged lines in the windows you specify using the Tag Scope command Tag Scope Use the Tag Scope command to set which files you want to search with Next Tag and Previous Tag You can set the scope to the current window all open windows or all files Clear Ta
167. dow command View menu 6 22 Next Panel command View menu 4 20 6 2 Next Scope command Edit menu 7 9 Next Tag command View menu 5 19 LabWindows CVI User Manual Index Next Tool command Options menu 4 32 NI BC macro 3 63 NI 1386 macro 3 63 NI mswin macro 3 63 NI mswin32 macro 3 63 NI SC macro 3 63 NI VC macro 3 63 NI WC macro 3 63 No Sorting command View menu 3 11 non void functions requiring return values for 3 61 NT macro 3 63 NUL byte difference from space character note 7 1 8 1 numeric control parameters specifying 6 5 0 object files creating 5 39 to 5 40 required in project file list 3 1 Object option Add Files to Project command 3 8 one dimensional array displaying in Array Display window figure 8 2 online problem solving and diagnostic resources B 1 Open command File menu Array and String Display windows 8 5 Function Panel windows 6 8 Project window 3 6 Source and Interactive Execution windows 5 8 User Interface Editor 4 4 Variables and Watch windows 7 6 Open Quoted Text command File menu 5 8 Operate Visible Panels command Options menu 4 32 Operating tool 4 2 LabWindows CVI User Manual 1 20 Options menu Array and String Display windows Display Entire Buffer command 8 10 illustration 8 10 Reset Indices command 8 2 to 8 4 8 10 Function Panel windows 6 23 to 6 25 Change Format command 6 24 Default All command 6 24 Default
168. dow if you have not already included it When you execute a function call from a function panel LabWindows CVI automatically excludes all previous lines in the Interactive Execution window An excluded line is dimmed and the LabWindows CVI compiler ignores it Refer to the Toggle Exclusion section later in this chapter for more information about excluded lines When you execute code in the Interactive Execution window LabWindows CVI automatically excludes all declarations This is why you must avoid placing executable statements on the same line as declarations in the Interactive Execution window Auto exclusion also occurs when you type a line of code beneath a line that has just been executed You can manually exclude and include lines with the Edit Toggle Exclusion command Declarations in the Interactive Execution window remain in effect until you select Build Clear Interactive Declarations or Edit Clear Window LabWindows CVI User Manual 5 4 www ni com Chapter 5 Source and Interactive Execution Windows Rules for executing code in the Interactive Execution window are as follows e When executing code from the Interactive Execution window data declarations must precede any program statements Function declarations are also necessary unless you disable the Require Function Prototypes option in the Build Options dialog box by selecting Options Build Options in a Project window e You cannot include function definitions in the Interact
169. e You must specify the name of the p file You can generate a Windows help file from the p file by using the Generate Windows Help command in the Options menu of the Function Tree Editor window This feature is useful if you intend for your DLL to be used from Visual Basic For more information refer to Chapter 3 Compiler Linker Issues of the LabWindows CVI Programmer Reference Manual Using LoadExternalModule The following options assist you in loading external modules Add Files to DLL This button lets you select additional module files which you want to link into the DLL These are modules that your project files do not directly reference but that are referenced by modules you load at runtime by calling LoadExternalModule If you select Add Files to DLL to force a Windows SDK import library into your project your DLL may not start or load The Windows SDK import libraries included in LabWindows CVI 5 5 contain functions that are not present on all versions of windows Therefore forcing an entire import library into your DLL may cause it to fail to load or start because it is referencing a function that is not available in the system DLL on your system Help fThis button describes the use of LoadExternalModule in a DLL and the Add Files to DLL button National Instruments Corporation 3 19 LabWindows CVI User Manual Chapter 3 Project Window Exports The following options assist you in exporting
170. e right contains the names and icons of toolbar buttons that currently appear in the toolbar The Customize Source Window Toolbar dialog box gives you several ways to configure your toolbar Adding and Positioning Buttons Use the Add Button controls to add and position new buttons on the toolbar First select the button you want to add to the toolbar from the list box on the left In the list box on the right select the button you want to place the new button next to The Above button positions the item you are adding above the button that you selected in the list box on the right After you click on OK the new item appears to the left of the other button in the toolbar The Below button positions the item you are adding below the button that you selected in the list box on the right After you click on OK the new item appears to the right of the other button in the toolbar LabWindows CVI User Manual 5 2 www ni com Chapter 5 Source and Interactive Execution Windows Adding and Positioning Separators Use the Add Separator controls to add and position separators on the toolbar Select a button in the list box on the right The Above button adds a separator above the button that you selected in the list box on the right After you click on OK a small gap the separator appears in the toolbar to the left of the selected button The Below button adds a separator below the button that you selected in the list box on the right After you click
171. e File menu for the Array and String Display windows Figure 8 5 shows the File menu Edit Format Run Window Options Help New D Open D Output E Array Display Only Input gt Close Ctrl Save All Exit LabwWindows CVl Figure 8 5 File Menu New The New command operates the same way as the New command in the Project window Refer to the File Menu section of Chapter 3 Project Window for more information Open The Open command operates the same way as the Open command in the Project window Refer to the File Menu section of Chapter 3 Project Window for more information Output The Output command writes the contents of the window to an ASCII or binary data file on disk When you select Output a dialog box appears prompting you to specify the name of the file National Instruments Corporation 8 5 LabWindows CVI User Manual Chapter 8 Array and String Display Windows Input Array Display Window This command is valid only in the Array Display window Use the Input command to select an ASCII or binary data file on disk to replace the currently viewed array in memory Close The Close command closes the window Save All The Save All command saves all open files to disk Most Recently Closed Files For your reference two lists appear in the File menu e A list of the four most recently closed files other than project files e A list of the four most recently closed project files Exi
172. e Import Library Choices This button lets you choose whether to create a DLL import library for each of the compatible external compilers or to create one only for the current compatible compiler Refer to Chapter 3 Compiler Linker Issues of the LabWindows CVI Programmer Reference Manual It also lets you choose to create the import libraries in the VXIplug amp play subdirectories instead of the directory of the DLL If you choose to use the DLL directory and create an import library for each compiler LabWindows CVI creates the files in subdirectories named msvc borland watcom and symantec LabWindows CVI also creates the library for the current compatible compiler in the directory of the DLL If you choose to create an import library only for the current compiler LabWindows CVI creates the file in the directory of the DLL If you choose to use the VXIplug amp play directories and create an import library for each compiler LabWindows CVI creates the files in the subdirectories msc bc wc and sc under the VXIplug amp play lib directory If you choose to create an import library for the current compiler only LabWindows CVI creates the file in the appropriate subdirectory e Type Library This button lets you choose whether to add a type library resource to your DLL Also you can choose to include links in the type library resource to a Windows help file LabWindows CVI generates the type library resource from a function panel p fil
173. e Save In Text Format command A dialog box appears prompting you for the pathname of the file LabWindows CVI User Manual 4 36 WWW ni com Chapter 4 User Interface Editor Window Help Menu The Help menu for the User Interface Editor window works the same way as the Help menu in the Project window Refer to the Help Menu section of Chapter 3 Project Window for information on the Help menu National Instruments Corporation 4 37 LabWindows CVI User Manual Source and Interactive Execution Windows This chapter describes the LabWindows CVI Source and Interactive Execution windows Each of these windows supports specific tasks related to developing and executing programs Source Windows Source windows display the source code for the programs you develop These windows behave like standard text editors You can type text directly into a Source window or load text from an ASCII file into a Source window You can insert code from LabWindows CVI function panels directly into Source windows You can save a program from a Source window as an ASCII file Source windows can contain up to million lines with up to 254 characters in each line A tab is one character for the purpose of line length limitation When you run a program in a Source window the program must be complete and obey the syntax rules of ANSI C Refer to the Build Menu and Run Menu sections later in this chapter for more information on running programs Toolb
174. e a standalone compiler and want to use any of these libraries refer to Chapter 3 Compiler Linker Issues of the LabWindows CVI Programmer Reference Manual If you use the Create Distribution Kit command on a project that you link for instrument driver support only LabWindows CVI automatically includes instrsup dllin the distribution kit and disables the option to distribute the full LabWindows CVI Run time Engine The following Utility Library functions are in instrsup dll Beep DateStr Delay SyncWait Timer n TimeStr RoundRealToNearestInteger TruncateRealNumber InStandaloneExecutable CVIRTEHasBeenDetached instrsup d11 does not support the Standard Input Output window Functions such as FmtOut or ScanIn return errors when you use them with instrsup dll All the functions in instrsup d11 are multithread safe Version Info When you click on this button the Version Info dialog box appears You can enter version information for the DLL in this dialog box LabWindows CVI saves the version information in the DLL as a standard Windows version resource You can obtain the information from the DLL by using the Windows SDK functions GetFileVersionInfo and GetFileVersionInfoSize In the Version Info dialog box File Version and Product Version must be in the form D dig Ike WW where n is a number from 0 to 255 LabWindows CVI User Manual 3 18 www ni com Chapter 3 Project Window
175. e instrument drivers for the LabWindows CVI Instrument Library This manual assumes that you are familiar with the material presented in Getting Started with LabWindows CVI and the LabWindows CVI User Manual The LabWindows CVI Programmer Reference Manual contains information to help you develop programs in LabWindows CVI This manual assumes that you are familiar with DOS Windows fundamentals and with the material presented in Getting Started with LabWindows CVI and the LabWindows CVI User Manual The LabWindows CVI Online Help is a reference help file that contains comprehensive information on LabWindows CVI library functions Related Documentation LabWindows CVI User Manual The NI 488 2 Function Reference Manual for DOS Windows the NI 488 2M Function Reference Manual for Windows and the NI 488 2M Software Reference Manual describe functions you can use to program National Instruments GPIB interfaces These manuals are distributed with National Instruments GPIB interface products The NI DAQ User Manual for PC Compatibles and the NI DAQ Function Reference Manual for PC Compatibles describe functions you can use to program National Instruments data acquisition boards These manuals are distributed with National Instruments data acquisition boards xxii www ni com About This Manual The NI VXI User Manual and the NI VXI Programmer Reference Manual describe functions you can use to program National Instruments VXI controllers Th
176. e that the 1value and rvalue expressions have compatible types If you enable the Enable Signed Unsigned Pointer Mismatch Warning option LabWindows CVI generates compile warnings when the 1value and rvalue expressions are both pointers to integers but one points to a signed integer and the other points to an unsigned integer For example the LabWindows CVI compiler generates a signed type mismatch between pointer to char and pointer to unsigned char warning on the call to MyFunction in the following code example void MyFunction unsigned char x char y my string main MyFunction y National Instruments Corporation 3 61 LabWindows CVI User Manual Chapter 3 Project Window Enable Unreachable Code Warning This option generates a compiler warning for statements that the compiler cannot reach on execution When you enable the Enable Unreachable Code Warning option the LabWindows CVI compiler generates a warning at each line of code that cannot be reached during the execution of your program For example LabWindows CVI reports a warning on the break statement in the following code switch intval case 4 return 0 break e Track Include File Dependencies This option keeps the project up to date by tracking the dependencies between source files and include files Whenever you modify a file LabWindows CVI marks for compilation all source files that include the modified file e Prompt for Include File Paths
177. e where the error occurred LabWindows CVI then displays the error in the Run Time Errors window LabWindows CVI suspends the program so you can inspect the values of variables in the Variables window To terminate a program that suspended because of a run time error select Run Terminate Execution or use the shortcut key lt Ctrl F12 gt while a LabWindows CVI environment window is active Continue Use the Continue command to resume program execution when in a breakpoint state Go To Cursor When the program is in a breakpoint state you can move the keyboard cursor to a line in the program and select Run Go To Cursor Program execution then continues until it reaches that line where it enters another breakpoint state Step Over Use the Step Over command to execute an outlined statement when in a breakpoint state If the program last suspended on a function call statement Step Over executes the entire function and then enters a breakpoint state on the statement following the function call If LabWindows CVI encounters a breakpoint within the function call Step Over pauses at the breakpoint Step Into The Step Into command is similar to the Step Over command except that after the program suspends operation at a function call Step Into enters the function and suspends at the first statement of the function Step Into can enter a function only if you define it in a source file Otherwise Step Into executes the entire function and s
178. eToArray RS 2232 Library Utility Library selected functions only refer to the Utility Library Functions discussion later in this section ANSIC Library Your project also can link to the following libraries Analysis or Advanced Analysis Library GPIB Library VXI Library VISA Library IVI Library Easy I O for DAQ Library Data Acquisition Library If you use a standalone compiler and want to use any of these libraries refer to Chapter 3 Compiler Linker Issues of the LabWindows CVI Programmer Reference Manual If you use the Create Distribution Kit command on a project that you link for instrument driver support only LabWindows CVI automatically includes instrsup dllin the distribution kit and disables the option to distribute the full LabWindows CVI Run time Engine National Instruments Corporation 3 15 LabWindows CVI User Manual Chapter 3 Project Window The following Utility Library functions are in instrsup dll Beep DateStr Delay SyncWait Timer TimeStr RoundRealToNearestInteger TruncateRealNumber InStandaloneExecutable CVIRTEHasBeenDetached instrsup dll does not support the Standard Input Output window Functions such as FmtOut Or ScanIn return errors when you use them with instrsup dll All the functions in instrsup dll are multithread safe Version Info When you click on this button the Version Info di
179. eate ActiveX Automation Controller command 5 33 Create IVI Instrument Driver command 5 34 Edit Function Panel command 5 35 Edit Function Tree command 5 34 Edit Instrument Attributes command 5 34 Source Code Control command 5 34 User Interface Editor 4 31 Tools Menu Options command 3 69 Tools Menu Options dialog box 3 69 to 3 70 Add Edit Tools Menu Item dialog box 3 70 illustration 3 69 Top Edges option Alignment command 4 21 Distribution command 4 21 Track include file dependencies option 3 62 Translate LW DOS program command Options menu 5 38 www ni com Type Library button Target Settings dialog box 3 19 Type option Find command 7 9 U UIR Callbacks Object File option External Compiler Support dialog box 3 22 uir files See user interface resource uir files Undo Checkout command Source Code Control submenu 3 54 Undo command Edit menu 4 6 to 4 7 5 11 Undo Preferences section User Interface Editor Preferences dialog box 4 35 Undoable Actions Per File option Editor Preferences command 5 36 Unload command Instrument menu 3 40 3 47 unloading instrument drivers 3 37 to 3 38 unreachable code warning enabling 3 62 Up Call Stack command Run menu 5 32 Use Only One Function Panel Window option Environment command 3 42 3 66 useDefaultTimer option 1 4 to 1 5 user defined entries Tools menu 3 55 User Defined Tokens for Coloring command Options menu 5 38 User Interface command Librar
180. ecify the name of the file Hide The Hide command visually closes a window while retaining the contents in memory Save All The Save All command saves all open files to disk LabWindows CVI User Manual 7 6 WWW ni com Chapter 7 Variables and Watch Windows Most Recently Closed Files For your reference two lists appear in the File menu e A list of the four most recently closed files other than project files e A list of the four most recently closed project files Exit LabWindows CVI The Exit LabWindows CVI command closes the current LabWindows CVI session If you have modified any open files since the last save or if any windows contain unnamed files LabWindows CVI prompts you to save them to disk Edit Menu for the Variables Window This section contains a detailed description of the Edit menu for the Variables window Figure 7 5 shows the Edit menu for the Variables window File View Format Run Window Options Help Edit Value Enter Find Shift F3 Next Scope Ctrl D own Previous Scope Ctl Up Figure 7 5 Edit Menu in the Variables Window Edit Value You can change the value of a variable with the Edit Value command You can invoke the Edit Value command with the mouse by double clicking on the variable name When the dialog box appears type in the new value The value that you enter in the Edit dialog box depends on the type and display format of the variable as the following
181. ect it The Constant Type ring control allows you to select which category of constant name to show When you click on the OK button LabWindows CVI copies the currently selected constant name into the function panel control LabWindows CVI User Manual 6 12 www ni com Chapter 6 Using Function Panels B Note If you attempt to use Select UIR Constant on the Panel Handle and Menu Bar Handle controls that appear on most User Interface Library function panels an error message appears These controls take the values returned from LoadPane1 and LoadMenuBar so an attempt to select uir constants will fail You can use Select UIR Constant in user defined panels That way the command is available to function panels for user libraries that you build on top of the User Interface Library Select Attribute Constant In certain cases the Select Attribute Constant command replaces the Select UIR Constant command in the Code menu This occurs in panels for functions that set or get attribute values The User Interface Library the VISA Library and IVI instrument drivers have such functions Examples are Get Ct rlAttribute SetCtrlAttribute GetPanelAttribute and SetPanelAttribute in the User Interface Library The panels for these functions each contain an Attribute ring control and a corresponding Value input control When either of these two controls are active the Select Attribute Constant command appears in the Code menu The action of the comman
182. ected call After the panel appears you can check how many lines were matched to the function panel window by looking at the Source window LabWindows CVI highlights the matched lines If you select multiple lines before executing the Recall Function Panel command all function calls in the selected lines must appear in one function panel window and the order in which the window generates the calls must be identical to the order in which they appear in the selected lines Otherwise an error message appears Syntax Requirements for the Recall Function Panel Command You do not have to compile the file you are working in before you invoke the Recall Function Panel command In fact the function call you select does not have to be syntactically valid The only requirement is that you must spell and capitalize the name of the function correctly If you do not spell and capitalize the function name correctly LabWindows CVI displays an error message indicating that the panel could not be found National Instruments Corporation 5 21 LabWindows CVI User Manual Chapter 5 Source and Interactive Execution Windows Find Function Panel When you select the Find Function Panel command a dialog box appears in which you can enter the name of a function You can enter just a substring and Find Function Panel finds all functions that contain that substring anywhere in their names For instance if you enter ctrl and click on OK a dialog box appears with
183. ed code box National Instruments Corporation G 3 Glossary An element of the LabWindows CVI screen that indicates the current text mode as either insert or overwrite Code that is ignored during compilation and execution Excluded lines of code are displayed in a different color than included lines of code A file containing information about the function tree and function panels of an instrument module A screen oriented user interface to the LabWindows CVI libraries in which you can interactively execute library functions and generate code for inclusion in a program The window in which you build a function panel Refer to the LabWindows Instrument Driver Developers Guide for more information The window that contains function panels The hierarchical structure in which the functions in a library or an instrument driver are grouped The function tree simplifies access to a library or instrument driver by presenting functions organized according to the operation they perform as opposed to a single linear listing of all available functions The window in which you build the skeleton of a function panel file Refer to the LabWindows Instrument Driver Developers Guide for more information A text box located at the bottom of the function panel window that displays the function call that corresponds to the current state of the function panel controls LabWindows CVI User Manual Glossary global control H hex hig
184. ed with a panel Before you can choose Code Generate Panel Callback you must activate a panel When you select Code Generate Panel Callback LabWindows CVI produces the include statements and the function skeleton for the active panel and places them in the target file Use the Control Callbacks command to generate code for the callback functions associated with one or more controls Before you can choose Generate Control Callbacks you must select at least one control When you select Code Generate Control Callbacks LabWindows CVI produces the include statements and the function skeleton for each selected control and places them in the target file You also can generate a control callback function skeleton by clicking on the control with the right mouse button and selecting the Generate Control Callback command from the pop up menu Use the Menu Callbacks command to generate code for menus and menu items connected to callback functions Selecting Code Generate Menu Callbacks opens the Select Menu Bar Objects dialog box Select the menu bar objects for which you want to generate callbacks and then click on OK When you select OK LabWindows CVI produces the include statements the function prototypes and the opening and closing brackets for each callback function No switch construct or case statements are produced because the usual default events do not apply to menu callback functions You must add the code to implement the
185. ee also Generate menu overview 4 3 to 4 4 color coding tokens in source and include files 5 37 to 5 38 Coloring tool 4 2 colors setting in Editor Preferences dialog box 4 33 to 4 34 Colors command Options menu Project window 3 73 Source and Interactive Execution windows 5 37 Column Select mode 5 7 Command Line command Options menu 3 65 common control function panel 6 7 comparing source files See Diff command Edit menu National Instruments Corporation l 5 Index Compatibility with option 3 59 to 3 60 compile errors maximum number of 3 60 Compile File command Build menu Project window 3 21 Source and Interactive Execution windows 5 23 compiled files including in project 2 6 compiler defines predefined macros 3 63 syntax 3 62 Compiler Defines command Options menu 3 62 to 3 64 compiler options Compatibility with 3 59 Debugging Level 3 60 Default Calling Convention 3 59 to 3 60 Display status dialog during build 3 62 Enable signed unsigned pointer mismatch warning 3 61 Enable unreachable code warning 3 62 Maximum number of compile errors 3 60 Prompt for include file paths 3 62 Require Function Prototypes 5 5 Require function prototypes 3 60 to 3 61 Require return values for non void functions 3 61 Show Build Error window for warnings 3 62 Stop on first file with errors 3 62 compiler support external See External Compiler Support dialog box compiling files See Build menu conditi
186. elete command 4 7 illustration 4 6 Menu Bars command 4 8 to 4 10 Panel command 4 11 to 4 12 Paste command 4 7 Redo command 4 6 to 4 7 Set Default Font command 4 16 Tab Order command 4 15 Undo command 4 6 to 4 7 when commands are enabled note 4 6 Variables window Edit Value command 7 7 Find command 7 8 to 7 9 illustration 7 7 Next Scope command 7 9 Previous Scope command 7 9 Watch window Add Watch Expression command 7 10 Delete Watch Expression command 7 10 Edit Value command 7 10 Edit Watch Expression command 7 10 Find command 7 10 illustration 7 10 Edit Menu Bar dialog box available options 4 9 to 4 10 illustration 4 9 Edit Mode command Edit menu 8 8 Edit Panel dialog box Attributes for Child Panels section 4 12 Panel Attributes section 4 12 Quick Edit Window section 4 12 Source Code Connection section 4 11 Edit Tabbing Order dialog box 4 15 www ni com Edit Value command Edit menu Array Display window 8 6 Variables window 7 7 Watch window 7 10 Edit Watch Expression command Edit menu 7 10 Editing tool 4 2 Editor Preferences command Options menu 5 36 to 5 37 Enable signed unsigned pointer mismatch warning option 3 61 Enable unreachable code warning option 3 62 End of Selection command View menu 5 19 Environment command Options menu 3 42 3 65 to 3 66 environment keys for LabWindows CVI development environment 1 2 environment options Check Foreground Lockout Setting on S
187. embedded blanks you must surround it with double quotation marks LabWindows CVI User Manual 3 62 www ni com Chapter 3 Project Window The Compiler Defines dialog box contains a list of the macros that LabWindows CVI predefines This list includes the name and value of each predefined macro LabWindows CVI predefines the following macros to help you write platform dependent code e CVT 19 defined to be 1 in LabWindows CVI version 3 0 301 in version 3 0 1 and 310 in version 3 1 and so on s _NI_mswin_ NI mswin32 NI 1386 N CVI DEBUG is defined if the Debug item is checked in the Configuration submenu of the Project window Build menu The value of the macro is 1 e _CVI_EXE_ is defined if the project Target Type is Executable s CVI DLL is defined if Target Type is Dynamic Link Library e CVI LIB isdefined if Target Type is Static Library DEFALIGN is defined to the default structure alignment 8 for Microsoft and Symantec 1 for Borland and Watcom e _NI_vc_is defined to 220 if in Microsoft Visual C C compatibility mode e _NI_Sc_is defined to 720 if in Symantec C C compatibility mode e NI BC is defined to 451 if in Borland C C mode e NT WC is defined to 1050 if in Watcom C C mode e WINDOWS e WIN32 e _WIN32 e WIN32 NT e M IX86is defined to 400 e FLAT isdefined to 1 3 Note LabWindows CVI does not define MSC VER BORLANDC WATCOMC and SC
188. enabled when you place an object on the Clipboard using the Cut or Copy command If you select an edit command while it is disabled nothing happens Undo and Redo The Undo command reverses your last edit action and the screen returns to its previous state Edit actions are stored on a stack so that you can undo a series of your edit actions The stack can store up to 100 edit actions You set the size of the undo stack by selecting Options Preferences The Redo command reverses your last Undo command restoring the screen to its previous state Redo is helpful when you use the Undo command to reverse a series of your edit actions and accidentally go too far The Redo command is enabled only when your previous action was the Undo command Any action disables the Redo command LabWindows CVI User Manual 4 6 WWW ni com Chapter 4 User Interface Editor Window Actions that you can undo and redo appear dynamically in the menu For example when you move a control the menu presents the option Undo Move Control Cut and Copy Paste To cut or copy controls to the Windows Clipboard select the control you want to place on the Clipboard and then select Cut or Copy from the Edit menu LabWindows CVI places the selected control on the Clipboard If you used the Copy command the control remains in the window Use the Cut command to delete controls from the window Controls you cut or copy do not accumulate on the Clipboard Every time you cut or c
189. enu of a Project Source or Variables window You can set the DLL s filename as well as other DLL settings using the Target Settings dialog box displayed by the Target Settings menu item You can set other compile and run options using the menu items in the Options menu of the Project window The Debug command also generates a DLL import library for the DLL For information on debugging DLLs refer to the Debugging DLLs section later in this chapter National Instruments Corporation 3 13 LabWindows CVI User Manual Chapter 3 Project Window Target Type The Target Type item opens a submenu in which you select the target type for your project The target type determines what type of file you create when you execute the Create command that appears below Configuration in the Build menu The name of the Create command that appears below Configuration in the Build menu changes depending on the target type and configuration you select The target types that you can select are e Executable e Dynamic Link Library e Static Library When you select anything other than Executable the Debug command in the Run menu dims If you select Dynamic Link Library you can use the Select External Process command in the Run menu to specify an external program that uses the DLL When you do this the Run command changes to Run xxx exe where xxx exe is the name of the program you specify Target Settings The Target Settings item brings up the Target
190. eporting eee esse ee ee ee ee eee 3 33 egene eet ee ee ee E EE EEE ge E EEE 3 34 Terminate ST RL 3 34 Break at First Statement eerte terere eerie Fr eei 3 34 Breakpoints eoo RP EIS UN EEUU 3 34 Select External Process reg rr PERIERE ree 3 34 DLA T rS 3 35 Thr ds gnome t E E T 3 35 Using Instr ment Drivers ws iet tette eR Rie PO Gert HERE E ET EC 3 35 Instrument Driver Files iecit tert REA 3 35 VXIplug amp play Instrument Driver Files eese 3 36 Loading Unloading Instrument Drivers eee 3 37 Precedence Rules for Loading the Instrument Driver Program File sese 3 37 Loading an Instrument without an Instrument Program 3 38 Modules that Contain Non Instrument Functions eee 3 38 Modifying an Instrument Driver 3 38 Instrument Men eot pr REPREHEN sumac EORUM e EE r 3 39 JL EUR 3 39 File Format Copnveraion essere enne enne 3 40 Unloadi RR ENGEL A EA 3 40 Edit genge gege Ee Ee Pe E Ei 3 40 Accessing Function Panels from the Instrument Menu 3 42 Library Menu hee tte HE HEREDES RR Erogo 3 43 User Interface EE 3 44 Analysis pe ee au eo Pe eO Une Betas 3 44 Advanced Analysis rait ee iie tries eels Een rea 3 44 Easy W O for DAQ nre ee Seed eege ee 3 44 Data Acquisition ipe P ROUTE OE e Ets 3 45 MAI inten ere ee RI eate dae er 3 45 GPIB GPIB 4882 tee he et eie dec IR 3 45 R5 232 4 iot teme pum ep Ree Od Ee DER 3 45 NIS A scout eit Sue UR ERE U
191. ept that you can replace one search string with another string Enter the text you want to find in the Find What text box and enter into the Replace With text box the new text you want to appear As LabWindows CVI performs the search a button bar appears as shown in Figure 5 10 Find Next F3 Replace All Stop Esc Return Found next Figure 5 10 Replace Button Bar You can bypass the Replace dialog box using the keyboard commands Refer to Appendix A Source Window Keyboard Commands Find Next skips to the next occurrence of the search string without making a change Replace executes the replacement Replace All finds and replaces all occurrences of the specified text without asking for confirmation National Instruments Corporation 5 17 LabWindows CVI User Manual Chapter 5 Source and Interactive Execution Windows Stop terminates the search leaving the keyboard cursor at the current position Return terminates the search leaving the keyboard cursor at the position where you initiated the search You can bypass the Replace button bar using the keyboard commands in Appendix A Source Window Keyboard Commands Next File If you have selected the Multiple Files option from either the Find or Replace button bars you can move to the next file in the search list using this command View Menu This section explains how to use the commands in a Source and Interactive Execution window View menu as shown in F
192. er options Refer to the Edit Menu for the Variables Window section in Chapter 7 Variables and Watch Windows for information on how to use options in the Find dialog box The Goto command operates the same way as it does in the Array Display window Refer to Edit Menu for the Array Display Window section earlier in this chapter for more information Format Menu This section contains a detailed description of the Format menu for the Array and String Display windows Figure 8 9 shows the Format menu File Edit Bun Window Options Help Decimal Hexadecimal Octal Binary v ASCII Figure 8 9 Format Menu LabWindows CVI User Manual 8 8 WWW ni com Chapter 8 Array and String Display Windows However if a real array appears in the Array Display window the Format menu appears as shown in Figure 8 10 File Edit Bun Window Options Help v Floating Point Scientific Fix Precision Figure 8 10 Format Menu for a Real Array in the Array Display Window Use the commands in the Format menu to choose the format the Array or String Display window uses to display numbers You can display integers in decimal hexadecimal octal binary or ASCII format You can display real arrays in either floating point or scientific notation Run Menu The Run menu contains the following subset of the commands that appear in the Run menu of the Source window Refer to the Run Menu section of Chapter 5 Source and Int
193. er protection information You can use this command to estimate the number of elements for a variable Once you have estimated the number of elements for the variable you can view the elements in the Variables window Refer to the Limitations of User Protection section in Chapter 1 LabWindows CVI Compiler of the LabWindows CVI Programmer Reference Manual for more information about variable types that do not have user protection Add Watch Expression Variables Window This command is valid only in the Variables window Add Watch Expression invokes the Add Edit Watch Expression dialog box from the Variables window The Watch Window section earlier in this chapter explains this dialog box Help Menu The Help menu for the Variables and Watch windows works the same way as the Help menu in the Project window Refer to the Help Menu section of Chapter 3 Project Window for information on the Help menu National Instruments Corporation 7 17 LabWindows CVI User Manual Array and String Display Windows This chapter describes the Array and String Display windows Use these windows to inspect and modify the contents of a single array or string during a breakpoint Ei Note When strings appear in ASCII format there is no visual distinction between a space ASCII 32 and a NUL byte ASCII 0 You can see the difference by displaying the string in decimal format In the String Display you can see beyond the NUL byte by selecting Options
194. eractive Execution Windows for more information s Run Project Continue e Step Over e Step Into Finish Function Terminate Execution Break at First Statement e Breakpoints Window Menu The Window menu in the Array and String Display windows operates the same way as it does in the Project window Refer to the Window Menu section in Chapter 3 Project Window for command descriptions National Instruments Corporation 8 9 LabWindows CVI User Manual Chapter 8 Array and String Display Windows Options Menu This section contains a detailed description of the Options menu for the Array and String Display windows Figure 8 11 shows the Options menu File Edit Format Run Window IER Help Reset Indices String Display Only Display Entire Buffer Figure 8 11 Options Menu Reset Indices Use Reset Indices in the Array Display window to set which array dimension appears as rows and which array dimension is displayed as columns Use Reset Indices in the String Display window to set which string array dimension appears as rows Display Entire Buffer String Display Window This command is valid only in the String Display window By default the String Display window displays only the characters preceding the first ASCII NUL To see characters beyond the NUL select Options Display Entire Buffer Help Menu The Help menu for the Array and String Display windows works the
195. errupts Windows 98 95 EnableInterrupts Windows 98 95 DisableTaskSwitching Windows 98 95 The LabWindows CVI development environment and the LabWindows CVI Run time Engine each load the low level support driver automatically at startup if it is present on disk Under Windows 98 95 the name of the driver is cvi95vxd vxd and the distribution kit installs it in the Windows system directory Under Windows 2000 NT the name of the driver is cvintdrv sys and the distribution kit installs it in the Windows system32 drivers directory The distribution kit makes a Registry entry for the driver under Windows 2000 NT Refer to Chapter 4 Creating and Distributing Standalone Executables and DLLs of the LabWindows CVI Programmer Reference Manual for the details of the Registry entry e The File Groups section of the Create Distribution Kit dialog box has the following options File Groups This list box lets you separate the files in your distribution kit into groups You must assign a destination directory to each group The installation program creates the directories on the target machine and places each of the file groups in its assigned directory You can set each of the options to the right of the list box to different values for each file group Group Destination This ring control sets the root destination directory for the selected group Relative Path This control lets you assign a relative path based on the root
196. ete online help Refer to Chapter 6 Using Function Panels for more details The Project window contains all the component files of your application The simplest case is one source file as shown in Figure 2 1 Ell d samples apps tempsys sample prj OF x File Edit View Build Run Instrument Library Tools Window Options Help Name 5 E O Date Sampler C 09 31 1999 2 Figure 2 1 Simple Project Window National Instruments Corporation 2 5 LabWindows CVI User Manual Chapter 2 LabWindows CVI Overview A typical project however contains multiple code modules and a User Interface Resource file You can list code modules as source files or compiled files You can debug source files and LabWindows CVI performs run time error checking when you execute code in source files To include compiled files such as library or object files in your project you must compile them with LabWindows CVI or a compatible external compiler Refer to Chapter 3 Compiler Linker Issues in the LabWindows CVI Programmer Reference Manual for more information on compatible external compilers Compiled files consume less memory and run faster than source files However you cannot debug them and they do not have run time error checking You can mark a source file in the project list to be compiled without debugging to use less memory You can strike a balance between initial project start up time execution speed memory consumption and the
197. f the control To determine the data type of the control press F1 or right click on the control to view the Help window After executing the function the return value control displays the value for the variable beneath the variable name Specifying an Input Control Parameter An input control accepts a value you type in from the keyboard An input control can have a default value associated with it This value appears in the control when the panel first appears To specify a parameter for an input control select the control and type in a variable name numeric value or valid expression Before executing a Function panel window any names you type into input controls must be defined statically in the Interactive Execution window or defined elsewhere and declared as extern in the Interactive Execution window You can select Code Declare Variable to define variables in the Interactive Execution window for use in the function panels You can select Code Select Variable to select a variable or expression that you have used before The type of value you enter whether it is a constant expression simple variable or array must agree with the data type of the control To determine the data type of the control press F1 or right click on the control to view the Help window Specifying a Numeric Control Parameter A numeric control behaves like an input control except that it accepts numeric values only If you want to type a variable name
198. fferent than the one on which you create them This option also appears in the Other Attributes dialog box that you can activate from the Edit Panel dialog box by selecting Edit Panel in the User Interface Editor window National Instruments Corporation 4 33 LabWindows CVI User Manual Chapter 4 User Interface Editor Window To programmatically override this setting you can call the Set SystemAttribute with the ATTR_RESOLUTION_ADJUSTEMENT attribute before calling LoadPanel or LoadPanelEx Conform to System Colors Forces panels and the controls they contain to use the system colors This option also appears in the Other Attributes dialog box that you can activate from the Edit Panel dialog box by selecting Edit Panel To programmatically set this option you can call SetPanelAttribute with the ATTR CONFORM TO SYSTI change any panel or control colors EM attribute When this option is enabled you cannot Use System Colors as Defaults for Panels and Controls LabWindows CVI uses the system colors as the initial colors for panels and controls you create when this box is checked You can subsequently change the colors without restriction KL Note You must disable two options Conform to System Colors and Use System Colors as Defaults for Panels and Controls in order to set the following options background color frame color and title bar color The frame color and title bar color options have effect
199. field Edit Control dialog box 4 13 Edit Menu Bar dialog box 4 10 Edit Panel dialog box 4 11 callback functions associated with close controls note 4 25 LabWindows CVI User Manual Index generating code for All Callbacks command 4 28 Control Callbacks command 4 28 Main Function command 4 26 to 4 27 Menu Callbacks command 4 28 to 4 29 Panel Callbacks command 4 28 to 4 29 calling convention default 3 59 to 3 60 Cascade Windows command Window menu 3 56 Case Sensitive option Find command Source and Interactive Execution windows 5 15 Variables window 7 8 Case Sensitive option Find UIR Objects dialog box 4 18 Center Label command Arrange menu 4 23 Change Format command Options menu 6 24 Character Select mode 5 6 Check Foreground Lockout Settings on Startup Environment dialog box 3 66 Check In command Source Code Control submenu 3 54 Check Out command Source Code Control submenu 3 54 Checked field Edit Menu Bar dialog box 4 10 Child Panels Attributes section Edit Panel dialog box 4 12 child structure 7 3 child structure pointer in chain figure 7 13 Choose Server panel ActiveX Automation Controller Wizard 3 48 to 3 49 ActiveX Automation Server 3 48 Browse 3 48 to 3 49 Clear Interactive Declarations command Build menu 5 4 5 24 Code menu 6 11 LabWindows CVI User Manual l 4 Clear Source Code Control Error Window command Source Code Control submenu 3 55 Clear Tags command View me
200. fp files of the drivers on which they depend When loading an instrument p file that references other instrument fp files LabWindows CVI tries to find the referenced instrument fp files and load them It searches for each fp file in the following directories and in the following order 1 The directory of the referencing fp file 2 The directories listed in the Instrument Directories dialog box 3 The subdirectories under the cvi toolslib directory 4 The cvi instr directory LabWindows CVI saves the Instrument Directories list from one session to another To find out more about referencing one instrument from another refer to Chapter 5 Function Tree Editor in the LabWindows CVI Instrument Driver Developers Guide for more information You also use the Instrument Directories list when you load a project file that you have moved since you last saved it Ifa fp file listed in the project cannot be found using either its original pathname in the project or its location relative to the project LabWindows CVI searches the Instrument Directories list for a p file with the same base name LabWindows CVI User Manual 3 64 www ni com Chapter 3 Project Window Run Options The Run Options command invokes a dialog box you use to set the following options Save Changes Before Running You can configure LabWindows CVI to never save modified files to always save modified files or to ask whether to save modified files before ru
201. g occurrence of a orb character or expression abor ut matches every occurrence of abort or about if else matches every occurrence of if or else National Instruments Corporation 5 15 LabWindows CVI User Manual Chapter 5 Source and Interactive Execution Windows Table 5 1 Regular Expression Characters Continued Purpose Character Description Example Matching the E Match the beginning of int matches any line beginning or caret a line that begins with int ending of a line Match the end ofaline end matches any line dollar sign that ends with end Grouping Group characters or if else matches expressions curly expressions for searches every occurrence of if braces or else Matching a set W Match any one a z matches every brackets character orrangelisted occurrence of lowercase within the brackets letters abc matches every occurrence of a b or c If appears immediately a z matches tilde after the left bracket everything except negate the contents of lowercase letters the set a z A Z matches all letters and the character Special characters Nt Match any tab character t3 matches every backslash t occurrence of a tab character followed by a3 Nx Match any character x2a matches every backslash x specified in hex occurrence of the character Include the subsequent matches every backslash regular
202. g 3 52 LabWindows CVI User Manual l 2 Objects in ActiveX Automation Server 3 51 to 3 52 Properties of Object 3 53 Property Description 3 53 Property Names Too Long 3 52 Property Tag 3 53 Balance command Edit menu 5 13 Beginning End of Selection command View menu 5 19 bin directory table 1 4 binary control parameters specifying 6 6 Bottom Edges option Alignment command 4 21 Distribution command 4 22 Bracket Styles command Options menu 5 37 brackets finding pairs of 5 13 setting location for 5 37 Break at First Statement command Run menu Project window 3 34 Source and Interactive Execution windows 5 27 5 30 Break On First Chance Exceptions option Run Options command 3 65 Break on Library Errors option Run Options command 3 65 Breakpoint function 5 26 breakpoints See also watch variables expressions applicable only in source code modules note 5 27 breakpoint state 5 27 conditional 5 27 to 5 28 Edit Breakpoint dialog box 5 31 to 5 32 purpose and use 5 26 to 5 27 resuming execution 5 27 setting and clearing 5 27 www ni com Breakpoints command Run menu description 3 34 opening Breakpoints dialog box 5 30 setting breakpoints 5 27 Breakpoints dialog box 5 30 to 5 32 Add Edit Item button 5 31 buttons 5 32 Edit Breakpoint dialog box 5 31 illustration 5 30 Bring Panel to Front command View menu 4 20 build errors Build Errors command Window menu 3 56 Build Errors in Next
203. generated instrument driver Target fp File This option is the pathname of the p file into which LabWindows CVI generates the instrument function panels The wizard will create source c and header h files with the same directory and base filename as the p file You can select either a new file or an existing file If you select an existing file the wizard overwrites the contents of the fp source c and header h files e Call Mechanism Use this control to select whether the Generate Instrument Driver calls the ActiveX Automation Server through IDispatch Invoke calls or through a dual interface If the server does not provide a dual interface then this control is dimmed If the server provides a dual interface it is more efficient to make calls through the dual interface If you choose dual interface the wizard generates wrapper functions to get and set each property exposed by the server and the Generate Per Object Property Access Functions control is dimmed Generate Per Object Property Access Functions Enable this option to make the wizard generate get and set property functions for each object in the server If you do not enable this option the wizard generates single Get Property and SetProperty functions through which you get and set properties for all objects in the server Advanced Panel Click on the Advanced Options button to view the Automation Controller Advanced Options Dialog box Use this dialog
204. gram group name 1 Ifthe project target is an executable and you have entered an application title in the Create Standalone Executable dialog box LabWindows CVI uses the application title 2 Otherwise if you have created the target executable DLL or static library LabWindows CVI uses the base filename of the target 3 Otherwise LabWindows CVI uses the base name of the project file Installation Name The installation window title and the text displayed in the upper part of the installation window If you select the Use Default option LabWindows CVI sets the name using the same priority as for the Program Group Name e Default Resets all controls in the Create Distribution Kit dialog box to their default values When you create a new distribution kit you can click on Default to undo changes you have made to the controls in the dialog box 3 Note When you use the Create Distribution Kit dialog box to modify an existing distribution kit Default replaces your existing file groupings and settings with default values If you click on Default in error click on Cancel to prevent this change to your distribution kit Build This button lets you build your distribution kit e Cancel This button lets you cancel the Create Distribution Kit operation Debugging DLLs If you set the Target Type item in the Build menu to Dynamic Link Library and the Configuration item in the Build menu to Debug the Create Debuggable
205. gs Use the Clear Tags command to selectively remove existing tags Function Panel History The Function Panel History command displays a scrollable list of the function panels you have used during the current LabWindows CVI session Function Panel Tree The Function Panel Tree command displays the Select Function Panel dialog box for the most recently used function panel Recall Function Panel When you are editing a function call in a Source window or the Interactive Execution window you might want to display the function panel corresponding to the call You can do this with the Recall Function Panel command The Recall Function Panel command not only finds and displays the panel but also sets the panel controls so that they contain the parameter values that appear in the function call After modifying one or more controls you can replace the original call with the modified call Invoking the Recall Function Panel Command Before you invoke the Recall Function Panel command you must indicate the function panel you want to recall The simplest method is to place the cursor on a line that contains a function call or a portion of a function call Also you can select or highlight a range of lines that contain one or more function calls You can select part of a line provided that the part contains a function call If a line contains multiple function calls or one function call embedded within another you can resolve the ambiguity by
206. h of these commands Library Menu The Library menu for the User Interface Editor window works the same way as the Library menu in the Project window Refer to the Library Menu section of Chapter 3 Project Window for information on the Library menu Tools Menu The Tools menu for the User Interface Editor window works the same way as the Tools menu in the Project window Refer to the Tools Menu section of Chapter 3 Project Window for information on the Tools menu National Instruments Corporation 4 31 LabWindows CVI User Manual Chapter 4 User Interface Editor Window Window Menu The Window menu in User Interface Editor window works the same way as the Window menu in the Project window Refer to the Window Menu section of Chapter 3 Project Window for information on the Window menu Options Menu This section explains how to use the commands in the User Interface Editor window Options menu as shown in Figure 4 26 File Edit Create View Arange Code Run Library Tools Window Betz Operate Visible Panels F4 Next Tool Shift F4 Preferences Assign Missing Constants Save In Text Format Load From Text Format Figure 4 26 Options Menu Operate Visible Panels Operate Visible Panels allows you to operate the visible panels as you would in an application program This command has the same effect as clicking on the operating tool shown at left When you finish operating the panel sele
207. h the full development system or can be ordered separately from National Instruments It includes additional functions for signal generation signal processing and curve fitting Easy 1 0 for DAQ The Easy I O for DAQ Library contains functions that make writing simple DAQ programs easier than if you use the Data Acquisition Library Refer to the function panel help for the Easy I O for DAQ Library for more information LabWindows CVI User Manual 3 44 www ni com Chapter 3 Project Window Data Acquisition VXI Use the Data Acquisition Library to control your National Instruments data acquisition boards Refer to the NI DAQ User Manual for PC Compatibles and the NI DAQ Function Reference Manual for PC Compatibles included with your data acquisition hardware for a software overview and function descriptions Use the VXI Library to control your VXIinstruments from a National Instruments embedded VXI controller or a PC equipped with a MXI controller The VXI Library includes functions for Commander and Servant Word Serial Protocol low level V XIbus access local resource access VXI signals interrupts triggers system interrupt handlers and system configuration Refer to the NI VXI User Manual and the NI VXI Programmer Reference Manual included with your LabWindows CVI VXI development system for a software overview and function descriptions GPIB GPIB 488 2 Use the GPIB Library to communicate with GPIB instruments over the NI 488
208. h the mouse click on the up or down arrow of the ring control until the value you want appears or click on the display field of the control and select the value you want directly from the list that appears If you want to type a variable name into a ring control select Options Toggle Control Style Specifying a Binary Control Parameter The binary control is a limited version of the slide control that has only two positions To select the position of the binary control press the up or down arrow key or the lt Home gt or lt End gt key To change the binary control with the mouse click on the position you want If you want to type a variable name into a binary control select Options Toggle Control Style LabWindows CVI User Manual 6 6 www ni com Chapter 6 Using Function Panels Specifying an Output Control Parameter The output control displays a value that the function you execute determines To specify a parameter for an output control select the control and type in the desired variable name An output control parameter must be an array name or the address of a scalar or structure For non array parameters you can leave an output control blank LabWindows CVI generates a temporary variable when you run the function panel If the output control requires an array or if you type a variable name into the output control the variable must be defined statically in the Interactive Execution window or defined elsewhere and declared as ex
209. have modified the contents of the window since the last save LabWindows CVI prompts you to save the file to disk Note The Hide command replaces the Close command in the Interactive Execution window The Hide command visually closes the Interactive Execution window but retains their contents in memory LabWindows CVI User Manual 5 8 WWW ni com Chapter 5 Source and Interactive Execution Windows Save All The Save All command saves all open files to disk Add File to Project The Add File to Project command adds the file in the current window to the project list Read Only The Read Only command suppresses the text editing capabilities in the current window When you initially open a file LabWindows CVI disables the Read Only command unless the file is read only on disk Print The Print command prints the window contents to a printer or a file Most Recently Closed Files For your reference two lists appear in the File menu e A list of the four most recently closed files other than project files e A list of the four most recently closed project files Exit LabWindows CVI The Exit LabWindows CVI command closes the current LabWindows CVI session If you have modified any open files since the last save or if any windows contain unnamed files LabWindows CVI prompts you to save them to disk National Instruments Corporation 5 9 LabWindows CVI User Manual Chapter 5 Source and Interactive Execution Windows Edit Menu
210. he ID when the current menu item generates a commit event Callback Function This field is optional In this box you can type the name of the function to be called when the current menu item generates an event Modifier Key Identifies the keys that users can press to cause the current menu item to execute Shortcut Key lIdentifies the keys that users can press to cause the current menu item to execute Dimmed Specifies whether the menu item is initially dimmed Checked Specifies whether the menu item initially has a checkmark Insert New Item Inserts a new item above or below the currently selected menu item Insert Separator lInserts a separator above or below the currently selected menu item The left hierarchy button moves the currently selected menu item up one level in the submenu hierarchy The right hierarchy button moves the currently selected item down one level in the submenu hierarchy gt gt gt View Displays the current state of the menu bar and pull down menus Cut Deletes the currently selected menu item and copies it to the menu Clipboard Copy Copies the currently selected menu item to the menu Clipboard Paste Inserts the menu item currently on the menu Clipboard above the currently selected menu item OK Accepts the current inputs and closes the dialog box Cancel Cancels the operation and removes the dialog box LabWindows CVI User Manual 4 10 WWW ni com Chapter 4
211. hen they are executed from the Project window and no project files are selected Suppress CVI Error Messages Some source code control systems display their own dialog boxes when errors occur during a source code control operation Enabling this option suppresses all LabWindows CVI error dialog boxes displayed when an error is reported by the source code control system e Use Default Checkin Comment Enable this option if you do not want to be prompted for a comment when you check in or add files to a source code control project Enter the comment that you want LabWindows CVI to pass to the source code control system e Advanced Click on this button to access advanced options provided by your source code control system If your source code control system does not provide advanced options this control is dimmed Project Move Options This command invokes the Project Move Options dialog box that you use to specify what LabWindows CVI does when you open the prj file from a different directory than the one you saved it in If you enable the Fixup Pathnames When Project is Moved or CVI is in a Different Directory option LabWindows CVI updates the pathnames in the project the project include paths the pathnames in the distribution kit and the pathnames of executable and icon files whenever you open the project from a directory other than the one you saved it in LabWindows CVI assumes that the files in the project have been moved to the
212. hlight immediate action menu input control input focus instrument driver Interactive Execution window LabWindows CVI User Manual A function panel control that displays the contents of global variables in a library function Global controls allow you to monitor global variables in a function that the function does not specifically return as results These are read only controls that the user cannot alter and do not contribute a parameter to the generated code hexadecimal The way in which input focus is displayed on a LabWindows CVI screen to move the input focus onto an item A menu that has no menu items associated with it and causes a command to execute immediately An immediate action command is suffixed with an exclamation point A function panel control that accepts a value typed in from the keyboard An input control can have a default value associated with it This value appears in the control when the panel is first displayed Displayed on the screen as a highlight on an item signifying that the item is active User input affects the item in the dialog box that has the input focus A set of high level functions for controlling an instrument It encapsulates many low level operations such as data formatting and GPIB RS 232 and VXI communication into intuitive high level functions An instrument driver can pertain to one particular instrument or to a group of related instruments An instrument driver cons
213. hor points Vertical Centers sets equal vertical spacing between the centers of the controls The upper most and lower most controls serve as anchor points National Instruments Corporation 4 21 LabWindows CVI User Manual Chapter 4 User Interface Editor Window Bottom Edges sets equal vertical spacing between the bottom edges of the controls The upper most and lower most controls serve as anchor points Vertical Gap sets equal vertical gap spacing between the controls The upper most and lower most controls serve as anchor points Vertical Compress compresses the spacing of controls to remove any vertical gap between the controls Left Edges sets equal horizontal spacing between the left edges of the controls The left most and right most controls serve as anchor points Horizontal Centers sets equal horizontal spacing between the centers of the controls The left most and right most controls serve as anchor points Right Edges sets equal horizontal spacing between the right edges of the controls The left most and right most controls serve as anchor points Horizontal Gap sets equal horizontal gap spacing between the controls The left most and right most controls serve as anchor points Horizontal Compress compresses spacing of the controls to remove any horizontal gap between the controls Distribute Vertical Centers The Distribute Vertical Centers command performs the same action as the Distribution command
214. igent Virtual Instrument Library See IVI Library Interactive Execution command Window menu 3 58 Interactive Execution window 5 4 to 5 5 Build menu 5 23 to 5 25 Edit menu 5 10 to 5 18 excluding lines 5 12 executing code 5 4 to 5 5 rules for 5 5 File menu 5 7 to 5 9 Instrument menu 5 33 Interactive Window Memory Size control 3 66 Library menu 5 33 Options menu 5 35 to 5 40 purpose and use 2 4 rules for executing code 5 5 National Instruments Corporation I 17 Index Run menu 5 26 to 5 32 selecting text 5 5 to 5 7 subwindows 5 5 Tools menu 5 33 to 5 35 View menu 5 18 to 5 22 Window menu 5 35 Interpret As command Options menu 7 17 Item field Edit Menu Bar dialog box 4 9 IVI command Library menu 3 45 to 3 46 IVI instrument drivers creating 3 53 5 34 editing attributes 5 34 IVI Library definition 3 45 purpose and use 2 3 K keyboard commands bypassing Find dialog box 5 17 bypassing Replace dialog box 5 18 Source window figure A 1 to A 2 Keyboard Help command Help menu 5 40 L Label Appearance section Edit Label Value Pairs dialog box 4 14 to 4 15 Labeling tool 4 2 Label Value Pairs button 4 14 LabWindows CVI See also specific windows components 2 1 to 2 5 Data Acquisition Library 2 3 Easy I O for DAQ Library 2 3 Instrument Library 2 4 IVI Library 2 3 LabWindows CVI environment 2 4 to 2 5 standard libraries 2 2 User Interface Library 2 3 VISA Librar
215. ighlighted National Instruments Corporation 6 7 LabWindows CVI User Manual Chapter 6 Using Function Panels File Menu This section contains a detailed description of the File menu for Function Panel windows as shown in Figure 6 3 Code View Instrument Library Tools Window Options Help New K Open D Close Ctrlew Save All Add FP File To Project Add Program File To Project Exit LabWindows CVI Figure 6 3 Function Panel Window File Menu New The New command works the same way as the New command in the Project window Refer to the File Menu section in Chapter 3 Project Window for more information on the New command Open The Open command works the same way as the Open command in the Project window Refer to the File Menu section in Chapter 3 Project Window for more information on the Open command Close The Close command closes the active Function Panel window Save All The Save All command saves all open files to disk Add FP File to Project The Add FP File to Project command adds the fp file of the current Function Panel window to the project list LabWindows CVI User Manual 6 8 WWW ni com Chapter 6 Using Function Panels Add Program File to Project The Add Program File to Project command adds the instrument driver program file associated with the fp file of the current Function Panel window to the project list Most Recently Closed Files For your reference t
216. igure 5 11 Use commands in the View menu to display line numbers and tags on source code step through build errors and manipulate function panels that pertain to your editing session Fie Edit Mu v Line Numbers wv Line Icons Toolbar Build Run Instrument Library Tools Window Options Help Line Ctrl L Beginning End of Selection Cil Toggle Tag Shift F2 Next Tag F2 Previous Tag Ctrl F2 Tag Scope L Clear Tags Function Panel History Ctrl H Function Panel Tree Shift F8 Recall Function Panel CIP Find Function Panel Ctrl Shift P Find UI Object CHE Figure 5 11 View Menu LabWindows CVI User Manual 5 18 www ni com Chapter 5 Source and Interactive Execution Windows Line Numbers The Line Numbers command controls the presence of line numbers in a window A checkmark appears next to the Line Numbers item in the View menu when you activate the line number display Line Icons The Line Icons command controls the presence of line icons in a window Line icons indicate the lines that you mark for breakpoint and the lines that you tag A checkmark appears next to the Line Icons item in the View menu when you activate the line icons display le Note LabWindows CVI saves line icons in the project file Editing source files outside of LabWindows CVI however might invalidate the associated line icons Toolbar Use the Toolbar command to toggle between viewing or not viewing the Source win
217. ii nimi LL IAE 6 20 Toolbars ose Iu Dedit e eei iis 6 21 TG So ag trs eise mets EE LEIS 6 21 Incl de EI lE tiia i Ee e EE Ud 6 21 Current Treesvexotecaniecsanbue e IUe NIAI 6 21 Function Panel HIStory nennen enne 6 21 Find Function Panel 6 21 Previous Function Panel eS ceo iste en bee eco E Eeer 6 22 Next Function Panel 6 22 Previous Function Panel Wumndouw sss 6 22 Next Function Panel WindoW sescenti 6 22 First Function Panel Window esse sese eee 6 22 Last Function Panel Window sees eene tenente etre 6 22 Instrument Menu teer er bep eod te uto tos deba e e uds e ERE 6 22 Library Menu eR Rep eroi 6 23 LabWindows CVI User Manual xiv www ni com Contents acle NT i EE EE E E eE NE A A n 6 23 Wandow R O KEA Di o AAEE EEES E EE Ee Ee dg Ren 6 23 Options Menu iei tete tete BAe a nail he ge Seat ieee ates 6 23 Default LGT nae fected toed Ree 6 24 Default ATL cos sce ERI seh ch seb eke cee A rec SA Sa IRE 6 24 Toolb aE z ise ec csse Re ee a 6 24 Exclude OTT EE 6 24 Togsle Control Style inp ete entere eere 6 24 Change Format uite et Dead ER aes dee 6 24 Edit Function Panel WImdOW sese 6 25 Help M 6 25 COMET Gs tuisse esee nm bnt a 6 25 IU CtIOD o eite rita edd oed iR 6 25 Chapter 7 Variables and Watch Windows Variables Windows SC Ee eoe etie ce te eti e EE dee 7 1 Watch WAT OW T 7 4 File Menus eosin ara lv en 7 6 EE 7 6 Open cee
218. ilers Note If you want to create an object file static library file or DLL that exports functions withthe stdcal1 calling convention it is a good idea to explicitly declare the functions as stdcallin the include h file and the source c file rather than relying on the Default Calling Convention option If you do not explicitly declare the functions as stdcallin the include file and if another developer uses the object file library file or DLL in LabWindows CVI or an external compiler without setting the default calling convention to stdcall the functions do not work correctly Maximum Number of Compile Errors This option sets an upper limit on the number of compile errors LabWindows CVI lists in the Build Errors window for each source file Maximum Stack Size bytes Your program uses the stack for passing function parameters and storing automatic local variables By setting a stack limit LabWindows CVI can catch infinitely recursive functions and report a stack overflow Refer to Chapter 1 LabWindows CVI Compiler of the LabWindows CVI Programmer Reference Manual for limitations on the stack size Debugging Level This setting is only used when the Debug item is checked in the Configuration submenu of the Build menu in the Project window When the Release item is checked in the Configuration submenu source modules are compiled without debugging information Refer to the Configuration section earlier in this chapter for
219. in Function dialog box shown in Figure 4 21 This dialog box prompts you to choose the panels the main function loads and displays at run time LabWindows CVI automatically assigns a default panel variable name for each panel in the uir file LabWindows CVI User Manual 4 26 WWW ni com Chapter 4 User Interface Editor Window Generate Main Function Figure 4 21 Generate Main Function Dialog Box le Note If you previously selected the Code Generate All Code command you do not have to execute this command Use this command only when you want to replace the main callback function to add or change the panels to be loaded at run time To automatically generate code for the main function select the panel or panels you want to load and display in the user interface and then click on OK When you choose Code Generate Main Function LabWindows CVI produces the include statements the variable declarations and the main callback function and places them in the target file KI Note Ifthe source file contains only the main function and the include statements and you have not yet created the appropriate callback functions you might get an error when trying to run the project When the main function calls LoadPanel1 LabWindows CVI generates a non fatal error for each callback function it cannot find in the source file The Generate WinMain Instead of Main checkbox enables you to use WinMain instead of main for your main program
220. ind include h files that contain some or all the missing prototypes It inserts include statements for these files into your source file at the current cursor position LabWindows CVI adds include statements only for libraries or instrument drivers that appear in the Instrument or Library menu Generate Prototypes After you compile a source file you can use the Generate Prototypes command to generate a file that contains declarations for global and static functions and external declarations for global variables The command generates the file into a new Source window You can copy these declarations into your source and header files Next Previous Build Error If when you compile a file or build your project LabWindows CVI displays multiple errors you can use the Next Build Error command to step to the next build error LabWindows CVI highlights source code as you step through the errors You can use the Previous Build Error command to step to the previous build error Build Errors in Next File If when you build your project LabWindows CVI displays errors for multiple files you can use the Build Errors in Next File command to step to your next file with build errors LabWindows CVI highlights source code as you step through the errors National Instruments Corporation 5 25 LabWindows CVI User Manual Chapter 5 Source and Interactive Execution Windows Run Menu This section explains how to use the commands in a Sour
221. indows Multi Dimensional Arrays For an array with two or more dimensions you can specify two dimensions as the rows and columns of the display You also can specify constant values to use to fix the other dimensions Use the Options Reset Indices command to specify which plane of the array to display Figure 8 2 shows the Array Display for a three dimensional array cw Array Display data Bisi E File Edit Format Run Window Options Help double data 4 10 3 Slice O R C Index 0 4 1 D 1 2 513870663 175725578 534531693 947630238 702230903 226416822 124698630 083895383 308633686 171727653 494766076 389629810 983458968 646473586 822962127 314676351 519760735 785424360 277230140 535386212 765676884 767143773 780236213 151821140 625476852 346903897 917203284 401165807 606769005 O CO Gn Cn 4s LUA KA C3 KA KA HH KA KA KA KA KA KA KA KA KA KA KA KA KA KA KA Ka Figure 8 2 Array Display for a Three Dimensional Array The Array Display window shows a two dimensional view By default the next to last dimension appears as rows the last dimension appears as columns and the indices of the other dimensions remain constant at 0 Select Options Reset Indices to specify the dimensions you want to display as rows and columns and set the other dimensions to constant values When you select Reset Indices for a three dimensional array the Reset Indices dialog box appears as shown in
222. indows CVI project The box contains a checkmark if the file is currently checked out from the source code control system Selecting Multiple Files in the Project Window You can execute commands on multiple files in the project by selecting multiple files and then executing the command through its hot key or menu item You can select multiple files in the source window by using one or more of the following methods e Ctil Left Click The file you clicked on is added to the currently selected files e lt Shift Left Click gt All of the files between the last selected file and the file you clicked on are added to the currently selected files e Cti Shift A Selects all of the files in the project e Shift Down Arrow gt Adds the file below the currently selected file in the list of selected files e Shift Up Arrow gt Adds the file above the currently selected file in the list of selected files National Instruments Corporation 3 3 LabWindows CVI User Manual Chapter3 Project Window File Menu This section explains how to use the commands in the Project window File menu as shown in Figure 3 2 Figure 3 2 File Menu LabWindows CVI User Manual 3 4 www ni com Chapter 3 Project Window New The New command has a submenu as shown in Figure 3 3 Edit View Build Run Instrument Library Tools Window Options Help Seach Open gt Include h User Interface
223. information LabWindows CVI User Manual 2 6 www ni com Project Window This chapter describes the LabWindows CVI Project window which controls specific tasks related to organizing and executing application programs Project Window Overview Use the Project window to open edit build run and save application project pr 3 files A project file is a list of files your application uses Certain files must be in the list while others are optional If you had a project loaded the last time you used LabWindows CVI that project appears in the Project window when you start LabWindows CVI again Unless you use the following files as instrument driver program files or load them dynamically using LoadExternalModule you must put them in your project file list Source files your application program uses ending with c Object files your application program uses ending with obj Library files your application program uses ending with 1ib DLL import libraries are in this category The following files are optional in your project file list Header files h your application program uses Listing n files makes it easy to open them for viewing or editing and ensures that the compiler can find them User interface resource uir files your application program uses Listing uir files makes it easy to open them for viewing or editing and ensures that LabWindows CVI can find them Instrument driver function panel p fi
224. inter declarations such as void fp whether used as a global local parameter array element or structure member Typedefs such as typedef void FUNTYPI ES A Old style function definitions in which you declare parameters outside of the parameter list that you do not precede with a full prototype Function call expressions such as fp where fp does not have a full prototype Caution It is best to enable the Require Function Prototypes option If disabled some of the run time error checking is also disabled Require Return Values for Non void Functions This option generates compile warnings for non void functions except main that do not end with a return statement that returns a value LabWindows CVI reports a run time error when a non void function executes without returning a value For example the following code always produces a compile time warning and it produces a run time error when 1ag is FALSE int fun void if flag return 0 e Enable Signed Unsigned Pointer Mismatch Warning This option generates a compiler warning for pointer assignments in which the left side and right side are not both signed or unsigned expressions According to the ANSI C standard these assignments are errors because they involve incompatible types In practice however such assignments cause no problems The LabWindows CVI compiler checks assignment statements and function call arguments to ensur
225. into a numeric control select Options Toggle Control Style National Instruments Corporation 6 5 LabWindows CVI User Manual Chapter 6 Using Function Panels Specifying a Slide Control Parameter With a slide control you select one item from a list of options The position of the slider the cross bar on the slide control determines the value LabWindows CVI places in the function call To move the slider with the keyboard press the up or down arrow key As you move the slider the corresponding argument in the function call in the generated code box changes The lt Home gt and lt End gt keys move you to the top and bottom of the slide control respectively To move the slider with the mouse click on the slider and drag it up and down or just click on the position you want If you want to type a variable name into a slide control select Options Toggle Control Style Specifying a Ring Control Parameter The ring control represents a range of values much like the slide control A ring control displays only a single item from a list instead of displaying the whole list at once as the slide control does The item you select determines the value LabWindows CVI places in the function call To select an item from a ring control with the keyboard use the up and down arrow keys to scroll through the list Press the space bar to display the entire list of items for the selected ring control To select an item from a ring control wit
226. ip for a period of 90 days from date of shipment as evidenced by receipts or other documentation National Instruments will at its option repair or replace software media that do not execute programming instructions if National Instruments receives notice of such defects during the warranty period National Instruments does not warrant that the operation of the software shall be uninterrupted or error free A Return Material Authorization RMA number must be obtained from the factory and clearly marked on the outside of the package before any equipment will be accepted for warranty work National Instruments will pay the shipping costs of returning to the owner parts which are covered by warranty National Instruments believes that the information in this document is accurate The document has been carefully reviewed for technical accuracy In the event that technical or typographical errors exist National Instruments reserves the right to make changes to subsequent editions of this document without prior notice to holders of this edition The reader should consult National Instruments if errors are suspected In no event shall National Instruments be liable for any damages arising out of or related to this document or the information contained in it EXCEPT AS SPECIFIED HEREIN NATIONAL INSTRUMENTS MAKES NO WARRANTIES EXPRESS OR IMPLIED AND SPECIFICALLY DISCLAIMS ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE CUSTOMER S
227. is manual is distributed with National Instruments V XI controllers for LabWindows CVI VXI Development System users National Instruments Corporation xxiii LabWindows CVI User Manual Configuring LabWindows CVI This chapter describes special options that override some of the configuration defaults established during the LabWindows CVI installation or through the configuration dialog boxes within the environment These options inform LabWindows CVI where to find system files where to place temporary files and so on You might not need to set any of these options Getting Started with LabWindows CVI contains installation instructions for LabWindows CVI and a hands on tutorial It is a good idea to be familiar with the material in Getting Started with LabWindows CVI before you read this manual LabWindows CVI Startup Options You can append certain options to the cvi command line separating various parameters by spaces The valid startup options appear in Table 1 1 Table 1 1 LabWindows CVI Startup Options Option Purpose lt filename gt LabWindows CVI automatically loads the file at startup The file can be any of the types available under the File Open command in LabWindows CVI run This option automatically invokes the Debug command from the Run menu of LabWindows CVI run then exit This option automatically invokes Run Debug and then automatically invokes File Exit LabWindows CVI when the projec
228. ists of a program and a set of function panels The program contains the code for the high level functions Associated with the instrument program is an include file that declares the high level functions you can call the global variables you can access and the defined constants you can use A LabWindows CVI work area in which sections of code may be executed without creating an entire program G 4 www ni com list box MB menu new style function definition 0 old style function definition output control P Project window prompt command R return value control National Instruments Corporation G 5 Glossary A dialog box item that displays a list of possible choices megabytes of memory An area accessible from a menu bar that displays selectable menu items A function definition in which parameters are declared directly in the parameter list A function definition in which parameters are declared outside of the parameter list A function panel control that displays a value that the function you execute generates An output control parameter must be a string an array or a reference parameter of type integer long single precision or double precision A window containing a list of files your application uses A command that requires additional information before it can be executed a prompt command appears on a pull down menu suffixed with three ellipses A function panel control
229. itor window but does not unload the fp file The file has been modified since you last saved it Double click on this icon to save the file You have modified the file since you last compiled it or you manually marked it for compilation Double click on this icon to compile the file This icon applies only to source c files and indicates that you enabled the Compile Without Debugging option If this option is enabled LabWindows CVI compiles the source file without debugging the information You can use this option to reduce the amount of memory used when building a project Double click on this icon to toggle the option The file is associated with a loaded instrument driver This icon indicates that the fp file is loaded into the Instrument menu and signifies that it is attached to or Associated with a program file 3 2 www ni com Chapter 3 Project Window L This icon indicates that the fp file is loaded into the Instrument menu and signifies that it is unattached to any program file When you double click on this icon LabWindows CVI tries to attach a program file If no icon appears in the I column next to a p file the p file is not loaded into memory When you double click on the U icon LabWindows CVI tries to load the p file into memory and attach the instrument driver program file This icon is displayed for a file if the file is in the source code control system project specified for the current LabW
230. ive Execution window LabWindows CVI treats the following statements the same extern int fn void int fn void LabWindows CVI treats the following statements as errors static int fn void static int fn e LabWindows CVI treats all global data declarations in the Interactive Execution window as if they are declared as static unless the extern keyword precedes them If the extern keyword precedes them the global declaration must exist in a loaded instrument or in a file in the project The following data declaration is invalid in the Interactive Execution window extern int x 6 Using Subwindows The Source and Interactive Execution windows support subwindows so that you can have two scrollable editing areas for the same file To create a subwindow from any of these windows use the mouse to drag the thin line beneath the menu bar or toolbar if you have activated the Toolbar option from the View menu to a lower position in the window You can then switch between the subwindows by pressing F6 or by clicking in a subwindow with the mouse Selecting Text in the Source and Interactive Execution Window Certain LabWindows CVI commands require that you select the block of text to which the next command applies In LabWindows CVI you can select a range of characters a range of lines or a range of columns When you select a block of text it is highlighted on the screen To select text with the keyboard hold down
231. iver command Tools menu Project window 3 53 Source and Interactive Execution windows 5 34 Create menu User Interface Editor Controls command 4 17 illustration 4 16 Menu Bars command 4 17 Panel command 4 17 Create Object File command Options menu 5 39 to 5 40 Create Release Dynamic Link Library command Build menu Source and Interactive Execution windows 5 24 Configuration submenu Build menu Project window 3 12 Create Release Executable command Build menu Source and Interactive Execution windows 5 24 Configuration submenu Build menu Project window 3 12 Create Static Library command Build menu Project window 3 12 to 3 13 Source and Interactive Execution windows 5 24 National Instruments Corporation I 7 Index creating applications 2 5 to 2 6 object files 5 39 to 5 40 standalone executables See standalone executables creating and distributing user interface 2 6 curly braces finding pairs of 5 13 setting location for 5 37 Current Tree command View menu 6 21 customizing bracket styles 5 37 colors 3 73 fonts 3 73 5 37 toolbars 5 2 to 5 3 Cut command Edit menu 4 7 5 11 Cut Panel command Edit menu 4 7 CVI Environment sleep Policy option 3 65 CVI Libraries display External Compiler support dialog box 3 23 CVI macro 3 63 CVI DEBUG macro 3 63 CVI DLL macro 3 63 CVI EXE macro 3 63 CVI LIB macro 3 63 cvidir configuration option 1 3 to 1 4 D Data Acquisition com
232. kit The default installation script file is cvi bin template inf The installation script for distributing VXIplug amp play instrument drivers is cviMoinNvxipnp inf The instructions for using the VXIplug amp play installation script are in the file cvi bin vxipnp doc If you use the Create DLL Project command in the Function Tree Editor window with the VXIplug amp play Style command enabled LabWindows CVI automatically generates project settings so that the Create Distribution Kit command uses the VXIplug amp play installation script and distributes all the files required of a VXIplug amp play installation Script Filename The pathname of the customized installation script file You can use the Browse button to select an existing filename National Instruments Corporation 3 29 LabWindows CVI User Manual Chapter 3 Project Window Executable Filename The name of an executable file to run after the user installation is complete Use the Select button to select a file that you have already added to one of the file groups Command Line Arguments The command line arguments to pass to the executable to run after the installation is complete Use the Help button to view detailed information on special macros you can use in this control Program Group Name The name of the program group created during the installation If you select the Use Default option LabWindows CVI uses the following priority to determine the pro
233. laced in the function call A LabWindows CVI work area in which programs are edited and executed A LabWindows CVI work area in which textual output to and input from the user take place The LabWindows CVI User Interface Analysis Data Formatting and I O GPIB GPIB 488 2 DDE TCP RS 232 Utility and C system libraries A window for viewing and editing string variables and arrays A dialog box item in which text is entered from the keyboard G 6 www ni com U User Interface Editor window V Variables window W Watch window window Glossary The window in which you build pull down menus dialog boxes panels and controls and save them to a User Interface Resource uir file A window that shows the values of all the currently active variables A window that shows the values of user selectable variables and expressions that are currently active A working area that supports specific tasks related to developing and executing programs National Instruments Corporation G 7 LabWindows CVI User Manual Index A About LabWindows CVI command Help menu 3 74 ActiveX Automation command Library menu 3 46 ActiveX Automation Controller creating See Create ActiveX Automation Controller command Tools menu ActiveX Automation Library 3 46 Add File to Project command File menu Source and Interactive Execution windows 5 9 User Interface Editor window 4 5 Add File to Source Control command S
234. le menu item is displayed if the Debug item is checked in the Configuration submenu and the Executable item is checked in the Target Type submenu Use this menu item to compile and build an executable with debugging information Use the Debugging level control on the Build Options dialog box to set the amount of debugging information generated for the executable For information on the Debugging level control settings refer to the Build Options section in this chapter To debug the executable created with this command use the Debug menu item in the Run menu of a Project Source or Variables window You can set the executable s filename as well as other executable settings using the Target Settings dialog box displayed by the Target Settings menu item You can set other compile and run options using the menu items in the Options menu of the Project window e The Create Debuggable Dynamic Link Library menu item is displayed if the Debug item is checked in the Configuration submenu and the Dynamic Link Library item is checked in the Target Type submenu Use this menu item to compile and build a DLL with debugging information Use the Debugging level control on the Build Options dialog box to set the amount of debugging information generated for the executable For information on the Debugging level control settings refer to the Build Options section in this chapter To debug the DLL created with this command use the Debug menu item in the Run m
235. le so you can see its name and starting address Clicking on the circle icon has the same effect as selecting View Close Variable Follow Pointer Chain Use Follow Pointer Chain to examine complex pointer linked structures such as linked lists and trees If a pointer is a member of a structure and points to a structure of the same type Follow Pointer Chain replaces the current structure with the child structure that the pointer references For example in Figure 7 12 hquework begin next is a member of the structure hquework begin and points to another structure type of Item LabWindows CVI User Manual 7 12 WWW ni com Chapter 7 Variables and Watch Windows cn Variables File Edit View Format Run Window Options Help 9 hquework 00A62524 9 hquework begin 00A62530 hquework begin value 1 Y hquework gt begin gt next 00A6253C Y hquework gt end 00A6259C ALI Figure 7 12 Parent Structure Pointer in a Chain Clicking on the right arrow icon or selecting Follow Pointer Chain replaces the current structure with the child structure that the pointer references as shown in Figure 7 13 cw Variables File Edit View Format Run Window Options Help 9 hquework e hquework begin next 00A6253C hquework gt begin gt next gt value 12 Y hquework begin next next 00A62548 Y hquework gt end 0046259C kii Figure 7 13 Child Structure Pointer in a Chain Retrace Pointer Chain Retrace Pointer Chain replaces
236. leaving the highlight on the current line Return terminates the search moving the highlight to where you initiated the search The search hot keys remain active even if you disable the Button Bar The search hot keys in the Variables and Watch windows are the same as the search hot keys in Source windows Use the Keyboard Help command in the Options menu of a Source window for a list of the search hot keys or refer to Appendix A Source Window Keyboard Commands Next Scope In the function subwindow Next Scope highlights the function that called the current function In the Global subwindow Next Scope highlights the next module This command is not available in the Watch window Previous Scope In the function subwindow Previous Scope highlights the function that the current function called directly In the Global subwindow Previous Scope highlights the previous module This command is not available in the Watch window National Instruments Corporation 7 9 LabWindows CVI User Manual Chapter 7 Variables and Watch Windows Edit Menu for the Watch Window This section contains a detailed description of the Edit menu for the Watch window Figure 7 8 shows the Edit menu for the Watch window File View Format Run Window Options Help Edit Value Add Watch Expression Edit Watch Expression Enter Delete Watch Expression Del Find Shift F3 Figure 7 8 Edit Menu in the Watch Window Edit Value
237. lect Function Panel dialog box shows the function panels available in the driver you selected Class names appear in the dialog box followed by ellipses The ellipses indicate that more functions or classes of functions exist below that class name If you select Flatten the list box shows all function panels at or below the current level If you select the Function Names option the list box shows the function names associated with each function panel While in this mode the Alphabetize option redisplays the function list in alphabetical order If New Window is selected the next selected function panel appears in a new window Otherwise LabWindows CVI overwrites the current Function Panel window This overrides the Use Only One Function Panel Window option in the Environment command of the Options menu Use Select to select a class name to view the functions within a class A class can contain other classes and functions An instrument driver can contain up to four levels of classes and functions Each time you select a class name the function list updates Click on the Up button to return to the previous level LabWindows CVI User Manual 3 42 www ni com Chapter 3 Project Window When you select a function from a dialog box that function panel appears Refer to Chapter 6 Using Function Panels for more information about function panels To close the dialog box without opening a function panel select Cancel The Select Function
238. les Listing fp files lets LabWindows CVI automatically load instruments when you open the project Instrument driver program files Listing these files overrides the loading precedence for instrument driver program files Refer to the Using Instrument Drivers and Instrument Menu sections in this chapter for information about instrument driver program files National Instruments Corporation 3 1 LabWindows CVI User Manual Chapter 3 Project Window Figure 3 1 shows a sample Project window tempsys h Ell d cvi55 samples apps tempsys tempsys prj IL x File Edit View Build Run Instrument Library Tools Window Options Help BS Co Date 08 30 1999 10 00 AM tempsys c 08 30 1999 10 00 AM smith fp A 09 30 1999 10 00 AM tempsys uir toolbox fi 08 30 1999 10 00 AM aie H 0 399 10 00 AM Figure 3 1 Project Window You can open c h and uir files in the project list by double clicking directly on the filename Double clicking ona fp filename opens the Select Function Panel dialog box for the instrument driver You can use the following icons in the Project window LabWindows CVI User Manual The file is currently closed Double click on this icon to open the file If the file is a fp file double clicking opens the Function Tree Editor The file is currently open Double click on this icon to close the file If the file is a fp file double clicking hides the Function Tree Ed
239. lf in the background in sleep mode for a specified period of time While LabWindows CVI is in sleep mode other applications have more processor time However LabWindows CVI might run slower You can specify how much LabWindows CVI sleeps You have the following sleep policy choices Do not sleep Sleep some sleep a short period of time Sleep more sleep a longer period of time the default setting The setting that is optimal for you depends on the operating system you are using and the other applications you are running Generally for Windows National Instruments recommends the sleep more mode If you think you might have to make an adjustment try the different settings and observe the resulting behavior National Instruments Corporation 3 65 LabWindows CVI User Manual Chapter 3 Project Window Interactive Window Memory Size Use this control to set the amount of memory reserved for executing function panels or code in the interactive window If LabWindows CVI displays the message Insufficient memory for Interactive window you must increase this value select the Clear Interactive Declarations command from the Interactive Execution window Build menu and then execute the interactive window statements again Use Only One Function Panel Window Enable this option to overwrite the current function panel window each time you select a new function panel window e Goto Source After Inserting Code from Function Pa
240. llback Events dialog box To set the Default Panel Events or Default Control Events select the events you want to be included in the code as case statements and then click on OK For each option you choose LabWindows CVI includes in the source code a case statement that corresponds to this option LabWindows CVI User Manual 4 30 www ni com Chapter 4 User Interface Editor Window B Note Default control events are ignored for timer control callbacks for which the only event cases are EVENT_TIMER_TICK and EVENT_DISCARD When the Always Append Code to End command is selected LabWindows CVI places the skeleton code for each callback function at the end of the target file When this option is not selected newly generated code is placed at the current position of the cursor in the target file Run Menu This section explains how to use the commands in the User Interface Editor window Run menu as shown in Figure 4 25 The Run menu contains a subset of the commands that appear in the Run menu of the Source window Fie Edit Create View Arange Code SIT Library Tools Window Options Help Debug tempsys_dbg exe Shift F5 Continue F5 Step Over F10 Step Into F8 Einish Function Ctrl F10 Terminate Execution Ctrl F12 Break at First Statement Breakpoints Shift F9 Figure 4 25 Run Menu Refer to the Run Menu section of Chapter 5 Source and Interactive Execution Windows for descriptions of eac
241. log box appears as shown in Figure 3 9 cw External Compiler Support IV Using LoadE xtemalModule to Load Object and Static Library Files Obiect File Browse Help Create CVI Libraries id NcviNextlibvrefsym c Help ANSI C Library id NcvivextlibNarefsym c Help IZ Other Symbols Help Header File Browse Bee Object File Browse Create FEE F NOTE Always include the following files in your external compiler project d NcviNextlibNcvirt lib d cvisextlib cvisupp lib d cvisextlib cviwmain lib if WinMain is required but not otherwise defined Cancel Figure 3 9 External Compiler Support Dialog Box The External Compiler Support dialog box has the following options UIR Callbacks This option creates an object or source file for you to link into your executable or DLL The object or source file contains a list of the callback functions you specify in the User Interface Resource uir files in your project When you load a panel or menu bar from the uir file the User Interface Library uses the list to link the objects in the panel or menu bar to their callback functions in your executable or DLL If you specify callback function names in your uir file s set the ring control to Source File enter the name of the source file to create and click on the Create button In the future whenever you save modifications to any of the uir files in the
242. lp New b O etc Include h Save Ctrl S User Interface uir Save As Project prj Cla Function Tree fp Save All v Auto Save Project Print Exit Labwindows CVl Figure 3 4 Open Command Use the Open command to open various types of user specified files When you select Open a dialog box appears prompting you for a filename to load into a new window One feature of this dialog box is the Directories ring which is at the top of the dialog box When activated this ring displays a list of directories from which you have opened files previously If you choose Source or Include a Source window appears with your specified c or n file If you choose User Interface a User Interface Editor window appears with your specified uir file If you choose Project a Project window appears with your specified prj file LabWindows CVI prompts you to save any modified files in the old project If you choose Function Tree a new Function Tree Editor window appears with your specified p file You cannot use this command to load instrument modules You load instrument modules from the Instrument menu Save Use the Save command to write the project prj file to disk If you want to append a different extension type it in after the filename If you do not want to append any extension enter a period after the filename LabWindows CVI User Manual 3 6 www ni com Chapter 3 Projec
243. m left of the dialog box A color pop up palette appears While holding the mouse button down move the pointer over the desired color and then release The color change takes effect immediately in all LabWindows CVI windows that are currently visible To change all the colors to their default state click on Default All currently visible LabWindows CVI windows immediately reflect the color changes If you want to accept these changes click on the OK button If you want to revert to the state before the dialog box appeared click on Cancel You also can access the Colors command in the Source window and the Interactive Execution window The Color dialog box also contains eight color types for syntax coloring Refer to the Syntax Coloring section in Chapter 5 Source and Interactive Execution Windows When you enable the Use System Colors option several color types associated with the Project window Source window and scroll bars disappear from the list box LabWindows CVI automatically assigns colors to these types based on the system colors you set in the Appearance tab in the Windows Display Properties dialog box National Instruments Corporation 3 73 LabWindows CVI User Manual Chapter 3 Project Window Help Menu You use the commands in the Help menu shown in Figure 3 27 to access information about LabWindows CVI Window Options Malzis Contents Fi Windows SDK Search For Help On File Edit View Build Run
244. mand Library menu 3 45 Data Acquisition Library definition 3 45 purpose and use 2 3 data tool tips enabling 3 66 data type compatibility for function panel variables 6 18 to 6 19 DataSocket command Library menu 3 46 DataSocket Library 3 46 date option DSTRules 1 4 LabWindows CVI User Manual Index dates displaying files in chronological order 3 10 displaying for project list files 3 10 daylight savings time setting 1 4 DDE command Library menu 3 46 DDE Library 3 46 debugging Create Debuggable Dynamic Link Library command 3 13 5 24 Create Debuggable Executable command 3 13 5 23 Debug command Run menu 3 33 to 3 34 Debug option Configuration command 3 11 Debug Output window 3 56 Debug Run Interactive Statements command Run menu 5 28 to 5 29 DLLs 3 30 to 3 33 location of required files 3 31 to 3 32 running external process 3 32 to 3 33 running program in LabWindows CVI 3 32 Use Console Window for Standard I O When Debugging option 3 66 debugging levels Extended 3 60 No Run time Checking 3 60 Standard 3 60 Declare Variable command Code menu 6 10 to 6 11 specifying input control parameter 6 5 specifying output control parameter 6 7 Declare Variable dialog box 6 10 to 6 11 Add declaration to current block in target file checkbox 6 11 Add declaration to top of target file checkbox 6 11 LabWindows CVI User Manual l 8 Cancel button 6 11 Execute declaration 6 11 illustration
245. menu bars Use the tool bar beneath the menu bar for high level editing with the mouse When you click on a particular tool the mouse cursor changes to reflect the new editing mode You can use the following icons in the User Interface Editor window Use the operating tool to operate objects When you are in the operate mode events display on the right side of the tool bar These event displays have a built in delay to give you time to see each event Use the editing tool to select position and size objects Use the labeling tool to modify text associated with objects S p EJ Use the coloring tool to color objects Clicking the right mouse button displays a color palette from which you can choose a color Clicking the left mouse button automatically colors the object with the last color selected in the color palette x Holding down the lt Ctrl gt key changes the coloring tool to an eyedropper tool When you click on an object with the eyedropper tool the current color of the tool becomes the color of that object Then you can apply that object s color to another object LabWindows CVI User Manual 4 2 www ni com Chapter 4 User Interface Editor Window Using the Pop Up Menus of the User Interface Editor You can open a pop up menu by right clicking on the User Interface Editor window The type of pop up menu that appears depends on the surface you click on The following is a list of the areas in the User Interface Editor that
246. minate the program You can select one or more callback functions to ensure proper program termination File Menu This section explains how to use the commands in the User Interface Editor window File menu as shown in Figure 4 3 Figure 4 3 File Menu New Open Save and Exit LabWindows CVI The New Open Save and Exit LabWindows CVI commands in the File menu of the User Interface Editor work like New Open Save and Exit LabWindows CVI commands in the Project window For more information on these commands refer to the File Menu section of Chapter 3 Project Window LabWindows CVI User Manual 4 4 www ni com Chapter 4 User Interface Editor Window Save As Use the Save As command to write the uir file to disk using a name you specify The Save As command changes the name on the User Interface Editor window title bar to the new name you specified If you want to append an extension other than uir type it in after the filename If you do not want to append any extension enter a period after the filename Save Copy As The Save Copy As command writes the contents of the active window to disk using a name you specify without changing the name of the active window Close The Close command closes the active window If you have modified the contents of the window since the last save LabWindows CVI prompts you to save the file to disk Save All The Save All command saves all open files to disk Add File
247. n a Function Panel window to invoke the String Display window when the name of a string variable is under the keyboard cursor or is in the active function panel control Figure 8 4 shows the String Display for a string variable tw String Display s OF x File Edit Format Run Window Options Help char s Index 0 D 5 10 15 20 25 30 OH1 VOL 10 0 COU AC INV OFF al _ H Z Figure 8 4 String Display for a String Variable Multi Dimensional String Array Use the Reset Indices command to specify which index of a multi dimensional string array to use as rows in the String Display window LabWindows CVI disables Reset Indices when you view a single string variable or a one dimensional string array For a string array of two or more dimensions you can specify which index to use for the rows of the display The other dimensions remain constant at indices that you specify When you select Reset Indices the Reset Indices dialog box appears LabWindows CVI User Manual 8 4 WWW ni com Chapter 8 Array and String Display Windows The dialog box shows the size and display index for each array dimension The letter R indicates the dimension displayed as rows The indices for the remaining dimensions remain constant at the specified values If you enter an invalid character or any alphabetic character besides R or r or an invalid index an error message appears File Menu This section contains a detailed description of th
248. n the Call Mechanism control on the Configure panel of the wizard the wizard generates either a single set of get and set property functions for the whole instrument driver or get and set property functions for each object in the instrument driver If the wizard generates get and set property functions you use a property constant to identify a specific property to a property function LabWindows CVI concatenates the instrument prefix an object tag and a property or method tag to create each constant name and method function name in the instrument driver You can specify the object method and property tags but the dialog box provides default values The default value for a tag is the object name method name or property name that the server object library defines Given the size of object and method names in some servers some of the function names suggested in the Automation Controller Advanced Options dialog box can be very long However the function panel file format imposes a limit of 79 characters excluding the instrument prefix and underscore In addition the ActiveX Automation Controller Wizard imposes a limit of 79 characters on property constants excluding the instrument prefix and underscore Therefore it might be necessary for you to edit the object property and method tags to make the function names and property constants smaller To assist you the dialog box flags names that are too long The dialog box also automatically abbre
249. n the include subdirectory under the VXIplug amp play directory LabWindows CVI can find the include files in the V XIp ug amp play include directory When you install a VXIplug amp play instrument driver the installation program places the source c file in the same directory as the p file The installation program also installs a dynamic link library d11 and two import libraries 1ib one compatible with Visual C C and the other with Borland C C These files are not in the same directory as the p file The import libraries are in the msc and bc subdirectories in the VXIplug amp play lib directory The DLL is in the VXIp ug amp play bin directory The installation program adds the VXIplug amp play bin directory to the PATH environment variable so that the DLL can be found using the standard Windows DLL search algorithm If the p file is under the VXIplug amp play framework directory and your current compatible compiler is Visual C C or Borland C C LabWindows CVI can find the appropriate import library If your current compatible compiler is Watcom C C or Symantec C C LabWindows CVI looks for the import library in the wc or sc subdirectory in the VXIplug amp play lib directory However import libraries for these two compilers do not normally accompany VXIplug amp play instrument drivers If LabWindows CVI finds the import library it gives it precedence over the c file as the program file for the instrument driver
250. nction LabWindows CVI displays the panel If two or more function panels exist for the function LabWindows CVI displays a list of the function panels The shortcut key for Find Function Panel is lt Ctrl Shift P gt National Instruments Corporation 6 21 LabWindows CVI User Manual Chapter 6 Using Function Panels Previous Function Panel The Previous Function Panel command displays the previous function panel in the current Function Panel window Next Function Panel The Next Function Panel command displays the next function panel in the current Function Panel window Previous Function Panel Window The Previous Function Panel Window command opens the Function Panel window that precedes the current Function Panel window in the same Function Tree Next Function Panel Window The Next Function Panel Window command opens the Function Panel window that follows the current Function Panel window in the same Function Tree The rotation order for the Function Tree is circular If the first Function Panel window in the tree is visible on the screen selecting Previous Function Panel Window displays the last Function Panel window in the tree If the last Function Panel window in the tree is visible selecting Next Function Panel Window displays the first Function Panel window in the tree First Function Panel Window The First Function Panel Window command displays the first Function Panel window in the Function Tree Last Function
251. nd 4 36 Variables and Watch windows Add Watch Expression command 7 4 7 17 Estimate Number of Elements command 7 17 illustration 7 16 l 21 Index Interpret As command 7 17 Variable Size command 7 16 to 7 17 Other User Interface Editor Preferences dialog box 4 35 to 4 36 Output command File menu Array and String Display windows 8 5 Variables and Watch windows 7 6 output control parameters specifying 6 7 Overwrite command Edit menu 8 8 P Panel Attributes section Edit Panel dialog box 4 12 Panel Callback command Generate menu 4 28 to 4 29 Panel command Create menu 4 17 Edit menu 4 11 to 4 12 Panel Settings section Edit Panel dialog box 4 12 panels copying or cutting 4 7 Edit Panel dialog box 4 11 to 4 12 preferences for new panels 4 33 to 4 34 conform to system colors 4 34 resolution adjustment 4 33 to 4 34 showing hiding 4 10 to 4 20 parent structure 7 3 parent structure pointer in chain figure 7 13 parentheses finding pairs of 5 12 Paste command Edit menu 4 7 5 11 Paste option Editor Preferences command 5 36 path options Fixup pathnames when project is moved or CVI is in a Different Directory 3 72 Prompt for include file paths 3 62 LabWindows CVI User Manual Index pathnames displaying project files by full pathname 3 10 sorting project files by pathname 3 10 paths for compiler listing 3 64 pointer mismatch warning enabling 3 61 pop up menus User Interface Editor
252. ndex Source Code Control Options dialog box Source window LabWindows CVI User Manual 3 71 to 3 72 Build menu 5 23 to 5 25 Advanced 3 72 context menus 5 3 Attach 3 71 Edit menu 5 10 to 5 18 Create 3 71 File menu 5 7 to 5 9 Do Not Include prj File in SCC Actions 3 72 illustration 3 71 Perform Same Actions for h File as for uir File 3 71 to 3 72 Project 3 71 Provider 3 71 Suppress CVI Error Messages 3 72 Use Default Checkin Comment 3 72 Source Code Control submenu Tools menu 3 53 to 3 55 Add File to Source Control 3 54 Check In 3 54 Check Out 3 54 Clear Source Code Control Error Window 3 55 Get Latest Version 3 54 Get Latest Version of All 3 54 Properties 3 55 Refresh Status 3 55 Remove From Source Control 3 54 Show Differences 3 55 Source Code Control 3 55 Undo Checkout 3 54 source files creating with CodeBuilder 4 3 to 4 4 debugging 2 6 forcing into Interactive window current project 3 66 loaded instrument driver 3 66 listed in Window menu 3 58 required in project file list 3 1 Source option Add Files to Project command 3 8 1 26 Instrument menu 5 33 keyboard commands figure A 1 to A 2 Library menu 5 33 notification of external modification 5 3 opening with New command 3 5 with Open command 3 6 Options menu 5 35 to 5 40 purpose and use 2 4 5 1 Run menu 5 26 to 5 32 selecting text 5 5 to 5 7 subwindows 5 5 Tools menu 5 33 to 5 35
253. ndicates the executable or DLL to which the watch expression applies The default value for the control is Current Project When you start debugging a project LabWindows CVI changes Current Project to the name of the target executable or DLL for the current project If you want the watch expression to apply to a DLL that is not the target of the current project you must supply the name of the DLL Enter the filename and extension without a directory path as in myd11 d11 The menu ring to the right of the control contains the names of all DLLs currently loaded To set a watch expression for a DLL it is easiest to first set a breakpoint in a DLL source file Once the DLL has been loaded and program execution suspends select the DLL name from the menu ring File Name of the file that defines the variable or expression variables if they are global to a file or local to a function Function Name of the function that defines the variable or expression variables if they are local to a function Update Display Continuously Causes the variable or expression to be evaluated and updated on the Watch window between each statement in your program while the program is running Break When Value Changes Suspends the program when the value of the variable or expression changes e Replace Replaces the previous attributes of the current variable or expression of the same name in the Watch window with the current attributes of the dialog
254. ndow Run Time Errors If you attempt to run a project and the project has run time errors such as over indexing an array the Run Time Errors window contains a list of the errors To bring the Run Time Errors window to the front for viewing select Window Run Time Errors in the Project window The Run time Errors window also displays the output of the Utility Library ErrorPrintf function Debug Output The Debug Output window contains the output of the Utility library DebugPrintf function as well as the output of the Windows SDK OutputDebugString function LabWindows CVI User Manual 3 56 www ni com Chapter 3 Project Window Source Code Control Errors This window displays warning and errors returned by source code control systems when you execute commands from the Source Code Control submenu of the Tools menu Memory Display The Memory Display command opens the Memory Display window that you can use to view and edit the memory of the program you are debugging This window allows you to view and edit the data in hexadecimal byte word long decimal byte word long single precision floating point double precision floating point or ASCII representation You must enable the Edit Mode option before you can modify the process memory To change the value of a memory location click on that cell in the Memory Display window and type in the new value Variables Use this command to bring the Variables window to the front The
255. ndows CVI Instrument Driver Developers Guide contains the IVI Library function reference information and instructions on how to create IVI drivers Select Tools Create IVI Instrument Driver to start the Create IVI Instrument Driver Wizard Use the Transmission Control Protocol TCP Library to communicate over TCP networks Refer to the LabWindows CVI Online Help for TCP function descriptions DataSocket DDE Use the DataSocket Library to access data from different sources including HTTP FTP DataSocket Transfer Protocol DSTP and Ole for Process Control OPC servers You also can use the DataSocket Library to publish data using the DSTP DataSocket uses an enhanced data format for exchanging instrumentation style data including data attributes and actual data Data attributes might include information such as an acquisition rate test operator name timestamp quality of data and so on Although you can use general purpose file I O functions TCP IP functions and FTP HTTP requests to transfer data between applications applications and files and computers you must write a significant amount of program code to do so DataSocket greatly simplifies this task by providing a unified API for these low level communication protocols Transferring data across computers with DataSocket is as simple as using a browser to read Web pages on the Internet Refer to the LabWindows CVI Online Help for more information Use the Dynamic Data Exchange DDE
256. nel Enable this option if you want LabWindows CVI to close the function panel window after you execute the Insert Function Call command in the function panel window Check Foreground Lockout Setting on Startup Win2000 98only Windows 2000 and Windows 98 by default try to prevent applications from bringing themselves to the front This behavior prevents LabWindows CVI from bringing its windows to the front when debugging your programs Enable this option if you want LabWindows CVI to check on startup the system setting that prevents applications from bringing themselves to the front If you enable this option LabWindows CVI prompts you if the system settings will prevent LabWindows CVI windows from coming to the front Enable Data Tool Tips Enable this option if you want LabWindows CVI to display the value of variables and highlighted expressions when you place the mouse cursor over the variables or highlighted expressions in a Source window e Use Console Window for Standard I O When Debugging Enable this option if you want LabWindows CVI to use the Microsoft DOS console window for printing output stings and scanning input strings while you debug a project This option is enabled by default e Force Loaded Instrument Driver s Source into Interactive Window Enable this option if you run a function panel or interactive window code that loads the source file for an instrument driver that is currently loaded in the Instrument menu
257. nes Select Edit Toggle Exclusion if you want to include these lines Resolve All Excluded Lines The Resolve All Excluded Lines command interactively highlights the next excluded line or set of consecutive excluded lines and allows you to reinclude comment out conditionally compile out delete or skip the code Insert Construct The Insert Construct command has a submenu of various C programming constructs Use this command to insert a construct into your Source window at the current keyboard cursor position For most of these menu items a dialog box appears asking you to fill in portions of the construct You can press lt Enter gt or click on OK without filling in the controls When you insert the construct into your program the keyboard cursor moves to the first location in the construct where you can enter text LabWindows CVI User Manual 5 12 WWW ni com Chapter 5 Source and Interactive Execution Windows You can set the location of the curly brackets in the construct using the Options Bracket Styles command Balance Use the Balance command to find pairs of opening and closing curly braces brackets and parentheses If the cursor is within or near a set of any of these symbols when you select the Balance command LabWindows CVI highlights all characters between them This command is useful when you want to find a missing opening or closing symbol and a large number of these symbols are nested inside each other
258. nning Break on Library Errors When you enable this checkbox a breakpoint occurs when any function call to a LabWindows CVI library results in an error Break On First Chance Exceptions Enable this option if when an exception occurs in your program you want LabWindows CVI to suspend your programs before giving your program a chance to handle the exception Remove the checkmark from this option if you are debugging code that generates exceptions that are handled by the code itself Hide Windows When you enable this checkbox the LabWindows CVI environment hides all its windows until execution terminates or a breakpoint occurs Command Line Use the Command Line command to enter the command line arguments for your program When you run your program in the LabWindows CVI environment LabWindows CVI passes the command line arguments to your main function in the argc and argv parameters If your project makes a DLL you can pass command line arguments to an external program that you run to debug the DLL Specify the external program pathname and command line arguments using the Select External Process command in the Run menu The same command line arguments appear when you select the Command Line command from the Options menu Environment The Environment command invokes a dialog box you use to set the following options CVI Environment Sleep Policy Each time LabWindows CVI checks an event from the operating system it can put itse
259. ns you can specify that LabWindows CVI suspend execution conditionally without regard to a specific line of code LabWindows CVI User Manual 5 26 WWW ni com Chapter 5 Source and Interactive Execution Windows B Note Breakpoints and watch expressions apply only to source code modules You cannot set breakpoints in include files Breakpoint State When a program reaches a breakpoint LabWindows CVI positions the keyboard cursor at the next program statement to execute and outlines the statement You cannot edit the source code in the window while the breakpoint is in effect However you can use many other features of the LabWindows CVI environment For instance you can look at other windows change the state of breakpoints and modify the value of variables in the Variables Array Display and String Display windows Also if you are at a breakpoint in a Source window you can execute code in the Interactive Execution window or in a function panel To resume the execution after a breakpoint you have several options under the Run menu You can restart the project at a breakpoint by selecting Debug To halt the execution of a program at a breakpoint select Terminate Execution or press lt Ctrl F12 gt while a LabWindows CVI environment window is active Setting and Clearing Breakpoints You can set and clear breakpoints in the following ways e Ifyou select View Line Icons click the mouse in the line icon area next to a line of code to
260. nteractive BXecution nia Sie MAbs ae ate ree om bae eI 3 58 Open Source FBIles iore rete PREDA 3 58 Options Menu orb tr eH TREE EH tet ee tie Ra 3 59 Build Options onini eene ettet rrt pp repro Re tes 3 59 Compiler Defines n ence atm edet ei eee Ee beu 3 62 Incl de Patliss eiu ase E enced at eae UDIN REA 3 64 Instrument Durectortes eene nn ener nnns 3 64 Run Options ido ern ed Oe E E E e E ERES 3 65 Cornmand Ene ient e irte ete e e dae a avi atc ied tns 3 65 Bnvyironment S idees anite dete nus 3 65 Library Options ee E e m re b Reg 3 67 National Instruments Libraries sese sese eee 3 67 Usar PA Diaries noce next bec e rae p e ED a e ERR ERA GE 3 68 Tools Menu Options eet tds erre Oe 3 69 Source Code Control Options sese enne 3 71 LabWindows CVI User Manual viii www ni com Contents Project Move Options seed sha sub eve eer Torrey bees 3 72 CDe Cran sce cee te e numo ut nee eet eee ree 3 73 Colors ere ee EE 3 73 Help Mens EE 3 74 ODER ee ee rato a predio n e EAR IS 3 74 Search for Help Cnds teneur TRR E 3 74 bI 4310 ME 3 74 Tipofthe Day iiiter REOR REED GU aee 3 74 Web Tanks diede eei a aee cec disi haem OT S eie 3 74 About LabwWmndowsiCNt 3 74 Chapter 4 User Interface Editor Window User Interface Editor Overview sss eee 4 2 Using the Pop Up Menus of the User Interface Editor 4 3 CodeBuilder Overview ettet meet eer er ER EE E UE 4 3 File Menuiserie CRI e HEU ROT 4 4 New
261. nteractive Execution Window ccccccssccccecssssceccecsssceccecsessceseeceessececesenssesecesensaaeeeees 5 4 LabWindows CVI User Manual X www ni com Contents Using SubWIDdOWS T 5 5 Selecting Text in the Source and Interactive Execution Window sess 5 5 File M nUu eo reete teet Verde ee eU E ee EE Eet 5 7 NEW ivan REO rai Ud isch e erp ed rr abba or trece eere ets 5 8 LS 5 8 Open Quoted Text eie eene tee meg 5 8 DAVE God ge URINE Rd E t EE IER IA RU R eg 5 8 DAV GVAS pP 5 8 Save Cop AS iiit ie eO Pte icm eese bee IARE fetches 5 8 VE 5 8 Ge HPT 5 9 Add File to Project eu ees AER EE ege 5 9 Read RE 5 9 NEE 5 9 Most Recently Closed Ples 5 9 Exit hab Waindows CV L ices i ett etr hr FR FO EE EE Sa 5 9 Edit Menu EE 5 10 IS ET B REGO E 5 11 Cut and E ER 5 11 Paste a o ran E E EE E ROGER WR eaves 5 11 IST 5 11 Select ATL atit RUe Dh OT EE basis tiene nested 5 12 Clear Wan dO EE 5 12 Toggle Exclusion 2 onere rhet di ht a PR eges 5 12 Resolve All Excluded Lines enne nenne 5 12 Insert CODSEUUCL ether Ge REPRE Ue t dE Fee DO DEEP HO 5 12 Balance eR reete EE 5 13 Dif aito aee eem a eaa meme 5 13 Go To D finition c Are ata irt ete IR e ER SER et ees 5 14 Band egene grut eeh 5 14 EEN 5 17 Next TTT 5 18 View Men mE HN 5 18 lane Numbers on gue t ER H Tea Zara dTa Ta 5 19 ke Jg ite pue tee AE EE 5 19 TOOlDat z EE 5 19 EE 5 19 Beginning End of Selection
262. nterface Library QuitUserInterface function Unless you have selected the Code Preferences Always Append Code to End option LabWindows CVI places the skeleton code for each callback function at the cursor position in the target file If the cursor is inside an existing function LabWindows CVI repositions the cursor at the end of that function before inserting the new function CodeBuilder places all functions of one type panel callback control callback or menu callback together in the source file Any panel callbacks are placed first in the source file control callbacks are placed next and menu callbacks are placed last Refer to the Preferences section later in this chapter for more information on specifying the location of generated code Function skeletons for control and panel callbacks include the complete prototype the proper syntax a return value and a switch construct containing a case for each default control or panel event Function skeletons for menu callbacks include the complete prototype and open and close brackets You can set the default events by selecting Code Preferences Refer to the Preferences section later in this chapter for more details You can set the location of the open and close brackets by selecting Options Bracket Style in a Source window Use the Main Function command to generate code for the main function and write it to the target file Selecting Code Generate Main Function option opens the Generate Ma
263. nu 5 20 Clear Window command Edit menu 5 4 5 12 Close command File menu Array and String Display windows 8 6 Function Panel windows 6 8 User Interface Editor 4 5 Close All command Window menu 3 56 Close Variable command View menu 7 3 7 12 Closed Array Variables window figure 7 11 code See source files Code menu Function Panel windows 6 9 to 6 20 Add Watch Expression command 6 7 6 20 Clear Interactive Declarations command 6 11 Declare Variable command 6 5 6 7 6 10 to 6 11 illustration 6 9 Insert Function Call command 6 19 Run Function Panel command 6 10 Select Attribute Constant command 6 13 to 6 16 Select UIR Constant command 6 12 to 6 13 Select Variable command 6 17 to 6 18 Set Target File command 6 20 View Variable Value command 6 7 6 20 7 1 8 4 User Interface Editor Generate submenu 4 24 to 4 29 All Callbacks command 4 28 All Code command 4 25 to 4 26 www ni com Control Callbacks command 4 28 Generate All Code dialog box 4 25 illustration 4 24 Main Function command 4 26 to 4 27 Menu Callbacks command 4 28 to 4 29 Panel Callback command 4 28 to 4 29 illustration 4 23 Preferences command 4 30 to 4 31 Always Append Code to End option 4 31 Default Control Events option 4 30 Default Panel Events option 4 30 Set Target File command 4 23 to 4 24 View command 4 29 to 4 30 code modules adding to projects 3 8 listing in Project window 2 6 CodeBuilder S
264. nverted fp file to disk Unload When you select the Unload command a dialog box appears that contains a scrollable list of all the instruments you loaded with the Load menu From this dialog box you can select one or more instrument drivers to unload Edit You can use the Edit command to edit an instrument driver program in a Source window or an instrument driver function tree in a Function Tree Editor window When you select the Edit command the Edit Instrument dialog box shown in Figure 3 14 appears i Tektronix TDS300 Series ved vee 1 0 L somo Attach and Edit Source Detach Program Reattach Program Edit Function Tree Done Figure 3 14 Edit Instrument Dialog Box LabWindows CVI User Manual 3 40 www ni com Chapter 3 Project Window The dialog box displays instrument drivers you loaded as part of the project or through the Instrument menu The commands in the Edit Instrument dialog box are as follows e Show Info Opens the read only Instrument Driver Information dialog box as shown in Figure 3 15 cw Instrument Driver Information EN Instrument Name Fluke 45 Digital Multimeter VISA 1 0 Function Panel File c cviS0 instr fl45 fp Inthe Project Program File c Ncvib Ninstr f145 c Inthe Project M Compiled Figure 3 15 Instrument Driver Dialog Box Attach and Edit Source If a c file with the same base name as the selected fp file exists in the same directory as the
265. o 5 17 String Display window 8 8 Variables window 7 7 Watch window 7 10 Find dialog box Array Display window 8 7 Source and Interactive Execution windows 5 14 to 5 17 Variables window 7 8 to 7 9 Find Function Panel command View menu Function Panel windows 6 21 Source and Interactive Execution windows 5 22 National Instruments Corporation Index Find Next button Find UIR Objects dialog box 4 19 Find Next option Find command Source and Interactive Execution windows 5 17 Variable Display and Watch Windows 7 9 Find Prev button Find UIR Objects dialog box 4 19 Find Prev option Find command Source and Interactive Execution windows 5 17 Variable Display and Watch Windows 7 9 Find UI Objects command View menu 5 22 Find UIR Objects command View menu 4 18 to 4 19 Find UIR Objects dialog box Case Sensitive option 4 18 Edit button 4 19 Find button 4 19 Find Next button 4 19 Find Prev button 4 19 illustration 4 18 Regular Expression option 4 18 to 4 19 search criteria in Search By ring control 4 18 Stop button 4 19 Whole Word option 4 18 Wrap option 4 18 Find What text box option Find command 5 14 to 5 15 Finish Function command Run menu 5 30 First Function Panel Window command View menu 6 22 First Panel command View menu 6 2 Fixup pathnames when project is moved or CVI is in a Different Directory option 3 72 PLAT macro 3 63 Flatten option Select Function Panel dialog box
266. o erase the new tab order and restore the original tab order For each control the original tab order appears in dim display to the right of the new tab order you enter National Instruments Corporation 4 15 LabWindows CVI User Manual Chapter 4 User Interface Editor Window Set Default Font Select Edit Set Default Font to make the font of the currently selected control the default control font If the label is also selected or is the only item selected the font of the label becomes the default label font Newly created controls inherit the default fonts Apply Default Font Select Edit Apply Default Font to set the font of the currently selected control and or label to the default control font and or default label font Control Style Use the Control Style command to change the style of the selected control For example you can change a ring slide control to a ring knob control and the label value pairs remain intact Create Menu This section explains how to use the commands in the User Interface Editor window Create menu as shown in Figure 4 11 Use the Create menu to create panels menu bars and controls File Edi He Panel Menu Bar Numeric String Text Message Text Box Command Button Toggle Button LED Binary Switch Ring List Box Decoration Graph Picture Timer Canvas Table View Arange Code Run Library Tools Window Options Help LabWindows CVI User Manual
267. o invoke the Array Display window double click on an array variable or press lt F4 gt Refer to Chapter 8 Array and String Display Windows for more information String Display The String Display command invokes the String Display window for the currently highlighted string To invoke the String Display window double click on a string variable or press lt Shift F4 gt Refer to Chapter 8 Array and String Display Windows for more information Memory Display The Memory Display command displays the currently highlighted item in the memory display If the currently highlighted item is a pointer variable the memory pointed to by the pointer is displayed in the memory display If the currently highlighted item is not a pointer the address of the highlighted variable is displayed in the memory display LabWindows CVI User Manual 7 14 www ni com Chapter 7 Variables and Watch Windows Format Menu This section contains a detailed description of the Format menu for the Variables and Watch windows as shown in Figure 7 14 Elle Edit View Run Window Options Help v Decimal Hexadecimal Octal Binary ASCII Floating Point Scientific Preferences Figure 7 14 Format Menu Use the commands in the Format menu to choose the format the Variables window uses to display numbers You can change the format for an individual variable as well as the default formats for all variables The first five items in the menu specif
268. oad instrument drivers using the commands in the Instrument menu as shown in Figure 3 13 File Edi View Build Run Library Tools Window Options Help 1 Fluke 45 Digital Multimeter VISA 1 0 2 Tektronix TDS300 Series DSO VISA 1 0 Instrument Load Unload Edit Figure 3 13 Instrument Menu Load When you select the Load command a dialog box appears In the Instrument Load dialog box the filename fp appears in the File Name text box Always load instruments through the fp filename You cannot load an instrument driver unless a p file exists for it When you specify a fp file to load LabWindows CVI also looks in the same directory for a program file with the same base filename If it finds one it loads the instrument driver program along with the function panels For VXI plug amp play instrument drivers the program file can be in a different directory Refer to the Precedence Rules for Loading the Instrument Driver Program File section earlier in this chapter for more information on loading instrument drivers National Instruments Corporation 3 39 LabWindows CVI User Manual Chapter 3 Project Window File Format Conversion If the fp file you are loading was created using LabWindows for DOS a message appears indicating that LabWindows CVI is converting the p file to the current format You can use the dialog box that appears after the conversion to save the co
269. ode dialog box shown in Figure 4 20 This dialog box displays a checklist and prompts you to choose the panel or panels that the main function loads and displays at run time LabWindows CVI automatically assigns a default panel variable name for each panel in the uir file Generate All Code L SetAlarms Reset Shutdown Figure 4 20 Generate All Code Dialog Box The Generate All Code dialog box also prompts you to choose the callback function or functions that terminate the program For a CodeBuilder program to terminate successfully you must include a call to QuitUserInterface KI Note Callback functions associated with close controls are automatically checked in the Program Termination section of the Generate All Code dialog box You can define a control to be a close control in the Edit Panel dialog box by selecting Edit Panel National Instruments Corporation 4 25 LabWindows CVI User Manual Chapter 4 User Interface Editor Window To automatically generate all code select the panels you want to load and display in the user interface Also select the callback function or function you want to terminate the program and then click on OK When you choose Code Generate All Code LabWindows CVI produces the include statements the variable declarations the function skeletons and the main function and places them in the target file The callback functions you selected to terminate program execution include a call to the User I
270. og box contains a list of library files for you to include in your external compiler project The files are as follows q cviNextlibNcvirt lib N cviNextlibNcvisupp lib N cviNextlibNcviwmain lib Use cviwmain 1ib only when the external compiler requires you to define WinMain when you do not define it in your project and when any of the libraries the external compiler automatically links do not define it In general console applications do not require WinMain GUI application wizards sometimes automatically include it in the source code they generate Create Distribution Kit Use the Create Distribution Kit command to make a set of disks from which you can install your executable program on a target machine Create Distribution Kit automatically includes all the files necessary to run your executable program on a target computer except for DLLs for National Instruments hardware and files that you load using LoadExternalModule Do not include DLLs for National Instruments hardware in your distribution kit Users can install the DLLs for their hardware from the distribution disks that they obtain from National Instruments If you load files using LoadExternalModule you must include these files manually using the Add Edit Group features of the Create Distribution Kit command Refer to Chapter 4 Creating and Distributing Standalone Executables and DLLs of the LabWindows CVI Programmer Reference Manual LabWindows CVI User Manual 3 24
271. ol such as short long single precision double precision string and so on Otherwise a syntax error occurs when you execute the function Change Format Change Format lets you change the numeric format for scalar controls The list of formats depends on the data type associated with the control You can display short and long data types in decimal hexadecimal octal or ASCII form You can display real numbers in floating point or scientific format LabWindows CVI User Manual 6 24 www ni com Chapter 6 Using Function Panels Edit Function Panel Window The Edit Function Panel Window command puts the Function Panel window in edit mode Refer to Chapter 3 The Function Panel Editor in the LabWindows CVI Instrument Driver Developers Guide for information about editing instrument function panels Sy Note You cannot edit the function panels of the LabWindows CVI libraries or user libraries Help Menu The Help menu for Function Panel windows works the same way as the Help menu in the Project window except that it also includes Control and Function help Refer to the Help Menu section of Chapter 3 Project Window for information on the Help menu Control The Control command displays help information about the currently highlighted control To select control help with the mouse right click anywhere on the control you want help with Function The Function command displays general information about the function the current F
272. oller command LabWindows CVI displays the ActiveX Automation Controller Wizard Click on the Next button on the wizard s Welcome panel to view the wizard s Choose Server panel Choose Server Panel The Choose Server panel of the ActiveX Automation Controller Wizard has the following options e ActiveX Automation Server This list box contains the ActiveX Automation servers on the current machine LabWindows CVI extracts this list from the system Registry Select the ActiveX Automation Server for which you want to generate an instrument driver e Browse Use this button to browse for an ActiveX Automation server object library file on disk When you select an ActiveX Automation server from the Browse dialog box LabWindows CVI User Manual 3 48 WWW ni com Chapter 3 Project Window LabWindows CVI adds the server to the system Registry if it was not already there and adds the server to the ActiveX Automation Server list box Configure Panel The Configure panel of the ActiveX Automation Controller Wizard has the following options e Automation Server The Automation Server option displays the name of the ActiveX Automation Server you specified on the Choose Server panel Instrument Prefix This option is the instrument prefix for the generated ActiveX Automation Controller instrument driver You must either leave the control empty or enter a valid c identifier This string will prefix various source code identifiers in the
273. ommands in the Build menu for compiling files building and linking projects marking files for compilation and creating application files File Edit View EIER Dun Instrument Library Tools Window Options Help Configuration Create Debuggable Executable CM Target Type id Target Settings Compile File Ctrl K Mark File For Compilation Mark All For Compilation External Compiler Support Create Distribution Kit Figure 3 8 Build Menu Configuration The Configuration item opens a submenu in which you select the active configuration for your project Set the configuration to Debug when you are debugging your executable or DLL Set the configuration to Release when you are ready to build a release standalone version of your executable DLL or static library 3 Note You can set the names of the target executable DLL or library files for each configuration using the Target Settings menu item National Instruments Corporation 3 11 LabWindows CVI User Manual Chapter 3 Project Window When the Release item is checked in the Configuration submenu source modules execute faster but you sacrifice the ability to set breakpoints or to use the Variables window Also you have no protection from run time memory errors such as using bad pointers over indexing arrays passing incorrect array sizes and so on Selecting Release from the Configuration submenu changes the Create command to Create Rele
274. on 4 8 Menu Callbacks command Generate menu 4 28 to 4 29 Microsoft Visual Basic generating include file for 5 39 Minimize All command Window menu 3 56 Modifier Key field Edit Menu Bar dialog box 4 10 Move Backward option Control ZPlane Order command 4 22 Move Cursor to the End of Pasted Text option Editor Preferences command 5 36 National Instruments Corporation 1 19 Index Move Forward option Control ZPlane Order command 4 22 Move Item Down command Edit menu 3 10 Move Item Up command Edit menu 3 9 Move to Back option Control ZPlane Order command 4 22 Move to Front option Control ZPlane Order command 4 22 multi dimensional arrays illustration 8 3 Reset Indices dialog box 8 3 to 8 4 specifying dimensions 8 3 to 8 4 multi dimensional string array 8 4 to 8 5 Multiple Files option Find command 5 16 Name option Find command 7 8 National Instruments libraries See standard libraries specific libraries National Instruments Web support B 1 to B 2 New command File menu Array and String Display windows 8 5 Function Panel windows 6 8 Project window 3 5 Source and Interactive Execution windows 5 8 User Interface Editor 4 4 Variables and Watch windows 7 6 New Window option Select Function Panel dialog box 3 42 newproject option table 1 2 Next Build Error command View menu 5 25 Next File command Edit menu 5 18 Next Function Panel command View menu 6 22 Next Function Panel Win
275. on in the Options Menu section of Chapter 3 Project Window for more information about compiler options Create Debuggable Executable This command performs the same action as the Create Debuggable Executable command in the Project window Build menu Refer to the Build Menu section in Chapter 3 Project Window for information on this command National Instruments Corporation 5 23 LabWindows CVI User Manual Chapter 5 Source and Interactive Execution Windows Create Debuggable Dynamic Link Library This command performs the same action as the Create Debuggable Dynamic Link Library command in the Project window Build menu Refer to the Build Menu section in Chapter 3 Project Window for information on this command Create Release Executable This command performs the same action as the Create Release Executable command in the Project window Build menu Refer to the Build Menu section in Chapter 3 Project Window for information on this command Create Release Dynamic Link Library This command performs the same action as the Create Release Dynamic Link Library command in the Project window Build menu Refer to the Build Menu section in Chapter 3 Project Window for information on this command Create Static Library This command performs the same action as the Create Static Library command in the Project window Build menu Refer to the Build Menu section in Chapter 3 Project Window for information on this command Mark File f
276. onal breakpoints 5 27 to 5 28 Configuration command submenu Build menu 3 11 to 3 13 Create Debuggable Dynamic Link Library 3 13 Create Debuggable Executable 3 13 Create Release Dynamic Link Library command 3 12 LabWindows CVI User Manual Index Create Release Executable command 3 12 Create Static Library command 3 12 to 3 13 Debug option 3 11 Release option 3 11 to 3 12 configuration options cvidir 1 3 to 1 4 setting 1 2 to 1 3 string value for Windows Registry figure 1 3 tmpdir 1 4 Configure panel ActiveX Automation Controller Wizard Automation Server 3 49 Call Mechanism 3 49 Generate Per Object Property Access Functions 3 49 Instrument Prefix 3 49 Target fp File 3 49 console application creating 3 14 to 3 15 Constant Name Assignment section User Interface Editor Preferences dialog box 4 35 to 4 36 Constant Name field Edit Control dialog box 4 13 Edit Menu Bar dialog box 4 10 Edit Panel dialog box 4 11 constants assigning names 4 36 selecting user interface constants 6 12 to 6 13 Contents command Help menu 3 74 context menus Source window 5 3 Continue command Run menu Project window 3 34 Source and Interactive Execution windows 5 29 Control Appearance section Edit Label Value Pairs dialog box 4 14 LabWindows CVI User Manual l 6 Control Callbacks command Generate menu 4 28 Control command Edit menu 4 12 to 4 15 Help menu 6 25 Control Coordinates command Arrange menu
277. ons menu 5 37 to 5 38 system colors selecting for panels 4 34 system libraries 3 48 T Tab Length option Editor Preferences command 5 36 Tab Order command Edit menu 4 15 National Instruments Corporation 1 27 Index Tag Scope command View menu 5 20 tagged lines Clear Tags command 5 20 Next Tag command 5 19 Previous Tag command 5 20 Tag Scope command 5 20 Toggle Tag command 5 19 Target Settings command Build menu 3 14 Target Settings dialog box 3 14 to 3 21 Target Type Dynamic Link Library DLL file 3 17 Exports 3 20 Import Library Base Name 3 17 Import Library Choices button 3 19 Instrument Driver Support Only 3 17 to 3 18 Type Library 3 19 Using LoadExternalModule 3 19 Version Info 3 18 Where to Copy DLL 3 17 Target Type Executable Application file 3 14 Application Icon File 3 14 Application Title 3 14 Create Console Application 3 14 to 3 15 Icon 3 14 Instrument Driver Support Only 3 15 to 3 16 Using LoadExternalModule 3 16 to 3 17 Version Info 3 16 Target Type Static Library Library File 3 20 Library Generation Choices 3 20 to 3 21 Target Type command Build menu 3 14 TCP command Library menu 3 46 TCP Library 3 46 technical support resources B 1 to B 2 LabWindows CVI User Manual Index Terminate Execution command Run menu Project window 3 34 Source and Interactive Execution windows 5 30 text selecting Character Select mode 5 6 Column Select mode 5 7 Line
278. ontains the tag associated with the currently selected object LabWindows CVI adds this tag to the method and property tags to create the method function and property constant names This string must contain only valid c identifier characters Object Description This list box is a description of the currently selected object Some ActiveX Automation servers do not provide this description Method Names Too Long This list box contains the number of methods of the currently selected object with generated function names that are longer than 79 characters LabWindows CVI constructs a method function name by appending the Method Tag to the Object Tag You can reduce the length of a method function name by editing the Object Tag or Method Tag Property Names Too Long This list box contains the number of properties of the currently selected object with generated constant names that are longer than 79 characters LabWindows CVI constructs a property constant name by appending the Property Tag to the Object Tag You can reduce the length of a property constant name by editing the Object Tag or Property Tag Methods Properties Menu Ring Use this ring control to display the methods or properties of the selected object The ring control setting determines whether the list box below the ring control displays method or property names This ring setting also changes the other options displayed in the dialog box Methods of Object This box contain
279. open window to the front for viewing or editing File Edit View Build Run Instrument Library Tools MSS Options Help Cascade Windows Tile Windows Minimize All Close All v Project Build Errors Bun Time Errors Source Code Control Errors Memory Display Variables Watch Interactive Execution Figure 3 21 Window Menu National Instruments Corporation 3 55 LabWindows CVI User Manual Chapter 3 Project Window Cascade Windows Use this command to arrange all open windows so that each title bar is visible Tile Windows Use this command to arrange all open windows in smaller sizes to fit next to each other Minimize All The Minimize All command hides all the LabWindows CVI windows including the Project window and any User Interface Library panels displayed by a program you are currently executing You can restore the windows by clicking on LabWindows CVI in the Windows task bar Close All The Close All command closes all the LabWindows CVI windows excluding the Project window and any User Interface Library panels displayed by a program you are currently executing Project Use this command to bring the Project window to the front Build Errors If you attempt to build a project and the project has build errors such as syntax or link errors the Build Errors window contains a list of the errors To bring the Build Errors window to the front for viewing select Window Build Errors in the Project wi
280. opy a control it replaces the previous contents of the Clipboard To use the Cut or Copy commands follow these steps 1 Select the control you want to place on the Clipboard by clicking on the control or pressing lt Tab gt until the control is highlighted Select multiple controls by dragging the mouse over the controls You also can press lt Shift Click gt to select multiple controls 2 Select Cut or Copy from the Edit menu The Paste command inserts controls panels or text from the Clipboard You can Paste an object from the Clipboard as many times as you like Controls or panels remain on the Clipboard until you use Cut Cut Panel Copy or Copy Panel again The New and Open commands do not erase the Clipboard Delete The Delete command deletes selected controls without placing the controls on the Clipboard Because Delete does not place controls on the Clipboard you cannot restore deleted controls using the Paste command Copy Panel and Cut Panel The Copy Panel and Cut Panel commands put an entire panel on the Clipboard The Copy Panel command copies the selected panel and places it on the Clipboard leaving the selected panel in its original location The Cut Panel command removes the selected panel and places it on the Clipboard Panels you cut or copy do not accumulate on the Clipboard Every time you cut or copy a panel it replaces the previous contents of the Clipboard To use the Copy Panel or Cut Panel commands foll
281. or Compilation When LabWindows CVI marks a source file for compilation a C appears next to the filename in the Project window LabWindows CVI recompiles marked files the next time you build the project When you modify a source file LabWindows CVI automatically marks the file for compilation You can force LabWindows CVI to compile a source file on the next build by selecting the Mark File for Compilation command Clear Interactive Declarations Variables you declare in the Interactive Execution window remain in effect until you explicitly remove them This feature lets you use these variables in succeeding executions of the Interactive Execution window It also enables different function panels to access the same variables When you delete the entire contents of the Interactive Execution window by selecting Edit Clear Window LabWindows CVI removes the variables If you want to remove the variables without deleting the contents of the Interactive Execution window use the Clear Interactive Declarations command LabWindows CVI User Manual 5 24 www ni com Chapter 5 Source and Interactive Execution Windows Insert Include Statements The Insert Include Statements command invokes a dialog box you can use to select one or more header files to include at the top of the program Add Missing Includes If when you last attempted to compile the source file the compiler reported that function prototypes were missing Add Missing Includes can f
282. or numeric and ring slides knobs dials meters and Figure 6 8 Select Attribute Value Dialog Box When the values that appear in the Values list box are constant names the actual values appear on the right hand side of the list box If the Attribute Value control is an input control such as on Set CtrlAttribute or SetPanelAttribute double click on an entry in the Values list to copy it into the Attribute Value control on the function panel If the Attribute Value control is an output control such as on Get CtrlAttribute or GetPanelAttribute and a value appears in the bottom half of the control because you executed the function panel LabWindows CVI selects when possible the value in the Values list that corresponds to the value shown in the bottom half of the output control An arrow symbol appears to the left of the list box entry that contains that value LabWindows CVI User Manual 6 16 www ni com Chapter 6 Using Function Panels Select Variable The Select Variable command gives you a list of previously used variables or expressions that have data types that are compatible with the currently active function panel control LabWindows CVI enables the command only when the currently active function panel control is one that accepts text entry When you select a variable or expression from the list LabWindows CVI copies it into the function panel control The Select Variable command can significantly reduce the amount of
283. ou enter the pathname and command line arguments to an external program The Run Project item in the Run menu then changes to Debug xxx exe where xxx exe is the filename of the external program When you execute the Debug xxx exe command LabWindows CVI starts the external process and attaches to it for debugging If you have set any breakpoints in the source files for the DLL LabWindows CVI honors them LabWindows CVI stores external program pathname and command line arguments in the project LabWindows CVI User Manual 3 34 www ni com Chapter 3 Project Window Execute The Execute command launches the executable for the active configuration without attaching the debugger to the executable You must create the executable using the Create menu item in the Build menu before you use this command This command is dimmed if the Target Type for the project is DLL or Static Library Threads The Threads command brings up a dialog box listing the threads in the program being debugged Use this dialog box to select the threads whose local variables and call stack you want to view When you select a thread from this dialog box and click on OK to close the dialog box LabWindows CVI displays the local variables for the selected thread in the variable display and displays the current source position of the thread in a Source window The Stack Trace Up Call Stack and Down Call Stack commands in the Source windows Run menu display information on the cu
284. ource Code Control submenu 3 54 Add Files to Executable button Target Settings dialog box 3 16 Add FP File to Project command File menu 6 8 Add Missing Includes command Build menu 5 25 Add Program File to Project command File menu 6 9 Add Watch Expression command Code menu 6 7 6 20 Edit menu 7 10 Options menu 7 4 7 17 Run menu 5 32 Add Edit Tools Menu Item dialog box 3 70 Add Edit Watch Expression dialog box 7 4 to 7 5 Advanced Analysis command Library menu 3 44 Align Horizontal Centers command Arrange menu 4 21 Alignment command Arrange menu 4 21 All Callbacks command Generate menu 4 28 National Instruments Corporation All Code command Generate submenu actions produced by 4 26 opening Generate All Code dialog box 4 25 All Files command Add Files to Project dialog box 3 9 Alphabetize option Select Function Panel dialog box 3 42 Always Append Code to End option Preferences command 4 31 Analysis command Library menu 3 44 Analysis Library 3 44 ANSI C command Library menu 3 47 ANSI C Library display External Compiler support dialog box 3 23 ANSI C Library 3 47 Application File option Target Settings dialog box 3 14 Application Icon File option Target Settings dialog box 3 14 Application Title option Target Settings dialog box 3 14 applications creating 2 5 to 2 6 Apply Default Font command Edit menu 4 16 Arrange menu User Interface Editor Align Horizontal Centers command
285. ow these steps 1 Select the panel you want to place on the Clipboard by clicking on the panel or pressing lt Shift Ctrl gt and the left or right arrow key until the panel is highlighted 2 Select Edit Copy Panel or Cut Panel National Instruments Corporation 4 7 LabWindows CVI User Manual Chapter 4 User Interface Editor Window Menu Bars The Menu Bars command opens the Menu Bar List dialog box as shown in Figure 4 5 cw Bar List Figure 4 5 Menu Bar List Dialog Box The list contains all of the menu bars in the resource file listed by constant prefix The Menu Bar List dialog box has the following options Create Opens a new Edit Menu Bar dialog box as seen in Figure 4 6 After you create a menu bar it appears below the currently selected menu bar in the menu bar list Edit Opens the Edit Menu Bar dialog box as seen in Figure 4 6 for the selected menu bar Cut Deletes the currently highlighted item in the menu bar list and copies it to the menu bar Clipboard Copy Copies the currently highlighted item in the menu bar list to the menu bar Clipboard Paste Inserts the contents of the menu bar Clipboard to the menu bar list When you use the Paste button the menu bar is inserted above the currently highlighted item in the menu bar list Done Closes the Menu Bar List dialog box LabWindows CVI User Manual 4 8 www ni com Chapter 4 User Interface Editor Window The Edit Menu Bar dialog
286. oxes controls graphs and strip charts and save them to User Interface Resource uir files Chapter 4 User Interface Editor Window describes the User Interface Editor window in detail e Source windows You use these windows to create edit run debug and save source code These windows include an optional toolbar to give you quick access to commands you use frequently Chapter 5 Source and Interactive Execution Windows describes the Source window in detail e Interactive Execution window You use this window to execute selected portions of code You do not have to have a complete program in the Interactive Execution window as is the case in a Source window For instance you can execute variable declarations and assignment statements in C without declaring a main function Refer to Chapter 5 Source and Interactive Execution Windows for more information on the Interactive Execution window LabWindows CVI User Manual 2 4 WWW ni com Chapter 2 LabWindows CVI Overview e Function Panels You use these windows to interactively execute library functions and insert code into the Source window These windows include an optional toolbar to give you quick access to commands you use frequently Chapter 6 Using Function Panels describes the Function Panel window in detail e Variables Array Display String Display and Watch windows You use these windows for debugging programs Chapter 7 Variables and Watch Windows and Chapter 8 A
287. panel in pixels Width Sets the barrier for the width of the panel in pixels Scroll Bars Enables or disables scroll bars on the panel Auto Center Vertically when loaded Automatically centers the panel in the vertical center of your monitor Auto Center Horizontally when loaded A utomatically centers the panel in the horizontal center of your monitor Other Attributes Sets behavior and feature attributes of the panel Refer to the panel attributes discussion in the LabWindows CVI Online Help for more details e From the Quick Edit Window you can perform high level edits on the panel The tools in the toolbar operate like the tools in the main User Interface Editor window Refer to the User Interface Editor Overview section earlier in this chapter for more information The Attributes for Child Panels section of the Edit Panel dialog box has the following options Control Frame Style Sets the styles of the frame in the Child Panel Frame Thickness Sets the frame thickness in the Child Panel Title Bar Thickness Sets the title bar thickness in the Child Panel Size Title Bar Height to Font Sets the size of the title bar to match the height of the font in the title bar Title Style Sets the style of the title in the Child Panel The Control command opens a dialog box where you can edit a control you have selected You also can double click on a control to open this dialog box The dialog box can have va
288. pe of error and the location in the program where the error occurred LabWindows CVI lists the error in the Run Time Errors window LabWindows CVI then suspends the program so you can inspect the values of variables in the Variables window To terminate a program that has been suspended because of a run time error select the Terminate Execution command or press lt Ctrl F12 gt while a LabWindows CVI Environment window is active Continue Use the Continue command to resume program execution when in a breakpoint state Terminate Execution Use the Terminate Execution command to terminate a program that is in a breakpoint state Break at First Statement Select Break at First Statement to force LabWindows CVI to break a program on the first executable statement When activated this command has a checkmark beside it in the menu Breakpoints The Breakpoints command opens the Breakpoints dialog box that contains a list of the breakpoints in the project You can add delete or edit project breakpoints from this dialog box For a complete description of this command refer to the Run Menu section of Chapter 5 Source and Interactive Execution Windows Select External Process This command applies only when you set the Target Type item in the Build menu to Dynamic Link Library The Select External Process command allows you to specify a standalone executable that uses your DLL When you execute the command a dialog box appears in which y
289. placing the cursor on or immediately after the function name LabWindows CVI User Manual 5 20 WWW ni com Chapter 5 Source and Interactive Execution Windows After you indicate the function call select the View Recall Function Panel The function panel for that function appears and the controls contain the parameter values from the call Recalling a Function Panel from a Function Name Only You can recall a panel from a function name without specifying any of the parameters If you place the keyboard cursor on or immediately after a function name Recall Function Panel recognizes the function name even if a parameter list does not follow it Thus you can simply type a function name into the Source window and execute Recall Function Panel Also you can use the Find Function Panel command to open a function panel from a function name or a portion of a function name Refer to the Find Function Panel section later in this chapter for more information Multiple Panels for One Function If the selected function appears in more than one function panel window LabWindows CVI displays a list of panels Select one by highlighting the panel name and pressing lt Enter gt or by double clicking on the panel name Multiple Functions in One Function Panel Window If the selected function matches a function panel window that contains multiple function panels LabWindows CVI attempts to match the panel to function calls on the lines surrounding the sel
290. processing in the DLL import library LabWindows CVI never requires such special processing LabWindows CVI enables the Generate DLL Import Source command only when you have an include file in the Source window The include file must contain declarations of all the DLL functions you want to access When you execute the command a dialog box appears in which you enter the pathname of the DLL The Generate DLL Import Source command generates the import library source into a new Source window You can modify the code including making calls to functions in other source files Create a new project that contains the source file and any other files it references Select Build Target Type Static Library in the Project window Execute the Create Static Library command LabWindows CVI User Manual 5 38 WWW ni com Chapter 5 Source and Interactive Execution Windows B Note You cannot export variables from a DLL using the import library source code this command generates When you want to export a variable create functions to get and set its value or create a function to return a pointer to the variable Note When you edit the source code this command generates you cannot use the import qualifier in the function declarations in the DLL include file eo Note The import source code does not operate in the same way as a normal DLL import library When you link a normal DLL import library into an executable the operating system attempts to load the
291. project LabWindows CVI automatically updates the source file You must call the InitCVIRTE function at the beginning of your main WinMain or DLLmain function so that LabWindows CVI run time libraries can initialize the list of names from the source file If you create a DLL and any of your callback functions are defined in but not exported by the DLL you must call LoadPanelEx or LoadMenuBarEx rather than LoadPanel or LoadMenuBar from the DLL LabWindows CVI User Manual 3 22 www ni com Chapter 3 Project Window Using LoadExternalModule to Load Object and Static Library Files This option enables the section of the dialog box that you use when creating an executable or DLL that calls the Utility Library LoadExternalModule function to load object or static library files hy Note This option is not necessary if you use LoadExternalModule to load only DLLs that you load through DLL import libraries Unlike DLLs object and static libraries can contain unresolved external references When you use LoadExternalModule to load an object or static library file LabWindows CVI resolves these references using symbols in your executable or DLL or in previously loaded external modules Consequently the names of the symbols in your executable or DLL that are necessary to resolve these references must be available to the LoadExternalModule function e CVILibraries This display provides information LoadExternalModule require
292. purpose and use 2 5 7 4 selecting variables and expressions 7 4 to 7 5 View menu 7 11 to 7 14 Window menu 7 16 Web Links command Help menu 3 74 Web support from National Instruments B 1 to B 2 online problem solving and diagnostic resources B 1 software related resources B 2 Where to Copy DLL Target Settings dialog box 3 17 Whole Word option Find command Source and Interactive Execution windows 5 15 Variables window 7 8 Find UIR Objects dialog box 4 18 WIN32 macro 3 63 WIN32 macro 3 63 WIN32 macro 3 63 Window menu Array Display window 3 57 8 9 Function Panel windows 3 58 6 23 Help Editor windows 3 58 LabWindows CVI User Manual 1 32 Project window Build Errors command 3 56 Cascade Windows command 3 56 Close All command 3 56 Debug Output 3 56 Function Tree files 3 58 illustration 3 55 Interactive Execution command 3 58 Memory Display command 3 57 Minimize All command 3 56 open source files 3 58 Project command 3 56 Run Time Errors command 3 56 Source Code Control Errors window 3 57 Tile Windows command 3 56 User Interface Resource files 3 58 Variables command 3 57 Watch command 3 57 Source and Interactive Execution windows 5 35 String Display window 3 57 8 9 User Interface Editor 4 32 Variables window 7 1 7 16 Watch window 7 4 7 16 windows hiding 3 65 Windows DLLs See DLLs _WINDOWS macro 3 63 Windows SDK command Help menu 3 74 WinMain using instead of main
293. r CVI DataSocket National Instruments and ni com are trademarks of National Instruments Corporation Product and company names mentioned herein are trademarks or trade names of their respective companies Patents The product described in this manual may be protected by one or more U S patents U S Patent No 5 583 988 WARNING REGARDING USE OF NATIONAL INSTRUMENTS PRODUCTS D NATIONAL INSTRUMENTS PRODUCTS ARE NOT DESIGNED WITH COMPONENTS AND TESTING FOR A LEVEL OF RELIABILITY SUITABLE FOR USE IN OR IN CONNECTION WITH SURGICAL IMPLANTS OR AS CRITICAL COMPONENTS IN ANY LIFE SUPPORT SYSTEMS WHOSE FAILURE TO PERFORM CAN REASONABLY BE EXPECTED TO CAUSE SIGNIFICANT INJURY TO A HUMAN 2 IN ANY APPLICATION INCLUDING THE ABOVE RELIABILITY OF OPERATION OF THE SOFTWARE PRODUCTS CAN BE IMPAIRED BY ADVERSE FACTORS INCLUDING BUT NOT LIMITED TO FLUCTUATIONS IN ELECTRICAL POWER SUPPLY COMPUTER HARDWARE MALFUNCTIONS COMPUTER OPERATING SYSTEM SOFTWARE FITNESS FITNESS OF COMPILERS AND DEVELOPMENT SOFTWARE USED TO DEVELOP AN APPLICATION INSTALLATION ERRORS SOFTWARE AND HARDWARE COMPATIBILITY PROBLEMS MALFUNCTIONS OR FAILURES OF ELECTRONIC MONITORING OR CONTROL DEVICES TRANSIENT FAILURES OF ELECTRONIC SYSTEMS HARDWARE AND OR SOFTWARE UNANTICIPATED USES OR MISUSES OR ERRORS ON THE PART OF THE USER OR APPLICATIONS DESIGNER ADVERSE FACTORS SUCH AS THESE ARE HEREAFTER COLLECTIVELY TERMED SYSTEM FAILURES ANY APPLICATION WHERE A
294. r main program You also can use the Interactive Execution window to execute functions exported by a loaded instrument or by a file in the project if the project has been linked The Interactive Execution window can access functions and data declared as global in a Source window but a Source window cannot access the functions and data declared in the Interactive Execution window Refer to the Interactive Execution Window section earlier in this chapter for the rules governing code execution in the Interactive Execution window LabWindows CVI does not disturb asynchronous I O RS 232 ports opened files and User Interface Library resources you use in the Interactive Execution window at the beginning or end of execution in the Interactive Execution window LabWindows CVI terminates closes or deletes these program elements only when one of the following events occur s You select Build Clear Interactive Declarations s You select Edit Clear Window LabWindows CVI User Manual 5 28 www ni com Chapter 5 Source and Interactive Execution Windows e You link a project e YOU run a project Run Time Error Reporting LabWindows CVI reports various run time errors during the execution of a program One example of a run time error is a call to a LabWindows CVI library function with an array or string that is too small to hold the output data When such errors occur a dialog box appears identifying the type of error and the location in the fil
295. ready contains a syntactically correct variable name it appears in the Variable Name text box when the Declare Variable dialog box first appears Clear Interactive Declarations Variables declared in the Interactive Execution window remain in effect until you explicitly remove them Because of this feature you can use these same variables in succeeding executions of the Interactive Execution window and different function panels can access the same variables The Clear Interactive Declarations command removes the variables without deleting the contents of the Interactive Execution window National Instruments Corporation 6 11 LabWindows CVI User Manual Chapter 6 Using Function Panels Select UIR Constant The Select UIR Constant command can help you use the function panels for the User Interface Library The command lets you select from the list of constant names associated with the objects in your uir files When you specify a parameter for an input control that can accept a panel resource ID control ID menu bar resource ID menu ID or menu item ID use Select UIR Constant to open the Select UIR Constant dialog box as shown in Figure 6 6 Constant Type C Controls Figure 6 6 Select UIR Constant Dialog Box The list box at the top of the dialog box lists all the uir files open or in the project Only constants from the currently selected uir file appear in the list box at the bottom Click on a file to sel
296. rface file to an object callback function whether the source file is open or closed When you are finished reviewing the code you can return instantly to the uir file from the source file To return to the uir file place the cursor on the callback function name or constant name of the User Interface object you want to go to and select the Find UI Object command from the View menu in the Source window Ei Note You cannot use the View command for menu callback functions Preferences Use the Preferences command to change the default settings of case statements generated for control callback functions and panel callback functions or to specify the target file location for generated code Figure 4 24 shows the Preferences menu File Edit Create View Arrange GER Run Library Tools Window Options Help Set Target File Generate View Preferences Default Panel Events Default Control Events v Always Append Code to End Figure 4 24 Preferences Menu Use the Default Panel Events or Default Control Events commands to select which events LabWindows CVI places into the switch construct of the code for panel or control callback functions respectively You can choose from several events and you can choose to Add Default Switch Case Selecting Code Preferences Default Panel Events opens the Panel Callback Events dialog box Selecting Code Preferences Default Control Events opens the Control Ca
297. ria to establish the number of lines that must match to mark the end of differing sections in a file Select Ignore White Space to compare files while ignoring spaces tabs or other text control characters Use Recompare Ignoring White Space once a difference has been found to determine if the only difference in the selections involves white space characters Definition When you place the text cursor on a C identifier and select Go To Definition LabWindows CVI highlights the definition of the identifier If the definition is not available for example a LabWindows CVI library function definition LabWindows CVI highlights the declaration of the identifier Use the Find command to locate particular text in your program When you select the Find command the Find dialog box opens as shown in Figure 5 8 Find Prev M Case Sensitive Multiple Files Whole Word Selected Text Only Cancel Regular Expression Iv Wrap I Button Bar Figure 5 8 Find Dialog Box Enter the text you want to find in the Find What text box If you select text on a single line before you execute the Find command the selected text appears in the Find What text box Otherwise the text you last searched for appears in the box You can access a history of LabWindows CVI User Manual 5 14 WWW ni com Chapter 5 Source and Interactive Execution Windows selections for the Find What text box by clicking the mouse on the arrow to the right of
298. rious sections including Source Code Connection Control Settings Control Appearance Quick Edit Window and Label Appearance The sections available in the LabWindows CVI User Manual 4 12 WWW ni com Chapter 4 User Interface Editor Window dialog box for a selected control vary slightly depending on the type of control that you are editing Figure 4 8 is an example of an edit control dialog box for a numeric knob control Edit Numeric Knob UPPER EZ Figure 4 8 Sample Edit Numeric Knob Control Dialog Box e The Source Code Connection section of the edit control dialog box has the following options Constant Name The User Interface Editor appends the constant name to the panel resource ID to form the ID for the control The ID identifies the control in any control specific functions such as GetCtr1Valand SetCtrlAttribute The ID is defined in the n file that LabWindows CVI generates when you save the uir file If you do not assign a constant name the User Interface Editor assigns one for you when you save the uir file Callback Function In this box you can type the name of the function to be called when an event is generated on the control Naming a callback function is optional The Control Settings section of the Edit control dialog box displays specific attributes for the type of control that you are editing It contains the data specific attributes for the control National Instruments Corporation 4
299. rive as your target path LabWindows CVI determines the media size automatically and makes this control inactive National Instruments Corporation 3 25 LabWindows CVI User Manual Project Window kBytes Reserved on First Disk Allows you to reserve space on the first disk of your distribution kit for extra files Installation Language The language that the installation program uses for text during the installation Install Run Time Engine This ring control lets you include the LabWindows CVI Run time Engine and associated files in your distribution kit If you know that the Run time Engine is already on the target machine or if you want to copy and distribute the Run time Engine separately you do not have to include the Run time Engine files in your distribution kit If you choose Install in Windows System Directory the run time engine files are installed into the Windows system directory If you choose Install in Application Directory the run time engine files including cvirt dll and cvirte dll are installed in the same directory as your application The low level support driver files cannot be installed in the same directory as your application Install Low Level Support Driver tThis option lets you choose whether to install the LabWindows CVI low level support driver on the user s computer The Utility Library functions shown in Table 3 1 require the LabWindows CVI low level driver Install DataSocket Support IT you set
300. rmation about breakpoints refer to the Introduction to Breakpoints and Watch Expressions section in Chapter 5 Source and Interactive Execution Windows File Edit View Build SI Instrument Library Tools Window Options Help Debug buildui_dbg exe Shift F5 Continue F5 Terminate Execution Ctrl F12 Break at First Statement Breakpoints Shift F9 Select External Process Execute buildui_dbg exe CER Threads Figure 3 12 Run Menu Debug If you have an executable project loaded the Debug command runs the project s target executable for the currently selected configuration You set the active configuration using the Configuration submenu in the Build menu If you have a DLL project loaded the Debug command runs the executable specified by the External Process command Before LabWindows CVI runs the executable it compiles any source files that need to be compiled and builds the project s target executable or DLL if you have made changes since the target DLL or executable was last built Run Time Error Reporting During the execution of a program LabWindows CVI can report various run time errors One example of a run time error is a call to a LabWindows CVI library function in which an array or string is not large enough to hold the output data National Instruments Corporation 3 33 LabWindows CVI User Manual Chapter 3 Project Window When such errors occur a dialog box appears identifying the ty
301. rray and String Display Windows describe these windows in detail s Function Tree Editor windows You use these windows to build the tree structure of function panel files Refer to the LabWindows CVI Instrument Driver Developers Guide for more information on Function Tree Editor windows e Function Panel Editor windows You use these windows to build function panels These windows include an optional toolbar to give you quick access to commands you use frequently Refer to the LabWindows CVI Instrument Driver Developers Guide for more information on Function Panel Editor windows e Function Tree Help Editor and Function Panel Help Editor windows You use these windows to add online help to function panels Refer to the LabWindows CVI Instrument Driver Developers Guide for more information on these windows You develop applications in the LabWindows CVI environment using the ANSI C programming language For information on the LabWindows CVI compiler linker and how to use the LabWindows CVI libraries with other compilers and linkers refer to Chapter 3 Compiler Linker Issues in the LabWindows CVI Programmer Reference Manual How to Create Applications with LabWindows CVI Use LabWindows CVI as a text editor in which to enter your entire program You can greatly simplify application development by using function panels to execute LabWindows CVI functions and to automatically insert the code into your program Function panels contain compl
302. rrently selected thread The watch display shows the thread specific values of the expressions in the Watch window Using Instrument Drivers This section presents a general overview of instrument drivers Refer to the LabWindows CVI Instrument Driver Developers Guide for more information on creating instrument drivers An instrument driver is a set of high level functions with graphical function panels that make programming easier It encapsulates many low level operations such as data formatting and communication with GPIB RS 232 and VXI into intuitive high level functions An instrument driver usually controls a physical instrument but it also can be a software utility Instrument driver programs have an associated include file that declares the high level functions you can call the global variables you can access and the defined constants you can use Instrument Driver Files A LabWindows CVI instrument driver typically consists of the following three or four files Each file has the same base filename which is an abbreviation of the actual instrument name The instrument driver files must reside in the same directory on your disk or they must be in the appropriate VXIplug amp play directories e The function panels are in a file with the extension p Refer to Chapter 6 Using Function Panels for a detailed description of function panels s For instrument drivers that use an attribute model such as IVI drivers there
303. s typedef int typeA typedef int typeB typedef typeB typeC A variable of type t ypeA is an exact match for a function panel control that has type typec LabWindows CVI User Manual 6 18 WWW ni com Chapter 6 Using Function Panels e LabWindows CVI considers all numeric types compatible with each other except that floating point variables or expressions are not considered compatible with integer function panel controls e LabWindows CVI considers types that have the same base type but differ in levels of indirection to be compatible For example the following are all compatible int int ine S int To be included in the list box an expression or a variable name the compiler does not know must match exactly the data type of the function panel control An example of a variable name not known to the compiler is one used in a function panel from which you insert code into a Source window hy Note An expression or variable name the compiler does not know can be associated with multiple data types For instance you might use the same variable name in an int control and a double control If the variable is not known to the compiler LabWindows CVI has no way of knowing the true data type of the variable name Thus you might see the variable name associated with different data types Sorting List Box Entries LabWindows CVI first sorts the entries in the list box by data type The most compatible data types appear first The ex
304. s refer to Chapter 3 Compiler Linker Issues of the LabWindows CVI Programmer Reference Manual When you set the Target Type to Static Library and select Build Target Settings the Target Settings dialog box has the following options Library File The name of the static library files for the debug and release versions of your program Changing the value of the ring control allows you to edit the filename for the debug and release configurations You can use the Browse button to select an existing filename Library Generation Choices This button lets you choose whether to create a static library for each of the compatible external compilers or create one for the current compatible compiler only Refer to Chapter 3 Compiler Linker Issues of the LabWindows CVI Programmer Reference Manual If you want to create a static library for each compiler you must not include any object or library files in your project because such files are specific to a particular compiler If you choose to create a static library for each compiler LabWindows CVI creates the files in subdirectories named msvc borland watcom and symantec LabWindows CVI User Manual 3 20 WWW ni com Chapter 3 Project Window LabWindows CVI also creates the library for the current compatible compiler in the parent directory e OK This button accepts the current inputs and closes the dialog box e Cancel This button cancels the operation and removes the dialog box
305. s when your run time modules reference symbols in any of the following LabWindows CVI libraries User Interface Library RS 222 Library DDE Library TCP Library Formatting and I O Library Utility Library If you use one of these libraries include in your external compiler project the source file displayed in this indicator e ANSI C Library tThis display provides information LoadExternalModule requires when your run time modules reference symbols in the ANSI C library Include in your external compiler project the source file displayed in this indicator e Other Symbols Select this option if your run time modules refer to symbols other than those covered by the previous two options Such symbols include functions or variables that you define globally in your executable or DLL and to which your object or static library run time modules expect to link This option creates an object file for you to link into your executable or DLL Header File Insert the name of an include file that contains complete declarations of all the symbols necessary to resolve references from run time modules Object File Enter the name of the object file to create Click on the Create button to create the file You must include this file in your external compiler project National Instruments Corporation 3 23 LabWindows CVI User Manual Chapter 3 Project Window The bottom of the External Compiler Support dial
306. s CVI User Manual Chapter 5 New Open Source and Interactive Execution Windows The New command operates the same way as it does in the Project window For a description of this command refer to the discussion of the New command in the File Menu section of Chapter 3 Project Window The Open command operates the same as it does in the Project window For a description of this command refer to the discussion of the Open command in the File Menu section of Chapter 3 Project Window Open Quoted Text Save The Open Quoted Text command opens c h fp and uir files that appear by name in the active window If you select Open Quoted Text when the text cursor in the active window is on a line that contains a filename in quotation marks or angle brackets that file opens in the corresponding window type The Save command writes the contents of the active window to disk If you want to append a different extension type it in after the filename If you do not want to append an extension enter a period after the filename Save As The Save As command writes the contents of the active window to disk using a new filename you specify and changes the name of the active window to the name you specified Save Copy As Close Ei The Save Copy As command writes the contents of the active window to disk using a filename you specify without changing the name of the active window The Close command closes the active window If you
307. s c File Edit View Build Run Instrument Library Tools Window Options Heb if event EVENT TIMER TICK 1 x simulate temperature reading Update thermometer control and temperature sti SetCtrlVal handle PANEL TEMP temp E 42 135 38 42 L aly Figure 5 3 Selecting Text Using Line Select Mode LabWindows CVI User Manual 5 6 WWW ni com Chapter 5 Source and Interactive Execution Windows Column Select Mode highlights a rectangular block of text H lt 1 gt d CVI samples apps tempsys tempsys c File Edit View Build Run Instrument Library Tools Window Options ae 2 EE m SHETE 4 RE temp do temp historydEzz count control and temperature sti PEL TEMP temp E Al AZ 457135 Figure 5 4 Selecting Text Using Column Select Mode You can cycle through these three modes by pressing lt Ctrl Insert gt on the keyboard or by clicking the mouse on the graphical icon at the bottom of the window File Menu This section explains how to use the commands in a Source and Interactive Execution window File menu as shown in Figure 5 5 Edit View Build Run Instrument Library Tools Window Options Help New D Open b Open Quoted Text Cl Save CS Save As Save Copy As Close Ctrl Save All Add File To Project Read Only Print Exit Labwindows CVl Figure 5 5 File Menu National Instruments Corporation 5 7 LabWindow
308. s eoe motae itti iE 5 32 Instrument Menu eet et er an tea dau es 5 33 Library Mentee 5 33 Tools Mens ebe eelere 5 33 Create ActiveX Automation Controller sss 5 33 Create IVI Instrument Driver TTT 5 34 Edit Instrument Attributes e eee 5 34 Edit P nction a R cT 5 34 Edit Function Panel 5 35 Source Code Cano aC TOLET Ret diac e air o ER DIAS 5 35 Wandow Menu o ei eet DH eB cus et RR 5 35 Options Meng rte qe ERE SEENEN 5 35 Editor Preferences 5 ganwovheste E dE RARE 5 36 Re ere E M Lace dede ite e ea d 5 37 Bracket Styl s none peneoueto notet t e ee pae sets 5 37 Ont ee madii d ate ee 5 37 ColorSsutetut teat daten tte RR eue its 5 37 Syntax NEE 5 37 User Defined Tokens for Coloring sese sese sees eee 5 38 Translate DOS LW Program sss sese sees eee eee 5 38 Generate DLL Import Source 5 38 Generate DLL Import Library esee 5 39 Generate Visual Basic Include sss sese 5 39 Create Object File reste Ree e deret E REUS 5 39 Help Menu tree eae o ete ar ea o ewes eee 5 40 Keyboard Help costo e Oa tees 5 40 Chapter 6 Using Function Panels Accessing Function Panels ut iere metet eerie preter reed 6 2 Multiple Function Panels in a Window sese eee eee eee 6 3 Generated Code Box dieere a E DUIS 6 4 Toolbars ini EabWindoWws G VL teet rete rette e IP e Rene aeo E eR ees 6 4 Function Panel Controls 5er p Oe Deis nire buie ei 6 4 Specifying a Return Value Control Parameter 6 5 Specifying an Inp
309. s the method names of the currently selected object The name too long message appears to the right of methods that yield function names that are too long If you choose Call Methods Directly Through the Dual Interface in the Call Mechanism control on the Configure panel of the ActiveX Automation Controller Wizard the get and set functions for the properties are also listed here Method Tag LabWindows CVI appends this string to the Object Tag to construct the function name for the currently selected method This string must contain only valid C identifier characters Method Description This list box contains a description of the currently selected method Some ActiveX Automation servers do not provide this description Function Prototype This list box contains the prototype of the function to be generated for the currently selected method This prototype does not include the function return type and calling convention LabWindows CVI User Manual 3 52 www ni com Chapter 3 Project Window Properties of Object This list box contains the property names of the currently selected object The name too long message appears to the right of properties that yield function names that are too long Set the menu ring to Properties to see properties in the list box If you choose Call Methods Directly Through the Dual Interface in the Call Mechanism control on the Configure panel of the wizard then the Get and Set functions for the properties
310. s you declare in the Interactive Execution window Variables you declare using the Declare Variable command in a function panel Variables or expressions used in function panels you execute Variables or expressions used in function panels from which you insert code into a Source window User Interface panel handle variables that CodeBuilder adds to a Source window Variables declared as global or static global in a project file that has been successfully compiled but only if the Show Project Variables option is enabled in the dialog box LabWindows CVI removes some or all these items from memory when you unload the current project or when you select Build Clear Interactive Declarations Data Type Compatibility Compatibility between data types is a more complex issue than you might expect LabWindows CVI uses a number of heuristics The heuristics differ based on whether the variable is known to the compiler Variables known to the compiler include variables you declare in the Interactive Execution window and variables you declare in project files that you have successfully compiled For such variables LabWindows CVI uses the following factors to determine whether the variable is type compatible with a function panel control LabWindows CVI reduces data types you declare with the typedef keyword to their most intrinsic type as long as the typedef is known to the compiler For example assume the compiler has processed the following declaration
311. same position relative to the pr j file If LabWindows CVI cannot find one or more files in the project or project include paths a dialog box appears prompting you to manually confirm those pathnames LabWindows CVI might also adjust pathnames that are relative to the LabWindows CVI directory or the VXIplug amp play directory if the directory has changed since you last saved the project If p files in the project cannot be found LabWindows CVI searches for them in the directories listed in the Instrument Directories dialog box and in the cvi instr directory If you disable this option LabWindows CVI does not update pathnames when you move the project or when the LabWindows CVI and VXIplug amp play directories change LabWindows CVI User Manual 3 72 www ni com Chapter 3 Project Window Font Use the Font command to select the font and font size for the text in the Project window Colors Use the Colors menu item to select colors for the Project window Source windows Interactive Execution window Standard I O window Watch window Variables window String Display window and Array Display window The Colors menu item does not affect dialog boxes function panels and the User Interface Editor window The Colors menu item opens a dialog box that contains a list box Each line in the list box describes the purpose of the color and shows its current color state To change the color click and hold on the color control at the botto
312. set or clear a breakpoint on that line e Move the cursor to the line of code where you want to set or clear a breakpoint and select Run Toggle Breakpoint or press lt Shift F9 gt e Select Run Breakpoints to edit all breakpoints in the project and the Interactive Execution window You also can use the Breakpoints command to set conditional breakpoints Refer to the Conditional Breakpoints section later in this chapter for information about conditional breakpoints e Select Runs Break at First Statement to break on the first executable statement in the project or the Interactive Execution window e You can set breakpoints directly in your source code using the Breakpoint function e YOU can manually suspend execution while your program runs if your program checks for user input For example if your program makes calls to RunUserInterface or scanf pressing lt Ctrl F12 gt while a LabWindows CVI environment window is active causes a breakpoint state Conditional Breakpoints Set conditional breakpoints by selecting Run Breakpoints When you assign a conditional breakpoint to a line in your program LabWindows CVI evaluates an expression you supply such as x 100 or y 0 before executing the line If the expression is true program execution suspends National Instruments Corporation 5 27 LabWindows CVI User Manual Chapter 5 Source and Interactive Execution Windows If you assigned these expressions to line 23 in your program
313. so copy the cdb file and the source files It is best to keep the cdb file and source files in the same relative location to each other You do not have to keep the ca file in the same directory as the DLL LabWindows CVI prompts you for the cdb file location and keeps track of it thereafter Different Ways to Debug DLLs You can debug a DLL two ways In one approach you run a LabWindows CVI executable project that calls the DLL The DLL project is not open in LabWindows CVI In the other approach you open the DLL project and run an external process that uses the DLL Running a Program in LabWindows CVI To debug a DLL that another LabWindows CVI project uses select Run Debug after loading the project that will use the DLL When LabWindows CVI loads the DLL it loads the corresponding debug information from the cdb file LabWindows CVI honors breakpoints you set in DLL source files LabWindows CVI saves in the project any breakpoints you set in any source file regardless of whether the source file is in the project Also you can set watch expressions for a debuggable DLL For each watch expression you must choose whether it applies to a project or a DLL If it applies to a DLL you must enter the name of the DLL LabWindows CVI stores this information in the project For more information refer to Chapter 7 Variables and Watch Windows You can debug multiple DLLs called from the same project LabWindows CVI handles each DLL in the
314. symbols Export What This indicates your current method of choice for determining which symbols in the DLL to export to the users of the DLL Use the Change button to change your choice Change This button lets you select the method to use for determining which symbols in the DLL to export to the users of the DLL The choices are the following Include File Symbols You must name one or more include files that declare symbols defined globally in the DLL The declared symbols are the ones exported You can select from a list of include files in the project e Symbols Marked for Export The DLL exports all symbols you define in the DLL with the qualifier declspec dllexport or export e Include File and Marked Symbols The DLL exports all symbols you define in the DLL with the qualifier declspec dllexport or export and the symbols declared in the specified header files OK This button accepts the current inputs and closes the dialog box Cancel This button cancels the operation and removes the dialog box Note When you use the Symbols Marked for Export option or the Include File and Marked Symbols option and include in your project an object or library file that defines exported symbols LabWindows CVI cannot correctly create the import libraries for each of the four compatible external compilers This problem does not arise if you use only source code files in your DLL project For more information on creating DLL
315. t driver source or include file Youcan modify the function panels by selecting Option Edit Function Panel Window from a Function Panel window by selecting Edit Edit Function Panel Window from a Function Tree Editor window or by selecting Tools Edit Function Panel from a Source window that contains the instrument driver source or include file when the text cursor is over the name of the function in the driver LabWindows CVI User Manual 3 38 WWW ni com Chapter 3 Project Window e You can modify the instrument driver program file by selecting Instrument Edit in a Function Panel window by selecting Tools Go To Definition from a Function Panel Editor window or by selecting Go To Definition from the context menu in the Function Tree Editor window e YOU can modify the instrument driver include file by selecting the n file using the File Open Include h in the Project window by selecting Tools Go To Declaration from a Function Panel Editor window or by selecting Go To Declaration from the context menu of the Function Tree Editor window Instrument Menu The Instrument menu is a dynamic menu It contains a list of the loaded instrument drivers and commands to load unload and edit instruments When you load an instrument its name appears in the list When you unload an instrument its name disappears from the list When you select an instrument name in the Instrument menu you can access its function panels Load and unl
316. t LabWindows CVI The Exit LabWindows CVI command closes the current LabWindows CVI session If you have modified any open files since the last save or if any windows contain unnamed files LabWindows CVI prompts you to save them to disk Edit Menu for the Array Display Window This section contains a detailed description of the Edit menu for the Array Display window Figure 8 6 shows the Edit menu for the Array Display window File Format Run Window Options Help Edit Value Enter Find Goto Shift F3 Figure 8 6 Edit Menu for the Array Display Window Edit Value The Edit Value command in the Array Display window invokes a dialog box that you can use to change the value of the selected array element LabWindows CVI User Manual 8 6 WWW ni com Chapter 8 Array and String Display Windows Find The Find command invokes the dialog box shown in Figure 8 7 bd Find Prev Case Sensitive T Whole Word SE IV Wrap T Regular Expression IV Button Bar Figure 8 7 Find Dialog Box in the Array Display Window The Find command operates the same way as it does in the Variables window but with fewer options Refer to the Edit Menu for the Variables Window section in Chapter 7 Variables and Watch Windows for information on how to use options in the Find dialog box Goto The Goto command moves the highlight to a particular location in the current string or array plane When you
317. t Window Save As Use the Save As command to write the project file to disk using a new name you specify The Save As command changes the name on the Project window title bar to the new name you specified If you want to append an extension other than prj type it in after the filename If you do not want to append any extension enter a period after the filename Save All The Save All command saves all open files to disk Auto Save Project If you enable the Auto Save Project command LabWindows CVI automatically saves your project files When you load a project the Auto Save Project command is initially enabled unless the project file is read only on disk If you enable the command LabWindows CVI automatically saves the project file whenever the project contains significant new or modified information If you disable this command the project file is saved only in the following cases e When you execute the Save Save As or Save All command from the File menu When you unload the project or exit LabWindows CVI LabWindows CVI prompts you to save the file in this case Notice that if you disable the Auto Save Project command LabWindows CVI does not save the project file when you start running a program even if you set the Save Changes before Running option in the Run Options dialog box to Always or Ask Print The Print command opens a list of all the printable files in the project You can select the files you want to print
318. t terminates This option also suppresses the LabWindows CVI startup screen and Project window National Instruments Corporation 1 1 LabWindows CVI User Manual Chapter 1 Configuring LabWindows CVI Table 1 1 LabWindows CVI Startup Options Continued Option Purpose newproject LabWindows CVI starts with an empty Project window pProcessID LabWindows CVI attaches to the process that ProcessID identifies When the process subsequently loads DLLs LabWindows CVI can debug them if you created them in LabWindows CVI for debugging You can express ProcessID as a decimal number or as a hexadecimal number that you precede with 0x How to Set the Configuration Options LabWindows CVI Development Environment Configuration Options are under the following key where version is the version of the LabWindows CVI Development Environment HKEY LOCAL MACHINENSOFTWARENNational Instruments NCVIN version For example use the following key to set the configuration options for the LabWindows CVI 5 5 Development Environment HKEY LOCAL MACHINENSOFTWARENNational Instruments NCVI N5 5 LabWindows CVI Run time Engine configuration options are under the following key HKEY LOCAL MACHINENSOFTWARENNational Instruments CVI Run Time EngineNcvirt Your programs when you run them from the environment or standalone use the Run Time Engine configuration options LabWindows
319. tartup 3 66 CVI Environment Sleep Policy 3 65 Enable Data Tool Tips 3 66 Force Loaded Instrument Driver s Source into Interactive window 3 66 Force Project Source Files into Interactive window 3 66 Goto source After Inserting Code from Function Panel 3 66 Interactive Window Memory Size 3 66 Use Console Window for Standard I O When Debugging 3 66 Use Only One function panel window 3 42 3 66 Error command View menu 6 21 errors Break on library errors option 3 65 build errors 5 25 Display status dialog box during build option 3 62 Maximum number of compile errors option 3 60 National Instruments Corporation l 11 Index run time error reporting 3 33 to 3 34 5 29 Show Build Error window for warnings option 3 62 Source Code Control Errors window 3 57 Stop on first file with errors option 3 62 Estimate Number of Elements command Options menu 7 17 Exclude File from Build command Edit menu 3 9 Exclude Function command Options menu 6 24 excluding lines of code 5 4 5 12 executables creating and distributing See standalone executables creating and distributing Execute command Run menu 3 35 Exit LabWindows CVI command File menu Array and String Display windows 8 6 Function Panel windows 6 9 Project window 3 7 Source and Interactive Execution windows 5 9 User Interface Editor 4 4 Variables and Watch windows 7 7 Expand Variable command View menu 7 3 7 11 to 7 12 Expanded Array Variables
320. tegers s Real numbers National Instruments Corporation 5 37 LabWindows CVI User Manual Chapter 5 Source and Interactive Execution Windows e Strings Preprocessor directives e User defined tokens Set the color for a token type by selecting Options Colors Create the list of user defined tokens by selecting Options User Defined Tokens for Coloring User Defined Tokens for Coloring Use the User Defined Tokens for Coloring command to define tokens for display in a unique color when you enable the Syntax Coloring command Use the Colors command to set the color Each token must be in the form of a valid c identifier For each token you can choose whether to save it in the project file or from one LabWindows CVI session to another Translate DOS LW Program Use the Translate DOS LW Program command to convert a source file written in LabWindows for DOS so that it can run in LabWindows CVI Refer to Chapter 12 Converting LabWindows for DOS Applications in the Getting Started with LabWindows CVI manual for details about converting c uir 1bw and obj files from LabWindows for DOS for use in LabWindows CVI Generate DLL Import Source This command generates source code that you can use to create a DLL import library In general it is not necessary to use this command For most cases you can generate a DLL import library directly using the Generate DLL Import Library command Use this command only when you must do special
321. tern in the Interactive Execution window before executing the function You can use the Declare Variable command from the Code menu to define a variable in the Interactive Execution window You can use the Select Variable command from the Code menu to select a variable or expression that you have used before To view the value at an output control parameter after LabWindows CVI executes the function double click on the lower half of the output control to open the Variables window Using a Global Control A global control displays the contents of global variables in a library function You can use global controls to monitor global variables the function does not specifically return as results These are read only controls You cannot alter the content and the controls do not contribute parameters to the generated code Common Control Function Panel A Function Panel window can contain a special function panel called a Common Control function panel The n controls on a Common Control function panel specify the first n parameters of all functions in the Function Panel window Convenient Viewing of Function Panel Variables Select View Variable Value or Add Watch Expression from the Code menu to view the contents of arrays structures and global variables that exist in function panel controls Depending on the type of the variable or expression the Variables Array Display String Display or Watch window appears with the variable or expression h
322. the Shift key as you move the keyboard cursor over the text you want to select You can use the Shift key in combination with any of the keyboard commands for moving the keyboard cursor or scrolling the window National Instruments Corporation 5 5 LabWindows CVI User Manual Chapter 5 Source and Interactive Execution Windows To select text with the mouse click on the first character you want to select and drag the mouse over the remaining characters To select a word double click on the word To select a line triple click on the line If you make a mistake while selecting text click the mouse or press lt Esc gt to cancel the selection LabWindows CVI provides three modes for selecting text depending on the state of the graphical icon at the bottom of the window as illustrated in Figures 5 2 5 3 and 5 4 Es Character Select mode highlights all characters from where you begin selecting text to where you end the selection H 1 d CVI samples apps tempsys tempsys c Bisi x File Edit View Build Run Instrument Library Tools Window Options Help zj eed ali oo RES als a temp datapoints temp history count temp count Update thermometer control and temperature sti SetCtrlVal handle PANEL TEMP temp 40 135 EH 36 40 al Figure 5 2 Selecting Text Using Character Select Mode Line Select Mode highlights full lines of text H lt 1 gt d CVI samples apps tempsys tempsy
323. the Find What text box or by using the up or down arrow keys on your keyboard e CaseSensitive Finds only the instances of the specified text that match exactly For example if CHR is the specified text the Case Sensitive option finds CHR but not Chr e Whole Word Finds the specified text only when the characters that surround it are spaces punctuation marks or other characters not considered parts of a word LabWindows CVI treats the characters A through Z a through z 0 through 9 and underscore as parts of a word e Regular Expression Jr you select this option LabWindows CVI treats certain characters in the Find What text box as regular expression characters instead of literal characters Table 5 1 describes the regular expression characters preceding character or expression Table 5 1 Regular Expression Characters Purpose Character Description Example Wildcard matching Match 1 character a t matches act and period apt but not abort Matching zero or Match 0 or more 0 1 matches 1 01 more occurrences asterisk occurrences of 001 etc a matches act apt and abort plus sign Match 1 or more occurrences of preceding character or expression 0 1 matches 01 001 0001 Matching either or Match 0 or 1 0 1 matches 1 and 01 question occurrences of but not 001 mark preceding character or expression Match either the a b matches every pipe preceding or followin
324. the Source Code Control command in the Project window Refer to the Source Code Control Options section in Chapter 3 Project Window for information Window Menu The Window menu in Source and Interactive Execution windows works the same as the Window menu in the Project window Refer to the Window Menu section in Chapter 3 Project Window for information on the Window menu Options Menu Use the commands in the Options menu to set up preferences in the LabWindows CVI environment and execute various LabWindows CVI utilities Figure 5 17 shows the Options menu File Edi View Build Run Instrument Library Tools Window Bed Editor Preferences Toolbar Bracket Styles Font Colors v Syntax Coloring User Defined Tokens for Coloring Translate DOS LW Program Generate DLL Import Source Generate DLL Import Library Generate Visual Basic Include Create Object File Figure 5 17 Options Menu National Instruments Corporation 5 35 LabWindows CVI User Manual Chapter 5 Source and Interactive Execution Windows Editor Preferences The Editor Preferences command invokes the dialog box shown in Figure 5 18 that you can use to set up Source window editor preferences cw Editor Preferences x Undo 100 Purge undo actions when saving file Paste v Move cursor to end of pasted text Tabs Tab length El 4 Expand TAB key to spaces
325. the current structure with its parent Notice the presence of the left arrow icon after selecting Follow Pointer Chain in Figure 7 13 This indicates that the structure hquework begin next is a child structure in a chain Clicking on the left arrow icon or selecting Retrace Pointer Chain causes the variable display to revert back to Figure 7 12 le Note Retrace Pointer Chain is valid only when you displayed the current structure with Follow Pointer Chain National Instruments Corporation 7 13 LabWindows CVI User Manual Chapter 7 Variables and Watch Windows Go To Execution Position Variables Window This command is valid only in the Variables window The Go To Execution Position command is available only when the currently highlighted item is a function name or the name of a formal parameter or local variable The command opens the Source window that contains the call to the function in which your program suspended execution and highlights the function call To execute the Go To Execution Position command you can double click on the function name or press lt Ctrl P gt Go To Definition Variables Window This command is valid only in the Variables window The Go To Definition command opens the Source window that contains the definition of the currently selected function or variable and highlights the definition Array Display The Array Display command invokes the Array Display window for the currently highlighted array T
326. the error message and the code in the generated code box Include File The Include File command displays the include file associated with the library or instrument driver in a Source window The include file contains all the function prototypes for the library or instrument driver Current Tree The Current Tree command displays the Select Function Panel dialog box for the most recently used function panel making it easy for you to return to the location of the current panel in the function tree Function Panel History The Function Panel History command displays a scrollable list of the function panels you have used during the current LabWindows CVI session You can display function panels from the list as new windows or you can overwrite the current Function Panel window Find Function Panel When you select the Find Function Panel command a dialog box appears in which you can enter the name of a function You can enter just a substring and the Find Function Panel command finds all functions that contain that substring anywhere in their names For instance if you enter ct r1 and click on OK a dialog box appears with a list of functions including NewCtrl SetCtrlVal GetCtrlVal and so on You can use a regular expression as your search string Refer to Table 5 1 Regular Expression Characters in Chapter 5 Source and Interactive Execution Windows for a list of regular expression characters If a function panel exists for the fu
327. through LoadExternalModule Or LoadExternalModuleEx Force Project Source Files into Interactive Window Enable this option if you run a function panel or interactive window code that loads a source file that is in the currently loaded project through LoadExternalModule or LoadExternalModuleEx LabWindows CVI User Manual 3 66 www ni com Chapter 3 Project Window Library Options You use the Library Options command to specify optional National Instrument libraries that load automatically when you start LabWindows CVI You also can specify which of the optional National Instruments user libraries to load on startup using the Library Options command The Library Options command invokes the Library Options dialog box which contains National Instruments Libraries and User Libraries as shown in Figure 3 23 cw Library Options m National Instruments Libraries IV Analysis IV Easy 1 0 for DAG IV Data Acquisition Iv vx Iv GPIB GPIB 488 2 User Libraries Browse Add Edit Paste Above E Paste Below Changes do not take effect until the next session Cancel Figure 3 23 Library Options Dialog Box National Instruments Libraries There are five optional National Instruments libraries Advanced Analysis Easy I O for DAQ Data Acquisition VXI GPIB GPIB 488 2 National Instruments Corporation 3 67 LabWindows CVI User Manual Chapter
328. tion Panel Tree command View menu 5 20 Function Panel windows closing after executing Insert Function Call command 3 66 Code menu 6 9 to 6 20 displayed in Window menu 3 58 File menu 6 8 to 6 9 generated code box 6 4 Help menu 6 25 Instrument menu 6 22 Library menu 6 23 multiple function panels per window 6 3 Options menu 6 23 to 6 25 purpose and use 2 5 View menu 6 2 6 20 to 6 22 Window menu 6 23 function panels See also function panel controls accessing 6 2 to 6 3 from Instrument menu 3 42 to 3 43 definition 2 4 6 1 finding functions 5 22 multiple function panels per window 6 3 purpose and use 6 1 function prototypes enabling 3 60 to 3 61 Function subwindow Variables window 7 2 Function Tree Editor window opening with New command 3 5 with Open command 3 6 purpose and use 2 5 Function Tree Help Editor window 2 5 www ni com function trees definition 6 2 files displayed in Window menu 3 58 G Generate All Code dialog box 4 25 Generate Control Callback command 4 28 Generate DLL Import Library command Options menu 5 39 Generate DLL Import Source command Options menu 5 38 to 5 39 Generate Main Function dialog box 4 27 Generate menu All Callbacks command 4 28 All Code command 4 25 to 4 26 Control Callbacks command 4 28 Generate All Code dialog box 4 25 illustration 4 24 Main Function command 4 26 to 4 27 Menu Callbacks command 4 28 to 4 29 Panel Callback command 4 28 to 4 2
329. tion performs For example read only attributes for user interface controls appear dim when you use this dialog box from the function panel for Set Ct rlattribute The Control Type ring appears only when you use this dialog box from a User Interface Library function panel It allows you to restrict the list of attributes to those applicable to a particular control type LabWindows CVI User Manual 6 14 www ni com Chapter 6 Using Function Panels The Data Type ring appears when you use this dialog box from a function panel for a typesafe attribute function The IVI Library and IVI instrument drivers have typesafe attribute functions such as Ivi SetAttributeViInt32 The Data Type ring allows you to restrict the list of attributes to those that have the same data type as the typesafe function If you choose to see all attributes the data type of each attribute appears on the right hand side of the list box The data type is dim if it is not the same as the data type of the typesafe function The Attribute Help text box displays help information for the currently selected attribute Double click on an attribute or click on OK to change the function panel ring control to that attribute If you select an attribute that appears dim in the list box an error message appears informing you that the attribute does not allow the type of access the function requires If you select an attribute for which the data type appears dim in the list box a dialog
330. tionship between a function panel and the Interactive Execution window in more detail Instead of executing the function call you can choose to copy the function call code to a Source window You can later recall the function panel from the Source window by selecting View Recall Function Panel in a Source window Normally you use function panels to call into instrument drivers in the Instrument menu and libraries in the Library menu Refer to the Using Instrument Drivers section in Chapter 3 Project Window for detailed information on the relationship between instrument drivers and function panels Also you can use function panels to call functions in the project as long as the functions are declared in the Interactive Execution window Thus you can create function panels for functions that you call frequently even if you do not keep the functions in a separate file Refer to the LabWindows CVI Instrument Driver Developers Guide for detailed information about creating function panels National Instruments Corporation 6 1 LabWindows CVI User Manual Chapter 6 Using Function Panels Accessing Function Panels You can access a function panel for an instrument driver from the Instrument menu or for a library from the Library menu After you select an instrument or library name choose a panel by making selections from the Select Function Panel dialog box Functions are grouped in a multilevel structure called a function tree This struc
331. to Project The Add File to Project command adds the uir file in the current window to the project list Read Only The Read Only command suppresses the editing capabilities in the current window When you initially open a file the Read Only command is disabled unless the file is read only on disk Print The Print command opens the Print dialog box which allows you to send the entire uir file or the visible screen area to a printer or a file The Print dialog box also allows you to set print preferences The print preferences correspond to the print attributes that are described in the LabWindows CVI Online Help National Instruments Corporation 4 5 LabWindows CVI User Manual Chapter 4 User Interface Editor Window Edit Menu This section explains how to use the commands in the User Interface Editor window Edit menu as shown in Figure 4 4 The Edit menu is used for editing panels controls and menu bars File RSA Create View Arange Code Run Library Tools Window Options Help Undo Panel Move CZ Redo Ctrl BkSp Cut Dtrlex Copy Ctrl C Paste Cl Delete Del Copy Panel Ctrl Shift C Cut Panel Ctrl Shift x Menu Bars Panel Control Enter Tab Order Ctrl T Set Default Font Ctrl Shift F Apply Default Font Ctrl F Control Style Fil Figure 4 4 Edit Menu KL Note Undo and Redo are enabled when you perform an edit action Cut and Copy are enabled when you select a control Paste is
332. tor 4 5 Save changes before running option Run Options command 3 65 Save Copy As command File menu 4 5 5 8 Save in Text Format command Options menu 4 36 sdk directory table 1 4 Search By option Find UIR Objects dialog box 4 18 Search for Help On command Help menu 3 74 Select All command Edit menu Project window 3 9 Source and Interactive Execution windows 5 12 Select Attribute Constant command Code menu attribute control constants 6 13 to 6 15 value control constants 6 15 to 6 16 WWW ni com Select Attribute Constant dialog box 6 14 to 6 15 Select Attribute Values dialog box 6 16 Select External Process command Run menu 3 34 5 28 Select Function Panel dialog box 3 42 to 3 43 Alphabetize command 3 42 Flatten checkbox 3 42 6 2 Function Names command 3 42 Help button 3 43 illustration 3 42 New Window command 3 42 Select UIR Constant command Code menu 6 12 to 6 13 Select UIR Constant dialog box 6 12 Select Variable command Code menu 6 17 to 6 18 Select Variable or Expression dialog box 6 17 to 6 18 Data Type 6 17 data type compatibility 6 18 to 6 19 Data Type of Control 6 17 illustration 6 17 items included in list box 6 18 Show Project Variables option 6 17 sorting of list box entries 6 19 Variable or Expression list box 6 17 Selected Text Only option Find command 5 16 separators adding and positioning on toolbar 5 3 Set Default Font command Edit menu 4 16 Set Target File
333. tring Display Wrndow eee 8 10 Help Meni roe rado Roo e RU EPOR DES 8 10 Appendix A Source Window Keyboard Commands Appendix B Technical Support Resources Glossary Index Figures Figure 1 1 Registry for Windows sese esse eee eee 1 3 Figure 2 1 Simple Project Wimndow sees ee eee 2 5 Figure 3 1 Project Wimdow eene eene erinnerte 3 2 Faust due TTT ener ere Re Rs 3 4 Figure 3 3 New Command Submenu eese 3 5 Lhipuie3 4 Open Command eniro ro Ret e HI Ae S PeE Oed 3 6 Ligure 3 5 Edit Menu sn ie teddies Aw A i ESRR 3 8 Figure 3 6 Add Files to Project Command Submenu see 3 8 Figure 3 7 View Menn ose ete E debe reines 3 10 Figure 3 8 Build Menu ie tret eer qb Rete oin rte E e 3 11 Figure 3 9 External Compiler Support Dialog Box 3 22 Figure 3 10 Create Distribution Kit Dialog Bon 3 25 Figure 3 11 Advanced Distribution Kit Options Dialog Box 3 29 Figure 3 12 Run Menu iae etes meet tbe tei et erre eite ies 3 33 Figure 3 13 Instrument Menu setis sisao rieri tren etai 3 39 Figure 3 14 Edit Instrument Dialog Box esse eee 3 40 Figure 3 15 Instrument Driver Dialog Box 3 41 Figure 3 16 Select Function Panel Dialog Box 3 42 Figure 3 17 Instrument Help Dialog Box sss 3 43 Figure 3 18 Library Menu eee eme eere eee ceret eee iet 3 44 Figure 3 19 Tools Men eset reete 3 48 Figure 3 20 Automation Controller Advanced Options Dialog
334. trol project attached to the currently loaded LabWindows CVI project e Attach Use this button to attach an existing source code control system project to the current LabWindows CVI project e Create Use this button to create a new source code control system project and attach it to the current LabWindows CVI project e Perform Same Actions for h File as for uir File Because LabWindows CVI generates a uir header file each time the uir file is saved it is a good idea to perform the same source code actions on the header file as you perform on the uir file Ask When you perform a source code control action LabWindows CVI asks if you want to perform the same action on the header file and on the associated uir file Always When you perform a source code control action LabWindows CVI will automatically performs the same action on the header file and on the associated uir file National Instruments Corporation 3 71 LabWindows CVI User Manual Chapter 3 Project Window Never When you perform a source code control action LabWindows CVI does not perform the same action on the header file and on the associated uir file s Do Not Include prj File in SCC Actions Enable this option if you do not want LabWindows CVI to automatically include the LabWindows CVI project file in source code control operations This options always applies to the Get Latest Version of All command It applies to other commands w
335. ts Corporation 5 3 LabWindows CVI User Manual Chapter 5 Source and Interactive Execution Windows Interactive Execution Window You can execute selected portions of code in the Interactive Execution window Unlike the Source window you do not have to have a complete program in the Interactive Execution window For instance you can execute 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 Also you can use the Interactive Execution window to execute functions exported by a loaded instrument or by a file in the project if the project has been linked The Interactive Execution window can access functions and data declared as global in a Source window but a Source window has no access to the functions and data declared in the Interactive Execution window When you execute a function from a function panel LabWindows CVI inserts the function call into the Interactive Execution window for execution In this way the Interactive Execution window keeps a record of the functions you execute from function panels When LabWindows CVI copies a function call from a function panel to the Interactive Execution window for execution it inserts the code after all the pre existing lines LabWindows CVI also inserts an include statement for the header file associated with the function in the Interactive Execution win
336. ture groups functions into various classes according to the operation they perform to make finding individual functions easier When the Select Function Panel dialog box contains class names you can select a class name to view the next level of the function tree until you reach a list of Function Panel windows In certain cases it is convenient to access instrument or library module function panels in a linear fashion that is by moving through the list of functions without using the tree structure The Select Function Panel dialog box has a Flatten option that replaces the function class hierarchy with a list of all function panels at or below the current level Once you have selected a function panel the function panel commands Previous Panel Next Panel First Panel and Last Panel give you access to function panels in this linear manner Refer to the View Menu section later in this chapter for more information about using these commands You can access function panels in other ways as well For instance you might want to return to a panel you recently used or recall a panel from the text of a function call in a Source window The commands that give you access to panels in these and other ways are in the View menu of the Source window A similar set of commands exist in the View menu of the Function Panel window Refer to the View Menu section later in this chapter and the View Menu section in Chapter 5 Source and Interactive Execution Windows
337. ubmenu Use the File Select dialog box to select the files you want to include in the operation and to set any available options for the operation If your Source Code Control Interface supports setting any source code control system specific options for the operation the Advanced button on the Select Files dialog box is available Click on the Advanced button to set the available options Source Code Control commands and options are dimmed if the Source Code Control Interface provided by your source code control system does not support the command or option e Get Latest Version Use this command to get the latest version of the selected files from the source code control project attached to the currently loaded LabWindows CVI project e Get Latest Versions of All Use this command to get the latest version of all files in the project e Check Out Use this command to check out the selected files from the source code control project attached to the currently loaded LabWindows CVI project s Check In Use this command to check the selected files into the source code control project attached to the currently loaded LabWindows CVI project e Undo Check Out Use this command to undo the check out action previously performed on the selected files e Add File to Source Control Use this command to add the selected files to the source code control project attached to the currently loaded LabWindows CVI project e Remove From Source Control
338. uir Save Dip Project pri Ch Save As Function Tree fp Save All V Auto Save Project Print Exit Labwindows CVl Figure 3 3 New Command Submenu Use the New command to open various types of new empty windows If you choose Source or Include a new Source window appears in which you can create a new cor h file If you choose User Interface a new User Interface Editor window appears in which you can create anew uir file Refer to Chapter 4 User Interface Editor Window for more information about User Interface Editor windows If you choose Project a dialog box appears with a message that asks if you want to unload the current project You can work with only one project at a time If you select Yes a new Project window appears You are prompted to save any modified files in the old project You are also prompted to save project options The Options Menu section later in this chapter describes these options If you choose Function Tree a new Function Tree Editor window appears in which you can create a new fp file Refer to Chapter 5 Function Tree Editor in the LabWindows CVI Instrument Driver Developers Guide for more information about Function Tree Editor windows National Instruments Corporation 3 5 LabWindows CVI User Manual Chapter 3 Project Window Open The Open command has a submenu as shown in Figure 3 4 Edit View Build Run Instrument Library Tools Window Options He
339. unction Panel generates To select function help with the mouse right click on the Function Panel you want help with National Instruments Corporation 6 25 LabWindows CVI User Manual Variables and Watch Windows This chapter describes the Variables and Watch windows You use these windows to inspect and modify the values of program variables You can invoke these windows when no program is running or when a program is suspended at a breakpoint The Variables window shows the names and types of all variables including arrays and strings The current values of numeric scalars values and contents of pointers and string contents appear in the Variables window le Note When strings appear in ASCII format there is no visual distinction between a space ASCII 32 and a NUL byte ASCII 0 You can see the difference by displaying the string in decimal format Variables Window To view the Variables window select Window Variables in the active LabWindows CVI window You also can invoke the Variables window for the currently highlighted variable from a Source or Function Panel window with the Run View Variable Value command in the National Instruments Corporation 7 1 LabWindows CVI User Manual Chapter 7 Variables and Watch Windows Source window or the Code View Variable Value command in the Function Panel window An example of the Variables window appears in Figure 7 1 v Variables Sei x File Edit View Format
340. ures such as state caching simulation and compatibility with generic instrument classes National Instruments Corporation 2 1 LabWindows CVI User Manual Chapter 2 LabWindows CVI Overview e A set of instrument drivers that contains high level functions and interactive function panels for controlling specific instruments e A development environment with windows to manage projects and source code with complete editing debugging and user protection features An additional library the Advanced Analysis Library is available for LabWindows CVI This library is an optional package that you can order from National Instruments Standard Libraries LabWindows CVI includes the following standard libraries e User Interface Library e Analysis Library e Easy I O for DAQ Library e Data Acquisition Library e GPIB 488 488 2 Library e RS 232 Library e VISA Library e IVI Library e TCP Library e DataSocket Library e DDE Library e ActiveX Automation Library e Formatting and I O Library e Utility Library e ANSI C Library The functions that make up these libraries can be executed in the LabWindows CVI environment Refer to the LabWindows CVI Online Help for more information or refer to the following manuals e NI 488 2 Software Reference Manual or NI 488 2M Software Reference Manual e NI VISA User Manual available upon request e NI VISA Programmer Reference Manual available upon request LabWindows CVI User Manual 2 2 WWW ni com
341. using the option you last selected in the Distribution command submenu Control ZPlane Order The Control ZPlane Order option lets you set the sequence in which overlapped controls are drawn Controls are always drawn in order from the back to the front of the z plane order The Control ZPlane Order submenu presents four commands Move to Front moves the control to the front of the z plane order so it is drawn last Move to Back moves the control to the back of the z plane order so it is drawn first Move Forward moves the control one place forward in the z plane order Move Backward moves the control one place backward in the z plane order LabWindows CVI User Manual 4 22 www ni com Chapter 4 User Interface Editor Window Center Label The Center Label command centers the label of the selected control Control Coordinates The Control Coordinates command invokes a dialog box where you can interactively set the width height top and bottom of all selected controls and labels Code Menu This section explains how to use the commands in the User Interface Editor window Code menu as shown in Figure 4 17 Use the commands in the Code menu to generate code automatically based on a uir file you are creating or editing File Edit Create View Arrange ESSE Run Library Tools Window Options Help Set Target File Generate E View Preferences Figure 4 17 Code Menu Set Target File Use the Set Target File
342. uspends execution on the statement following the function call National Instruments Corporation 5 29 LabWindows CVI User Manual Chapter 5 Source and Interactive Execution Windows Finish Function The Finish Function command resumes execution through the end of the current function and breakpoints on the next statement Terminate Execution The Terminate Execution command terminates a program that is suspended at a breakpoint The shortcut key for terminating execution of a suspended program or suspending a running program while a LabWindows CVI environment window is active is lt Ctrl F12 gt Break at First Statement Break at First Statement is a run mode that enters a breakpoint state on the first executable statement in your source code When activated LabWindows CVI puts a checkmark beside this command in the menu Toggle Breakpoint The Toggle Breakpoint command toggles the state of the breakpoint on the current line Breakpoints The Breakpoints command opens the Breakpoints dialog box which contains a list of the breakpoints in the project as illustrated in Figure 5 14 Also you can open this dialog box by right clicking in the line icons column and selecting Breakpoints from the pop up menu cw Breakpoints sus c Line 37 tempsys c Line 104 Disabled j tempsys c Line 109 i tempsys c Line 114 j tempsys c Line 118 j tempsys c Line 122 Disabled Add Edit Item Delete Item Disable
343. ut Control Parameter sss esse esse sees eee ee eee 6 5 Specifying a Numeric Control Parameter 6 5 Specifying a Slide Control Parameter 0 0 0 0 esse eee ee eee 6 6 Specifying a Ring Control Parameter 6 6 Specifying a Binary Control Parameter 6 6 National Instruments Corporation xiij LabWindows CVI User Manual Contents Specifying an Output Control Parameter 6 7 Using a Global Control 5 2 entere ee I tede 6 7 Common Control Function Panel 6 7 Convenient Viewing of Function Panel Variables sess 6 7 ISI MEET LC r E 6 8 E 6 8 EIERE 6 8 le GE 6 8 Save All TT 6 8 Add FP File to Project T 6 8 Add Program File to Project T 6 9 Most Recently Closed les 6 9 BExat LabWandoWws CW E itai See dr t OE HERE IU 6 9 Gode Menus stent s E EI Inst en a 6 9 Run Function Panel 6 10 Declare Vartable co tepore n OR 6 10 Clear Interactive Declaranong sss sese eee 6 11 Select UIR Constant 6 12 Select Attribute Constant 6 13 Selecting Constants in an Attribute Control 6 14 Selecting Constants in a Value Control 6 15 Select Variablez sits eB UM ER SI 6 17 What is Included in a List Bos 6 18 Data Type Compatibility isisi iseis htt trit eee 6 18 Sorting List Box Entries nennen entente 6 19 Insert Function TTT 6 19 Set Target File idee RI ehe pe e EE gl ives 6 20 View Variable Value eee 6 20 Add Watch Bxvpreseion eene nene nennen erret 6 20 Mew Menus tit
344. viates object property and method tags for common ActiveX Automation servers such as Microsoft Excel 8 0 If you have names that are too long you should abbreviate object tags before abbreviating property and method tags Because LabWindows CVI does not include the instrument prefix in the name length limit abbreviating it does not allow you to have longer property method or object tags LabWindows CVI User Manual 3 50 www ni com Chapter 3 Project Window When you click on the Advanced Options button on the Advanced panel of the ActiveX Automation Controller Wizard the Automation Controller Advanced Options dialog box appears as shown in Figure 3 20 cw Automation Controller Advanced Options Instrument Prefix amp SControls Objects in Active Setup Control Library vH TestCH v IInstallEngineCtl top level object v DTextCHUE vents event object Check All event object eck A v DInstallE ngineCHE vents Check None Object Tag Te Object Description Primary dispatch for Active Setup Text Control liri Method Names Too Long 0 Property Names Too Long 0 e Methods of ITextCH Setalignment SetFontName SetFontSize Setltalic SetBold SetTextColor Method Description Function Prototype ASControls_ITextCtlGetcaption CAObiHandle objectHandle ERRORINFO errorlnfo char returmValue Cancel Help Figure 3 20 Automation Controller
345. w command 3 5 Open command 3 6 Print command 3 7 Save command 3 6 Save All command 3 7 Save As command 3 7 Source and Interactive Execution windows Add File to Project command 5 9 Close command 5 8 Exit LabWindows CVI command 5 9 Hide command note 5 8 illustration 5 7 most recently closed files list 5 9 New command 5 8 Open command 5 8 Open Quoted Text command 5 8 Print command 5 9 Read Only command 5 9 Save command 5 8 Save All command 5 9 Save As command 5 8 Save Copy As command 5 8 User Interface Editor Add File to Project command 4 5 Close command 4 5 Exit LabWindows CVI command 4 4 illustration 4 4 New command 4 4 Open command 4 4 Print command 4 5 www ni com Read Only command 4 5 Save command 4 4 Save All command 4 5 Save As command 4 5 Save Copy As command 4 5 Variables and Watch windows Exit LabWindows CVI command 7 7 Hide command 7 6 illustration 7 6 most recently closed files list 7 7 New command 7 6 Open command 7 6 Output command 7 6 Save All command 7 6 lt filename gt startup option table 1 1 files See also project files adding to project list 3 8 to 3 9 format conversion when loading 3 40 instrument driver files 3 35 to 3 36 location of files required for debugging DLLs 3 31 to 3 32 selecting multiple files in Project window 3 3 Find command Edit menu Array Display window 8 7 Source and Interactive Execution windows 5 14 t
346. w the contents of arrays structures and global variables that appear in a function panel Highlight the variable that you want to see and select View Variable Value Depending on the type of the variable the Variables Array Display or String Display window appears with the variable highlighted Add Watch Expression Use the Add Watch Expression command to view the value of an expression that appears in a function panel Highlight the expression you want to see and select Add Watch Expression The Watch window appears with the expression highlighted View Menu This section contains a detailed description of the View menu for Function Panel windows as shown in Figure 6 10 File Code HETE Instrument Library Tools Window Options Help Toolbar Error Include File Current Tree Shift F8 Function Panel History Ctrl H Find Function Panel Ctrl Shift P Previous Function Panel PgUp Next Function Panel PaDown Previous Function Panel Window Ctrl PgUp Next Function Panel Window Ctrl PgDown First Function Panel Window Ctrl Home Last Function Panel Window CE nd LabWindows CVI User Manual Figure 6 10 View Menu 6 20 www ni com Chapter 6 Using Function Panels Toolbar Use the Toolbar command to toggle between viewing or not viewing the Function Panel window toolbar Error If an error occurs during the execution of a function panel you can use the Error command to toggle between
347. wo lists appear in the File menu e A list of the four most recently closed files other than project files e A list of the four most recently closed project files Exit LabWindows CVI The Exit LabWindows CVI command closes the current LabWindows CVI session If you have modified any open files since the last save or if any windows contain unnamed files LabWindows CVI prompts you to save them to disk Code Menu This section contains a detailed description of the Code menu for Function Panel windows as shown in Figure 6 4 File View Instrument Library Tools Window Options Help Bun Function Panel Shift F5 Declare Variable Ctrl D Clear Interactive Declarations Select UIR Constant Enter or Select Attribute Constant Select Variable Ctrl Insert Function Call Ctrl Set Target File Dit View Variable Value Shift F Add Watch Expression Ctrl F Figure 6 4 Code Menu National Instruments Corporation 6 9 LabWindows CVI User Manual Chapter 6 Using Function Panels Run Function Panel Selecting the Run Function Panel command executes the code in the generated code box When you select Run Function Panel the following actions take place e LabWindows CVI automatically inserts the header file for the library or instrument driver into the Interactive Execution window if it is not already there e LabWindows CVI generates temporary variables for blank scalar output controls e LabWindo
348. ws CVI copies the generated function s to the Interactive Execution window e LabWindows CVI executes the code While executing the lt lt Running gt gt menu appears in the upper left corner of the function panel menu bar e LabWindows CVI displays the new values for output return values and global variable controls Declare Variable Use Declare Variable to declare a variable to be placed in the currently active control on the function panel When you select Declare Variable a dialog box appears as shown in Figure 6 5 Variable Type double Variable Name array 1024 IV Execute declaration IV Add declaration to top of target file none Add declaration to current block in target file none Set Target File Cancel Figure 6 5 Declare Variable Dialog Box The Variable Type indicates the data type associated with the currently active control on the panel You can use more than one data type for some controls In such cases a ring control allows you to select the data type To declare a variable with the Declare Variable dialog box enter the name of the variable you want to declare in the Variable Name text box LabWindows CVI automatically prefixes scalar output variables with an ampersand amp The Number of Elements box appears when the currently active control is for an array or a string Enter the number of elements LabWindows CVI User Manual 6 10 WWW ni com Chapter 6 Using
349. xit LabWindows CV I edet eet etie Re RE eos 3 7 Bit Menu 2i iR Eee ER nU eus EIER 3 8 Add Files er Project iue oett eue ose iei neces 3 8 Select Alle ore aet tie Ae tid eR eiu RR 3 9 Exclude File from Build Include File in Build sess 3 9 Remove Eie x sno ee ea eee RE 3 9 Move Item Up iei optet ue tete UD e DO dees Seet 3 9 Move Ttem Down eene PER et eee ete needa 3 10 View TET 3 10 Show Full Path Names ou cecen renr rese aerei rensei 3 10 Show PUM B 3 10 Sort By R aviiet Eeer 3 10 Sort By Names vespertino E p EH re TRE des 3 10 Sort By Patbname eoo ashen ase he ERR E 3 10 Sort By Pile aT TTT 3 11 NGS Orne aH Ee EE AE 3 11 Build Menu EE 3 11 Configuration siet 3 11 Target Type acce Boetii Hort ela rto ee decus ten 3 14 TarBet Settings ices hii epe eph 3 14 Compile Pile ys eis eto eet e e iier pee rie eg Pene 3 21 Mark File for Compilation essere 3 21 Mark All for ConipilatiOn a ee rem D ote e estem eh rette eret eth 3 21 External Compiler Support 3 21 Create Distribution Kat esie nr erede e e eene 3 24 Debugging DLS iege en hee ae Dee 3 30 Location of Files Required for Debugging DLLs eee 3 31 Different Ways to Debug DLLs esee 3 32 Running a Program in LabWindows CVI eese 3 32 Running an External Process essere 3 32 LabWindows CVI User Manual vi www ni com Contents R n LTTE 3 33 RE LE 3 33 Run Time Error R
350. y 2 3 LabWindows CVI User Manual Index configuration options 1 2 to 1 5 creating applications 2 5 to 2 6 environment 2 4 to 2 5 startup options table 1 1 to 1 2 Last Function Panel Window command View menu 6 22 Last Panel command View menu 6 2 Left Edges option Alignment command 4 21 Distribution command 4 22 libraries See also user libraries specific libraries creating static library 3 12 to 3 13 5 24 files required in project file list 3 1 standard libraries 2 2 system libraries 3 48 Library File option Target Settings dialog box 3 20 Library Generation Choices option Target Settings dialog box 3 20 to 3 21 Library menu Function Panel windows 6 23 Project window ActiveX Automation command 3 46 Advanced Analysis command 3 44 Analysis command 3 44 ANSI C command 3 47 Data Acquisition command 3 45 DataSocket command 3 46 DDE command 3 46 Easy I O for DAQ command 3 44 Formatting and I O command 3 47 GPIB GPIB 488 2 command 3 45 illustration 3 44 installing user libraries 3 47 IVI command 3 45 RS 232 command 3 45 system libraries 3 48 TCP command 3 46 User Interface command 3 44 LabWindows CVI User Manual 1 18 Utility command 3 47 VISA command 3 45 VXI command 3 45 Source and Interactive Execution windows 5 33 User Interface Editor 4 31 Library option Add Files to Project command 3 8 Library Options command Options menu 3 47 3 67 Library Options dialog box dummy
351. y string or structure Click on this icon or select View Expand Variable to expand the variable so that you can see each element or member For more information refer to the Expand Variable discussion in the View Menu section later in this chapter e The variable on this line is the starting pointer to a block of defined data that appears in expanded form Click on this icon or select View Close Variable to close the variable so that you see only the starting pointer For more information refer to the Expand Variable discussion in the View Menu section later in this chapter gt The variable on this line is a member of a structure that is a parent pointer to another structure of the same type Click on this icon or select View Follow Pointer Chain to replace the current structure with the child structure that the pointer references For more information refer to the Follow Pointer Chain discussion in the View Menu section later in this chapter The variable on this line is a child structure in a chain The pointer to its parent structure does not appear Click on this icon or select View Retrace Pointer Chain to replace the current structure with its parent For more information refer to the Retrace Pointer Chain discussion in the View Menu section later in this chapter National Instruments Corporation 7 3 LabWindows CVI User Manual Chapter 7 Variables and Watch Windows Watch Window The Watch window is similar in nature to
352. y default event you specify You can set default events for control callback functions and panel callback functions by choosing Code Preferences Although skeleton code runs you must customize it to implement the actions you want to take place for each event When you generate code for a specific control or panel callback function LabWindows CVI places the skeleton code for that function in the target file in the same complete format used for the Code Generate All Code command However this code might not run In order for a project to run a main function must exist If you lack the main function or any of the callback functions you reference in the uir file the code is incomplete It is good practice to use the Code Generate All Code option first to produce a running project from the current state of the uir file Then after adding panels controls or menu items to the uir file select Code Generate Panel Callback Control Callbacks or Menu Callbacks to make corresponding additions to the source file National Instruments Corporation 4 3 LabWindows CVI User Manual Chapter 4 User Interface Editor Window Also with CodeBuilder you can make sure that your automatically generated program terminates properly For a CodeBuilder program to terminate successfully you must include a call to QUitUserInterface When you choose Code Generate All Code the Generate All Code dialog box prompts you to choose which callback functions ter
353. y menu 3 44 user interface constants selecting 6 12 to 6 13 attribute constants 6 13 to 6 16 from uir files 6 12 to 6 13 value constants 6 15 to 6 16 User Interface Editor Arrange menu 4 20 to 4 23 Code menu 4 23 to 4 31 CodeBuilder overview 4 3 to 4 4 Create menu 4 16 to 4 17 Edit menu 4 6 to 4 16 File menu 4 4 to 4 5 National Instruments Corporation 1 29 Index Library menu 4 31 Options menu 4 32 to 4 36 overview 4 2 Run menu 4 31 tool icons 4 2 Tools menu 4 31 using pop up menus 4 3 View menu 4 17 to 4 20 Window menu 4 32 User Interface Editor Preferences dialog box Constant Name Assignment section 4 35 to 4 36 illustration 4 33 More button 4 35 Other User Interface Editor Preferences dialog box 4 35 to 4 36 Preferences for New Controls section 4 34 Preferences for New Panels section 4 33 to 4 34 Undo Preferences section 4 35 User Interface Editor Preferences section 4 33 User Interface Editor window Coloring tool 4 2 Editing tool 4 2 Help menu 4 37 illustration 4 2 Labeling tool 4 2 moving to with Find UI Object command 5 22 opening with New command 3 5 with Open command 3 6 Operating tool 4 2d popup menus 4 3 purpose and use 2 4 sample graphical user interface figure 4 1 tool bar 4 2 LabWindows CVI User Manual Index User Interface Library definition 3 44 purpose and use 2 3 user interface objects finding 4 18 to 4 19
354. y the available formats for displaying individual integers in the Variables and Watch windows You can display integers in decimal hexadecimal octal binary or ASCII format The next two items in the Format menu specify the formats available for displaying individual real numbers Real numbers appear in either floating point or scientific notation The last item Preferences sets the default formats for all integers and all real numbers Run Menu The Run menu contains the following subset of the commands that appear in the Run menu of the Source window Debug e Continue e Step Over e Step Into s Finish Function Terminate Execution National Instruments Corporation 7 15 LabWindows CVI User Manual Chapter 7 Variables and Watch Windows s Break at First Statement e Breakpoints e Threads Refer to the Run Menu section in Chapter 5 Source and Interactive Execution Windows for descriptions of each of these commands Window Menu The Window menu in the Variables and Watch windows operates the same way as it does in the Project window Refer to the Window Menu section in Chapter 3 Project Window for command descriptions Options Menu This section contains a detailed description of the Options menu for the Variables and Watch windows as shown in Figure 7 15 File Edit View Format Run Window BEER Help Variable Size Interpret As Estimate Number of Elements Add Watch Expression
355. you would have to define x and y before line 23 Watch Expressions You can use watch expressions to suspend program execution conditionally Watch expressions do not apply to specific lines of code Instead LabWindows CVI evaluates them before each statement in your source code Refer to Chapter 7 Variables and Watch Windows for more information about watch expressions Debug Run Interactive Statements Running in a Source Window If you have an executable project loaded the Debug xxx exe command runs the project s target executable for the currently selected configuration You set the active configuration by selecting Build Configuration in a Project window If you have a DLL project loaded the Debug xxx exe command runs the executable specified by Run Select External Process Before LabWindows CVI runs the executable it compiles any source files that need to be compiled and builds the project s target executable or DLL if you have made changes since the target DLL or executable was last built Running in the Interactive Execution Window Select Run Interactive Statements in the Interactive Execution window to execute code in that window You do not have to enter a complete program in the Interactive Execution window For instance you can execute variable declarations and assignment statements in C without declaring a main function You can use the Interactive Execution window to test portions of code before including them in you

Download Pdf Manuals

image

Related Search

Related Contents

Sondar5000 User Manual - Deeter Electronics Ltd.  Operating Instructions  BEDIENUNGSANLEITUNG KASSETTE  Tascam CD-01UPro User's Manual  User Guide Ioline 300/350HF System  (パンフレット) -HP ソフトウェア 負荷テストサービスパック  10-800型 取扱説明書 保証書付 ガステーブルコンロ  Weller WXMP Set  Hamilton Beach 68320 User's Manual  Serviceanleitung - Frank's Hospital Workshop  

Copyright © All rights reserved.
Failed to retrieve file