Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Using External Code in LabVIEW.pdf
Скачиваний:
49
Добавлен:
29.05.2015
Размер:
1.85 Mб
Скачать

4

Programming Issues for CINs

This chapter describes the data structures LabVIEW uses when passing data to a CIN and describes the function libraries, called managers, which you can use in external code modules. These include the memory manager, the file manager, and the support manager.

Passing Parameters

LabVIEW passes parameters to the CINRun routine. These parameters correspond to each of the wires connected to the CIN. You can pass any data type to a CIN you can construct in LabVIEW; there is no limit to the number of parameters you can pass to and from the CIN.

Parameters in the CIN .c File

When you right-click a CIN on a block diagram and select Create .c File, LabVIEW creates a .c file in which you can enter your CIN code. The CINRun function and its prototype are given, and its parameters correspond to the data types being passed to the CIN in the block diagram. Refer to the

CIN Routines section in Chapter 5, Advanced Applications, for more information about CIN routines (CINInit, CINLoad, and so on).

The .c file created is a standard C file, except LabVIEW gives the data types unambiguous names. C does not define the size of low-level data types—the int data type might correspond to a 16-bit integer for one compiler and a 32-bit integer for another compiler. The .c file uses names explicit about data type size, such as int16, int32, float32, and so on. LabVIEW includes a header file, extcode.h, that contains typedefs associating these LabVIEW data types with the corresponding data type for the supported compilers of each platform.

extcode.h defines some constants and types whose definitions may conflict with the definitions of system header files. The LabVIEW cintools directory also contains the hosttype.h file, which resolves these differences. This header file also includes many of the common header files for a given platform.

© National Instruments Corporation

4-1

Using External Code in LabVIEW

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