Right-click the mode input and select Create»Constant from the shortcut menu.
Click the mode constant and select Read (0), Write (1), ReadWrite (2), BufferedRead (3), or BufferedReadWrite (4). You also can use the DataSocket:Mode property to set the data connection mode programmatically.
Add one of the following functions to the block diagram and create controls or constants for the appropriate inputs:
Wire the connection out output of the DataSocket Read or DataSocket Write function to the connection id input of the DataSocket Close function to close the data connection. The connection also closes when the VI stops.