Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Labview Code Interface Reference Manual.pdf
Скачиваний:
33
Добавлен:
29.05.2015
Размер:
1.13 Mб
Скачать

Chapter 4 External Subroutines

external subroutine uses for global data. The following sections describe how to make this work.

External Subroutine

LabVIEW calls CINs, but only your code calls external subroutines. Instead of creating seven routines (CINRun, CINSave, and so on), you create only one entry point (LVSBMain) for an external subroutine. When another external code module calls this external subroutine, the LVSBMain subroutine executes.

LVSBMain is similar to CINRun. You can have an arbitrary number of parameters, and each parameter can be of arbitrary data type. Also, because only your code calls the subroutine, you can declare any return data type, and you do not need to place the word CIN in front of the function prototype. You will have to ensure that the parameters and return value are consistent between the calling and called code.

You compile an external subroutine almost the same way you compile a CIN. Because multiple external code modules can call the same external subroutine, LabVIEW does not load the code into a specific VI. Instead, LabVIEW loads the code from the file created by the makefile when the code is needed.

Macintosh

THINK C Compiler and CodeWarrior 68K Compiler

To make a subroutine using the THINK C Compiler, build the code resource (the .tmp file) as discussed in the Steps for Creating a CIN section of Chapter 1, CIN Overview, but leave out the CINLib library and select the subroutine option when running lvsbutil.app.

MPW Compiler

The only difference between the makefiles of subroutines and of CINs is that for a subroutine you specify a type of LVSB in your .lvm file instead of CIN. See the Steps for Creating a CIN section of Chapter 1, CIN Overview, for a discussion of the makefile contents.

Microsoft Windows 3.1, Windows 95, and

Windows NT

The only difference between the makefiles of subroutines and of CINs is that for a subroutine you specify a type of LVSB in your .lvm file

© National Instruments Corporation

4-3

LabVIEW Code Interface Reference Manual

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]