⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.txt

📁 Creating a Simple CIN in CVI and Using It in LabVIEW
💻 TXT
字号:
1.  Open a new VI in LabVIEW 4.x or later and place a CIN on the block diagram.
   
2.  Create controls and indicators on the front panel.
   
3.  Wire the front panel terminals to the CIN depending on which function you want to create. For this simple addition example, two numeric terminals are wired to inputs and one numeric terminal is wired to an output.
   
4.  Right-click the CIN and select Create .c File from the shortcut menu.
   
5.  Save the .c file (add.c for this example).
   
6.  Save the VI (add.vi) and close LabVIEW.
   
7.  Open CVI 4.x or later and create a new project. This example was created in CVI 5.5.
   
8.  Add the following files to the project and save the project:
         The source file(s) for the CIN (add.c for this example)
         cvilvsb.h (in labview\cintools)
    
         This example was created in MS Visual C++ Compatibility Mode, so the following files were added:
             lvsb.lib (from labview\cintools\win32)
             labview.lib (from labview\cintools\win32)
             getcin.obj (from labview\cintools\win32)
   
   Note: The win32 directory might not exist, in which case the files are in the cintools directory.
    
  Refer to the cvilvsb.h file for the files to add for the Symantec compatibility Mode in CVI. Also, LabVIEW currently supplies only library and object files for MSVC and        
  Symantec compatibility modes, so you cannot use WATCOM or Borland.
To complete this task, complete the following steps.
  
     
1.  In the source file(s) for the CIN, place the following statement before any struct definitions that will be passed to LabVIEW:
         #pragma pack(1)
             
          Place the following statement after these definitions:
                 #pragma pack()
   
           Note: This example does not use any struct definitions, so these statements are unnecessary in this case.
   
2.  Add the following statements to the main CIN source file: 
         #include "cvilvsb.h"
          void *dummyPointer = GetLVSBHeader;
    
3.  In the Build menu of the CVI Project window, change the Target to Dynamic Link Library.
   
4.  Select the Include Paths command in the Options menu of the Project window.  Add the cintools directory to the project include paths.
   
5.  Select the Create Dynamic Link Library command in the Build menu of the Project window. The project should compile and link successfully, and a dialog box 
     should appear. In the dialog box, complete the following steps.
    
            a.  Set the pathname of the DLL to create.
            b.  In the Export section, click the Change button. In the dialog box, set the Export What drop-down menu to Include File Symbols. 
            c.  Place a checkmark next to cvilsvb.h in the list.
            d.  Click the OK button.
   
6.  In a DOS box, complete the following steps.
   
            a.  Change directory to the location of the built DLL (for example, cd c:\).
            b.  Run the following command, where c:\labview is the directory where LabVIEW is installed and mydll is the name of the DLL without the .dll extension. You 
                 might need the win32 directory, depending on where lvsbutil.exe is installed.
                 c:\labview\cintools\win32\lvsbutil mydll
    
                 Note: You must use the MS-DOS name of each of the directories. To view this name, right-click the directory in Windows Explorer and select Properties         
                 from the shortcut menu. The name should look similar to this for this example:
                        c:\progra~1\nation~1\labvie~1\cintools\lvsbutiladd
   
7.  Open the VI (add.vi), right-click the CIN, and select Load Code Resource from the shortcut menu.
   
8.  Select the .lsb file created in the previous step, which should be in the same directory as the DLL. The run arrow in the toolbar should no longer be broken.
   
9.  Run the VI and the function should be completed

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -