You can save snippets of code, or a VI snippet, from the block diagram to reuse later or to share with other LabVIEW users. LabVIEW embeds the code into a .png image file. The image shows a picture of your code and contains the actual code you specify.
Complete the following steps to reuse a snippet of code from the block diagram.
|Note Do not select a section of code that contains an unsaved subVI. If you include a subVI in the section of code, you first must save the subVI on disk.|
|Note (Linux) You can save and share VI snippets to show images of code, but you cannot drag and drop VI snippets onto the block diagram to use the code.|
LabVIEW does not embed subVIs in the .png file. Any subVIs called in the VI snippet must be present on the computer when a user drops the .png file onto the block diagram. Otherwise, the VI snippet contains broken code.
When you open a VI snippet .png file with image editing software, LabVIEW displays the version of LabVIEW in which the VI snippet was saved in the upper right-hand corner of the image. To use the code of a VI snippet, the version of LabVIEW you are running must be the same as or later than the version of LabVIEW in which the VI snippet was saved.
|Note If you save a VI snippet .png file with the image editing software, that software might remove the code from the .png file. If you then add the .png file to the block diagram, only the image appears on the block diagram, not the code. To avoid losing the code, do not save the .png file with the image editing software.|