You can designate terminals on the CIN as either input-output or output-only. Regardless of the designation, LabVIEW passes data by reference to the CIN. When modifying a parameter value, follow the rules for each kind of terminal. LabVIEW passes parameters to the CINRun routines in the same order as you wire data to the CIN. The first terminal pair corresponds to the first parameter. The last terminal pair corresponds to the last parameter.
LabVIEW passes numeric data types to CINs by passing a pointer to the data as an argument. In C, this means LabVIEW passes a pointer to the numeric data as an argument to the CIN.
LabVIEW stores Boolean data types in memory as 8-bit integers. If any bit of the integer is 1, the Boolean data type is TRUE. Otherwise, the Boolean data type is FALSE. LabVIEW passes Boolean data types to CINs with the same conventions it uses for numeric objects.
LabVIEW treats a refnum the same way as a scalar number and passes refnums with the same conventions it uses for numbers.
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 cluster component is another cluster, LabVIEW stores the component cluster value as a component of the main cluster.
The names of the CIN routines are prefaced in the header file with the words CINMgErr, as shown in the following example code:
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 standard C calling conventions, so the header file declares the word CIN to be equivalent to nothing.
The MgErr data type is a LabVIEW data type corresponding to a set of error codes 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 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 containing the subVI. Aborting the running VI enables LabVIEW to handle conditions when a VI runs out of memory. By aborting the running VI, LabVIEW can possibly free enough memory to continue running correctly.
The following topics describe how to create CINs that work with scalar data types: