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

Chapter 2 CIN Parameter Passing

conventions as for numerics. LabVIEW stores arrays of Booleans differently; see the Arrays and Strings section of this chapter for more information.

Refnums

LabVIEW treats a refnum the same way as it treats a scalar number and passes refnums with the same conventions it uses for numbers.

Clusters of Scalars

For a cluster, LabVIEW passes a pointer to a structure containing the elements of the cluster. LabVIEW stores fixed-size values directly as components inside of the structure. If a component is another cluster, LabVIEW stores this cluster value as a component of the main cluster.

Return Value for CIN Routines

The names of the CIN routines are prefaced in the header file with the words CIN MgErr, as shown in the following example.

CIN MgErr CINRun(...);

The LabVIEW header file extcode.h, defines the word CIN to be either Pascal or nothing, depending on the platform. Prefacing a function with the word Pascal causes some C compilers to use Pascal calling conventions instead of C calling conventions to generate the code for the routine. LabVIEW uses Pascal calling conventions on the Macintosh when calling CIN routines, so the header file declares the CIN to be equivalent to Pascal on the Macintosh. On the PC and the Sun, however, LabVIEW uses standard C calling conventions, so the header file declares the CIN to be equivalent to nothing.

The MgErr data type is a LabVIEW data type that corresponds to a set of error codes that the manager routines return. If you call a manager routine that returns an error, you can either handle the error or return the error so that LabVIEW can handle it. If you can handle the errors that occur, return the error code noErr.

After calling a CIN routine, LabVIEW checks the MgErr value to determine whether an error occurred. If an error occurs, LabVIEW aborts the VI containing the CIN. If the VI is a subVI, LabVIEW aborts the VI that contains the subVI. This behavior enables LabVIEW to handle conditions when a VI runs out of memory. By aborting the

© National Instruments Corporation

2-3

LabVIEW Code Interface Reference Manual

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