To create a sub VI, follow these steps:
Right click on Block Diagram and from Instrument I/O choose the VISA pallet.
From the VISA pallet:
Place a "VISA Configure serial port".
Connect a "Control" to the input.
Default baud rate is 9600 and you may connect a constant to it, or just leave it to use the default value.
Place a "VISA write" and connect the serial reference wire and error wires.
Add a control to the input wire of the "VISA write".
Place a variable control delay (use Functions Programming Structures Flat sequence).
Place a "VISA Property Node" and connect the serial reference line. Right click on the property node and choose "Bytes at Port".
Place a "Read Visa" and connect the input and output wires as diagram here:
Finally, create a SUB VI.