ユーザーズマニュアル目次LabWindows/CVI Programmer Reference Manual1Support2Internet Support2Bulletin Board Support2Fax-on-Demand Support2Telephone Support (USA)2International Offices2National Instruments Corporate Headquarters2Important Information3Warranty3Copyright3Trademarks3WARNING REGARDING MEDICAL AND CLINICAL USE OF NATI...3Contents4About This Manual12Organization of This Manual12Conventions Used in This Manual13Related Documentation14Customer Communication15Chapter 1 LabWindows/CVI Compiler16Overview16LabWindows/CVI Compiler Specifics16Compiler Limits16Compiler Options17Compiler Defines17C Language Non-Conformance17C Language Extensions17Keywords That Are Not ANSI C Standard17Calling Conventions (Windows 95/NT Only)17Import and Export Qualifiers18C++ Comment Markers19Duplicate Typedefs19Structure Packing Pragma (Windows 3.1 and Windows ...19Program Entry Points (Windows 95/NT Only)20C Library Issues20Using the Low-Level I/O Functions20C Data Types and 32-Bit Compiler Issues21Data Types21Converting 16-Bit Source Code to 32-Bit Source Cod...21Debugging Levels23User Protection23Array Indexing and Pointer Protection Errors23Pointer Arithmetic (Non-Fatal)23Pointer Assignment (Non-Fatal)24Pointer Dereference Errors (Fatal)24Pointer Comparison (Non-Fatal)25Pointer Subtraction (Non-Fatal)25Pointer Casting (Non-Fatal)25Dynamic Memory Protection Errors26Memory Deallocation (Non-Fatal)26Memory Corruption (Fatal)26General Protection Errors26Library Protection Errors26Disabling User Protection27Disabling Protection Errors at Run-Time27Disabling Library Errors at Run-Time27Disabling Protection for Individual Pointer27Disabling Library Protection Errors for Functions28Details of User Protection29Pointer Casting29Dynamic Memory30Library Functions31Unions31Stack Size31Include Paths32Include Path Search Precedence32Chapter 2 Using Loadable Compiled Modules33About Loadable Compiled Modules33Advantages and Disadvantages of Using Loadable Com...34Using a Loadable Compiled Module as an Instrument ...34Using a Loadable Compiled Module as a User Library...35Using a Loadable Compiled Module in the Project Li...35Using a Loadable Compiled Module as an External Mo...36Notification of Changes in Run State36Example 137Example 238Using Run State Change Callbacks in a DLL38Compiled Modules that Contain Asynchronous Callbac...39Chapter 3 Windows 95/NT Compiler/Linker Issues40Loading 32-Bit DLLs under Windows95/NT40DLLs for Instrument Drivers and User Libraries41Using The LoadExternalModule Function41Link Errors when Using DLL Import Libraries41DLL Path (.pth) Files Not Supported4116-Bit DLLs Not Supported41Run State Change Callbacks in DLLs41DllMain42Releasing Resources when a DLL Unloads42Generating an Import Library43Default Unloading/Reloading Policy43Compatibility with External Compilers43Choosing Your Compatible Compiler44Object Files, Library Files, and DLL Import Librar...44Compatibility Issues in DLLs44Structure Packing45Bit Fields45Returning Floats and Doubles46Returning Structures46Enum Sizes46Long Doubles46Differences between LabWindows/CVI and the Externa...46External Compiler Versions Supported47Required Preprocessor Definitions47Multithreading and the LabWindows/CVI Libraries47Using LabWindows/CVI Libraries in External Compile...48Include Files for the ANSI C Library and the LabWi...49Standard Input/Output Window49Resolving Callback References from .UIR Files49Linking to Callback Functions Not Exported from a ...50Resolving References from Modules Loaded at Run-Ti...51Resolving References to the LabWindows/CVI Run-Tim...51Resolving References to Symbols Not in Run-Time En...51Resolving Run-Time Module References to Symbols No...52Run State Change Callbacks Are Not Available in Ex...52Calling InitCVIRTE and CloseCVIRTE53Watcom Stack Based Calling Convention54Using Object and Library Files in External Compile...54Default Library Directives54Microsoft Visual C/C++55Borland C/C++55Watcom C/C++55Symantec C/C++55Borland Static versus Dynamic C Libraries56Borland Incremental Linker56Borland C++ Builder56Watcom Pull-in References56Creating Object and Library Files in External Comp...57Microsoft Visual C/C++57Borland C/C++57Watcom C/C++58Symantec C/C++58Creating Executables in LabWindows/CVI59Creating DLLs in LabWindows/CVI59Customizing an Import Library59Preparing Source Code for Use in a DLL60Calling Convention for Exported Functions60Exporting DLL Functions and Variables61Include File Method61Export Qualifier Method61Marking Imported Symbols in Include File Distribut...62Recommendations63Automatic Inclusion of Type Library Resource for V...63Creating Static Libraries in LabWindows/CVI64Creating Object Files in LabWindows/CVI65Calling Windows SDK Functions in LabWindows/CVI65Windows SDK Include Files65Using Windows SDK Functions for User Interface Cap...66Using Windows SDK Functions to Create Multiple Thr...66Automatic Loading of SDK Import Libraries66Setting Up Include Paths for LabWindows/CVI, ANSI ...67Compiling in LabWindows/CVI for Linking in LabWind...67Compiling in LabWindows/CVI for Linking in an Exte...67Compiling in an External Compiler for Linking in a...67Compiling in an External Compiler for Linking in L...68Handling Hardware Interrupts under Windows95/NT68Chapter 4 Windows 3.1 Compiler/Linker Issues69Using Modules Compiled by LabWindows/CVI69Using 32-Bit Watcom Compiled Modules underWindows...69Using 32-Bit Borland or Symantec Compiled Modules ...7016-Bit Windows DLLs71Helpful LabWindows/CVI Options for Working with DL...72DLL Rules and Restrictions72DLL Glue Code75DLLs That Can Use Glue Code Generated at Load Time...76DLLs That Cannot Use Glue Code Generated at Load T...76Loading a DLL That Cannot Use Glue Code Generated ...76Recognizing Windows Messages Passed from a DLL89Creating 16-bit DLLs with Microsoft Visual C++ 1.5...89Creating 16-bit DLLs with Borland C++90DLL Search Precedence91Chapter 5 UNIX Compiler/Linker Issues93Calling Sun C Library Functions93Restrictions on Calling Sun C Library Functions93Using Shared Libraries in LabWindows/CVI94Using dlopen94The LabWindows/CVI Run-Time Engine as a Shared Lib...94Creating Executables that Use the LabWindows/CVI L...95Compatible External Compilers95Static and Shared Versions of the ANSI C and Other...95Non-ANSI Behavior of Sun Solaris 1 ANSI C Library96LabWindows/CVI Implements printf and scanf96Main Function Must Call InitCVIRTE96Run State Change Callbacks Are Not Available in Ex...97Using Externally Compiled Modules98Restrictions on Externally Compiled Modules98Compiling Modules With External Compilers98Locking Process Segments into Memory Using plock()...99UNIX Asynchronous Signal Handling99Solaris 1 ANSI C Library Implementation100Replacement Functions101Additional Functions Not Found in Sun Solaris 1 li...101Incompatibilities among LabWindows/CVI, Sun Solari...102Between LabWindows/CVI and ANSI C102Between LabWindows/CVI and Sun Solaris103Chapter 6 Building Multiplatform Applications104Multiplatform Programming Guidelines104Library Issues104Externally Compiled Modules106Multiplatform User Interface Guidelines106Chapter 7 Creating and Distributing Standalone Executables a...107Introduction to the Run-Time Engine107Distributing Standalone Executables under Windows107Minimum System Requirements for Windows 95/NT107No Math Coprocessor Required for Windows 95/NT108Minimum System Requirements for Windows 3.1108Math Coprocessor Software Emulation for Windows 3....108Distributing Standalone Executables under UNIX108Distributing Standalone Executables under Solaris ...109Distributing Standalone Executables under Solaris ...110Minimum System Requirements for UNIX111Translating the Message File111Configuring the Run-Time Engine111Solaris 1 Patches Required for Running Standalone ...111Configuration Option Descriptions112cvirtx (Windows 3.1 Only)112cvidir (Windows Only)113useDefaultTimer (Windows Only)113DSTRules113UNIX Options113Necessary Files for Running Executable Programs114Necessary Files for Using DLLs Created inWindows...115Location of Files on the Target Machine for Runnin...115LabWindows/CVI Run-Time Engine under Windows 95/NT...116Run-Time Library DLLs116Low-Level Support Driver116Message, Resource, and Font Files117National Instruments Hardware I/O Libraries117LabWindows/CVI Run-Time Engine under Windows 3.1117LabWindows/CVI Run-Time Engine under Sun Solaris118Rules for Accessing UIR, Image, and Panel State Fi...118Rules for Using DLL Files under Windows 95/NT119Rules for Using DLL Files under Windows 3.1119Rules for Loading Files Using LoadExternalModule120Forcing Modules that External Modules Refer to int...121Using LoadExternalModule on Files in the Project121Using LoadExternalModule on Library and Object Fil...122Using LoadExternalModule on DLL Files under Window...123Using LoadExternalModule on DLL and Path Files und...123Using LoadExternalModule on Source Files (.c)124Rules for Accessing Other Files125Error Checking in Your Standalone Executable or DL...125Chapter 8 Distributing Libraries and Function Panels126How to Distribute Libraries126Adding Libraries to User’s Library Menu126Specifying Library Dependencies127Chapter 9 Checking for Errors in LabWindows/CVI129Error Checking130Status Reporting by LabWindows/CVI Libraries andI...131User Interface Library131Analysis/Advanced Analysis Libraries131Easy I/O for DAQ Library132Data Acquisition Library132VXI Library132GPIB/GPIB 488.2 Library132RS-232 Library133VISA Library133IVI Library133TCP Library134DDE Library134ActiveX Automation Library134X Property Library134Formatting and I/O Library134Utility Library135ANSI C Library135LabWindows/CVI Instrument Drivers135Appendix A Errors and Warnings136Appendix B Customer Communication182Electronic Services182Telephone and Fax Support183Technical Support Form184LabWindows/CVI Hardware and Software Configuration...185National Instruments Products185Other Products185Documentation Comment Form186Glossary187A187B187C188D188E188F189G189H189I190L191M191O191P191R192S192T193U193V193W194Index195Special Characters/Numbers195A195B196C196D197E198F199G199H199I199K200L200M202N202O202P203Q203R203S204T206U206V208W208X211Figures11Figure 71. Files Necessary to Run a LabWindows/CV...114Tables11Table 11. LabWindows/CVI Compiler Limits16Table 12. LabWindows/CVI Allowable Data Types21Table 13. Stack Size Ranges for LabWindows/CVI31Table 71. LabWindows/CVI Run-Time Engine Files116Table 72. Windows NT Registry Entry Values for th...117Table 73. Pathnames and Targets of Links118Table A1. Error Messages (Continued)136サイズ: 1.73MBページ数: 211Language: Englishマニュアルを開く