Place a CIN on a block diagram.
A CIN has terminals with which you can indicate which data pass to and from a CIN. Initially, the CIN has one set of terminals, and you can pass a single value to and from the CIN. To add additional terminals, you can resize the node, or right-click the node and select Add Parameter from the shortcut menu.
Each pair of terminals corresponds to a parameter LabVIEW passes to the CIN. The two types of terminal pairs are input-output and output-only.
By default, a terminal pair is input-output. The left terminal is the input terminal. The right terminal is the output terminal. For example, the CIN in the following illustration has a single terminal pair with a 32-bit signed integer control wired to the input terminal and a 32-bit signed integer indicator wired to the output terminal.
When the VI calls the CIN, the only argument LabVIEW passes to the CIN object code is a pointer to the value of the 32-bit signed integer input. When the CIN completes, LabVIEW then passes the value referenced by the pointer to the 32-bit signed integer indicator. When you wire controls and indicators to the input terminal and the output terminal of a terminal pair, LabVIEW assumes the CIN can modify the data passed. If another node on the block diagram needs the input value, LabVIEW might have to copy the input data before passing it to the CIN.
The CIN in the following illustration has a 32-bit signed integer control wired to the input terminal but no indicator wired to the output terminal.
If you do not wire an indicator to the output terminal of a terminal pair, LabVIEW assumes the CIN does not modify the value you pass to it. If another node on the block diagram uses the input data, LabVIEW does not copy the data. The source code should not modify the value passed into the input terminal of a terminal pair if you do not wire the output terminal. If the CIN does modify the input value, nodes connected to the input terminal wire might receive the modified data.
If you use a terminal pair only to return a value, make it an output-only terminal pair by resizing the CIN, right-clicking the terminal pair, and selecting Output Only from the shortcut menu. If a terminal pair is output-only, the input terminal is gray, as shown in the following illustration.
For output-only terminals, LabVIEW creates storage space for a return value and passes the value by reference to the CIN, the same way it passes values for input-output terminal pairs. If you do not wire a control to the left terminal, LabVIEW determines the type of the output parameter by checking the type of the indicator wired to the output terminal. This can be ambiguous if you wire the output to two destinations that have different data types. To solve this problem, wire a control to the input terminal of the terminal pair as shown in the illustration above. In this case, the output terminal takes on the same data type as the input terminal. LabVIEW uses the input data type only to determine the data type for the output terminal. The CIN does not use or affect the data of the input wire.
To remove a pair of terminals from a CIN, right-click the terminal you want to remove and select Remove Parameter from the shortcut menu. LabVIEW disconnects wires connected to the deleted terminal pair. Wires connected to terminal pairs below the deleted pair remain attached to those terminals and stretch to adjust to the positions.
After you set the inputs and outputs for the CIN, wire the inputs and outputs.