How to create a VI Snippet in LabVIEW and post in a question.
Parameters#
Parameter | Details |
---|---|
Number 1 | Numeric Control |
Number 2 | Numeric Control |
Sum | Numeric Indicator |
Create VI snippet from Block Diagram
VI snippets are like Screenshots of a Block Diagram, with one important difference. They can be opened in LabVIEW to reconstruct the orginal program. They are saved in the common .PNG
format so they can be used like normal pictures e.g. in forums and on StackOverflow.
To create a VI snippet mark the important part of your Block Diagram and hit “Edit → Create VI Snippet from Selection”. Then choose where you want to save it. The VI Snippet has a border and a icon to indicate that you can drag them into LabVIEW to add the code to your Block Diagram.
This is what a simple VI snippet looks like:
Snippet VI for summation of two numbers
Creating summation is quite easy in 3 steps
- On
front panel
, Add 2 numeric controls (number 1 and Number 2) and 1 numeric indicator (sum).
- Switch to
block diagram
(using CTRL+E) and connect Add block from numeric palette. Wire it to both numeric controls and sum indicator created in step 1. Eventually select all blocks by mouse (or by using keyboard CTRL+A .
3. Go to Edit menu, select ”create VI snippet from selection”. Save yoursnippetname.png to any location.
- You can use snippet by dragging the image to
block diagram