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

Chapter 2 CIN Parameter Passing

with the corresponding C data type for the compiler you are using. In addition to defining LabVIEW data types, extcode.h also prototypes LabVIEW routines that you can access. These data types and routines are described in Chapter 5, Manager Overview, of this manual and in the Online Reference.

Note: The line #include "extcode.h" must be a full pathname to extcode.h under THINK C. For example: #include

"harddrive:cintools:extcode.h"

Optionally, System 7.x users can use the Aliases folder technique described in the THINK C for 68K subsection of Chapter 1, CIN Overview, to enable the include line to read #include "extcode.h".

For this multiplication example, simply fill in the code for the CINRun routine. You do not have to use the variable names that LabVIEW gives you in CINRun; you can change them to increase the readability of the code.

CIN MgErr CINRun (float32 *A, float32 *B, float32 *A_B);

{

*A_B = *A**B; return noErr;

}

CINRun multiplies the values to which A and B refer and stores the results in the location to which A_B refers. It is important that CIN routines return an error code, so that LabVIEW knows if the CIN encountered any fatal problems and handles the error correctly.

If you return a value other than noErr, LabVIEW stops the execution of the VI.

5. Compile the CIN Source Code

After creating the source code, you need to compile it and convert it into a form that LabVIEW can use. The following sections summarize the steps for each of the supported compilers.

Note: Step 5 is different for each platform. Look under the heading for your platform and compiler in the following sections to find the instructions for your system. For details, refer to the relevant subsection within the

Compile the CIN Source Code section in Chapter 1, CIN Overview.

LabVIEW Code Interface Reference Manual

2-6

© National Instruments Corporation

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