<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://labviewwiki.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=P7s6yZ5w</id>
	<title>LabVIEW Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://labviewwiki.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=P7s6yZ5w"/>
	<link rel="alternate" type="text/html" href="https://labviewwiki.org/wiki/Special:Contributions/P7s6yZ5w"/>
	<updated>2026-04-26T10:57:41Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://labviewwiki.org/w/index.php?title=Snippet&amp;diff=4602</id>
		<title>Snippet</title>
		<link rel="alternate" type="text/html" href="https://labviewwiki.org/w/index.php?title=Snippet&amp;diff=4602"/>
		<updated>2011-11-03T10:04:01Z</updated>

		<summary type="html">&lt;p&gt;P7s6yZ5w: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOCright}}&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A snippet is in the [[LabVIEW|LabVIEW]] context an image of LabVIEW code.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[http://zone.ni.com/devzone/cda/tut/p/id/9330 LabVIEW 2009 introduced] the embedding of the actual code inside a [http://en.wikipedia.org/wiki/Portable_Network_Graphics PNG] image.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this functionality it is possible to expose your code on a website, and with the same file import the code into a LabVIEW [[VI|VI]].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Creation&amp;lt;br&amp;gt;  =&lt;br /&gt;
&lt;br /&gt;
LabVIEW 2009 has native support to create a snippet.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the [[Code Capture Tool|Code Capture Tool]] version 2.0 it&#039;s possible to create a snippet in any LabVIEW version from 7.0 and up.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Importing&amp;lt;br&amp;gt;  =&lt;br /&gt;
&lt;br /&gt;
== LabVIEW 2009&amp;lt;br&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
To import the actual code into a VI, just drag and drop the image onto the block diagram of a VI. With [http://www.microsoft.com/Windows/internet-explorer/ Internet Explorer] it&#039;s possible to drag and drop the image for a web-page into a VI&amp;amp;nbsp;directly.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For [http://www.mozilla.com/firefox/ Firefox] and [http://www.google.com/chrome Google Chrome] it&#039;s necessary to drop the image in an OS folder or use a plugin [http://addons.mozilla.org/firefox/addon/1419 IETab] (for Firefox).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LabVIEW 8.2, 8.5 and 8.6&amp;lt;br&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
To import a snippet into LabVIEW 8.2 it&#039;s possible if the snippet is created with the [[Code Capture Tool|Code Capture Tool]] in the same (or an older) version of LabVIEW. Second you need a special tool developed by [http://lavag.org/user/7534-jcarmody/ JCarmody]. This tool is available for [http://lavag.org/index.php?app=downloads&amp;amp;showfile=118 download] in the LAVA Uncertified Code Repository.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Technique&amp;lt;br&amp;gt;  =&lt;br /&gt;
&lt;br /&gt;
The code of a LabVIEW snippet is stored inside a [http://en.wikipedia.org/wiki/Portable_Network_Graphics#.22Chunks.22_within_the_file PNG Chunk] named &#039;niVI&#039;. The capitalization of this chunkname makes sure the code is removed if someone alters the image, thus preventing the creation of malicious snippets.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Inside this chunk a filestream representing a VI is stored. LabVIEW interprets this as a normal VI to be embedded.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code integrity&amp;lt;br&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
Technically it&#039;s possible to have a different codeset embedded than represented by the PNG image chunk. This is proven by [http://forums.ni.com/ni/view_profile?user.id=134255 Darin.K] on the [[NI Forums|NI Forum]] with the following snippet:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:MerrimanSnippet.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[http://forums.ni.com/ni/board/message?board.id=BreakPoint&amp;amp;view=by_date_ascending&amp;amp;message.id=8610#M8610 Source ]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Upon dropping this image on a LabVIEW diagram another image was placed.&lt;br /&gt;
&lt;br /&gt;
The name of the Snippet Chunk (niVI), describes this chunk as [http://www.w3.org/TR/2003/REC-PNG-20031110/#5Chunk-naming-conventions unsave to copy], tests with Paint.net shows that indeed the chunk is removed when the image is altered. However usage of Microsoft Paint show that the snippet is not removed upon editing of the image.&lt;/div&gt;</summary>
		<author><name>P7s6yZ5w</name></author>
	</entry>
</feed>