Creating Modular Code

You use subVIs in LabVIEW to create code that you can use in other VIs. Large block diagrams are hard to read and maintain. Identifying commonly reusable segments of code and replacing these segments with a subVI saves space and simplifies future updates to the code because when you edit the subVI, the changes affect all calls to the subVI, not just the current instance. A block diagram that contains several identical subVI nodes calls the same subVI each time.

Note��A subVI corresponds to a subroutine call in text-based programming languages.

After you build a VI, you must build a connector pane and create an icon to use it as a subVI. You then can place the subVI on the block diagram of another VI. The subVI controls and indicators receive data from and return data to the block diagram of the calling VI.