labview中cin节点调用(VC)

来自:Using External Code in LabVIEW.pdf (NI公司)

Microsoft Windows
To build CINs for LabVIEW for Windows, use the Microsoft Visual C++
or Symantec C compilers.
Visual C++ IDE
Complete the following steps to build CINs using the Visual C++
integrated development environment (IDE).
1. Select File»New to create a new DLL project.
2. Select Win32 Dynamic-Link Library as the project type. You can
name your project whatever you want.
3. Select An empty DLL project when prompted to choose the type of
DLL that you want to create and click Finish.
4. Select Project»Add To Project»Files and navigate to your .c file.
Select your .c file and click the Open button to add the .c file to the
project.
5. Select Project»Add To Project»Files to add CIN objects and libraries
to the project. Select cin.obj, labview.lib, lvsb.lib, and
lvsbmain.def from the Cintools subdirectory. You need these files
to build a CIN.
6. Select Project»Settings and change Settings For to All
Configurations. Click the C/C++ tab and set the category to
Preprocessor. Add the path to your Cintools directory in the
Additional include directories field.
7. Select Project»Settings and change Settings For to All
Configurations. Click the C/C++ tab and set the category to Code
Generation. Select the Struct member alignment tab and select 1
byte.
8. Choose a run-time library. Select Project»Settings and change
Settings for to All Configurations. Select the C/C++ tab and set the
category to Code Generation. Select Multithreaded DLL in the Use
run-time library control.
Chapter 3 CINs
Using External Code in LabVIEW 3-16 ni.com
9. Make a custom build command to run lvsbutil. Select
Project»Settings and change Settings for to All Configurations.
Select the Custom Build tab and change the Commands field as
follows, with the code all on a single line:
<your path to cintools>/lvsbutil “$(TargetName)” -d
"$(WkspDir)/$(OutDir)"
Change the Output fields to $(OutDir)$(TargetName).lsb.
10. (For Visual C++.NET compiler only) Add
<CINTOOLSDIR>/lvsbmain.def to the Linker»Input»Module
Definition File field.
11. Click the File View tab in the Work Space window.
12. Open your .c file and replace /* Insert code here */ with your
code.
13. Select Build»Build projectName.dll, where projectName is the name
of your project.
Visual C++ Command Line
This section describes using command line tools in Windows to build
CINs.
1. Add a CINTOOLSDIR definition to your list of user environment
variables.
(Windows 2000/NT/XP) You can edit this list with the System control
panel accessory. For example, if you installed LabVIEW for Windows
in c:/Program Files/National Instruments/LabVIEW x.x,
the CIN tools directory should be c:/Program Files/National
Instruments/LabVIEW x.x/cintools, where x.x is the
LabVIEW version number. In this instance, you would add the
following line to the user environment variables using the System
control panel:
CINTOOLSDIR = c:/Program Files/National
Instruments/LabVIEW x.x/cintools
(Windows Me/98) Modify your AUTOEXEC.BAT to set CINTOOLSDIR to
the correct value.
2. Build a .lvm file (LabVIEW Makefile) for your CIN. You must
specify the following items:
• name is the name of your CIN, for example, mult.
• type is CIN.
• !include $(CINTOOLSDIR)/ntlvsb.mak
Chapter 3 CINs
© National Instruments Corporation 3-17 Using External Code in LabVIEW
To define additional include paths for a CIN you must add a
CINCLUDES line to the .lvm file, as shown in the following example
code:
CINCLUDE = -Ipathnames
You must include the -I argument on the line. pathnames is the
directory where you look for other includes.
If your CIN uses extra object files, you can specify the objFiles
option. You do not need to specify the codeDir parameter because the
code for the CIN must be in the same directory as the makefile. You do
not need to specify the wcDir parameter because the CIN tools can
determine the location of the compiler.
You can compile the CIN code using the following command, where
mult is the makefile name:
nmake /f mult.lvm
If you want to use standard C or Windows libraries, define the symbol
cinLibraries. For example, to use standard C functions in the
previous example, you could use the following .lvm file:
name = mult
type = CIN
cinLibraries=libc.lib
!include $(CINTOOLSDIR)/ntlvsb.mak
To include multiple libraries, separate the list of library names
with spaces. 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
LabVIEW调用库函数节点.rar是一个经过压缩的文件,其包含了使用LabVIEW编程软件调用库函数节点所需要的文件及相关文档。 LabVIEW是一种图形化编程语言,可用于开发控制、测试和测量应用程序。它具有强大的功能和易于使用的界面,使得用户可以通过简单拖拽和连接节点来创建程序。LabVIEW还提供了许多库函数节点,这些节点可以加快开发过程并提供更丰富的功能。 库函数是预先编写好的一些函数,可以通过调用它们来完成特定的功能。在LabVIEW,通过调用库函数节点可以将库函数集成到程序。这种方式可以让用户直接使用库函数的功能,而无需编写大量的代码。 LabVIEW调用库函数节点.rar文件提供了一些预先编译好的库函数节点,这些节点可以帮助用户在LabVIEW轻松地调用外部库函数。这个文件可能会包含一些不同的文件和文档,如VI文件(LabVIEW的程序文件)、DLL文件(动态链接库文件)以及相关的文档和说明。 使用这个.rar文件,用户可以将库函数节点添加到自己的LabVIEW程序,从而利用库函数的各种功能。通过调用这些库函数节点,用户可以在程序实现更复杂的操作,比如高级的数学计算、图像处理、数据通信等。 总之,LabVIEW调用库函数节点.rar是一个方便用户使用LabVIEW编程软件调用库函数的文件,它为用户提供了更多的功能和选择,帮助用户在LabVIEW开发出更强大、更高效的应用程序。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值