<?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=Daklu</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=Daklu"/>
	<link rel="alternate" type="text/html" href="https://labviewwiki.org/wiki/Special:Contributions/Daklu"/>
	<updated>2026-05-10T20:14:19Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://labviewwiki.org/w/index.php?title=List_of_acronyms&amp;diff=5298</id>
		<title>List of acronyms</title>
		<link rel="alternate" type="text/html" href="https://labviewwiki.org/w/index.php?title=List_of_acronyms&amp;diff=5298"/>
		<updated>2013-05-17T13:00:41Z</updated>

		<summary type="html">&lt;p&gt;Daklu: added AOD, AOP, and EIP&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Acronyms and abbreviations:&lt;br /&gt;
&lt;br /&gt;
* A/D - Analog/Digital&lt;br /&gt;
* ADatP - Automated Data Processing&lt;br /&gt;
* AKA - Also Known As&lt;br /&gt;
* ANSI - American National Standards Institute&lt;br /&gt;
* AOD - Actor-Oriented Design&lt;br /&gt;
* AOP - Actor-Oriented Programming&lt;br /&gt;
* API - Application Programming Interfaces&lt;br /&gt;
* ASCII - American Standard Code for Information Interchange&lt;br /&gt;
* BTW - By The Way&lt;br /&gt;
* BYOB - Bring Your Own Beer&lt;br /&gt;
* CAPTCHA - Completely Automated Public Turing test to tell Computers and Humans Apart ... an example would be the questions at the end of online forums that says &amp;quot;type the word you see in this image to continue.&amp;quot; They&#039;re supposed to filter out robots and automated systems and only allow real sentient beings to continue.&lt;br /&gt;
* CCT - [[Code Capture Tool]]&amp;lt;br/&amp;gt;&lt;br /&gt;
* DA - Dumb @$$&lt;br /&gt;
* DAQ / DAQmx - Data Acquisition&lt;br /&gt;
* DB - Database&lt;br /&gt;
* DILLIGAF - Do I Look Like I Give A F#ck?&lt;br /&gt;
* DIY - Do It Yourself&lt;br /&gt;
* DMA - Direct Memory Access&lt;br /&gt;
* EIP - [http://sine.ni.com/nips/cds/view/p/lang/en/nid/209676 Ethernet/IP] &lt;br /&gt;
* FIFO - First In, First Out&lt;br /&gt;
* FKA - Formerly Known As&lt;br /&gt;
* FYI - For Your Information&lt;br /&gt;
* GL - Graphics Language&lt;br /&gt;
* GNU - GNU&#039;s Not Unix&lt;br /&gt;
* GOOP - Graphical Object-Oriented Programming; see also LVOOP and LabVOOP&lt;br /&gt;
* GPL - GNU General Public License&lt;br /&gt;
* GPS - Global Positioning System&lt;br /&gt;
* GUI - Graphical User Interface&lt;br /&gt;
* GUID - Globally Unique IDentifier&lt;br /&gt;
* HF - High Frequency&lt;br /&gt;
* HH - Homework Hustlers&lt;br /&gt;
* HTML - HyperText Markup Language&lt;br /&gt;
* IMHO - In My Humble Opinion&lt;br /&gt;
* IMNSHO - In My Not So Humble Opinion&lt;br /&gt;
* IMO - In My Opinion&lt;br /&gt;
* IP - Internet Protocol&lt;br /&gt;
* IR - Infrared&lt;br /&gt;
* IT - Information Technology&lt;br /&gt;
* JDK - Java Development Kit&lt;br /&gt;
* JK - Just Kidding&lt;br /&gt;
* JVM - Java Virtual Machine&lt;br /&gt;
* LabVOOP - LabVIEW Object Oriented Programming; this version is not preferred by NI (as of July 2007) but is easier to pronounce and may gain currency given time.&lt;br /&gt;
* LED - Light-Emitting Diode&lt;br /&gt;
* LF - Low Frequency&lt;br /&gt;
* LIFO - Last In, First Out&lt;br /&gt;
* LOL - Laughing Out Loud&lt;br /&gt;
* LVOOP - LabVIEW Object Oriented Programming (pronounced &amp;quot;el-voop&amp;quot;); see also GOOP and LabVOOP&lt;br /&gt;
* LQTM - Laughing Quietly To Myself&lt;br /&gt;
* MAX - [[MAX|Measurement &amp;amp; Automation Explorer]]&lt;br /&gt;
* MXI - Measurement eXtensions for Instrumentation&lt;br /&gt;
* MYOB - Mind Your Own Business&lt;br /&gt;
* NaN - Not A Number&lt;br /&gt;
* N00b - Newbie&lt;br /&gt;
* ODBC - Open DataBase Connectivity&lt;br /&gt;
* OEM - Original Equipment Manufacturer&lt;br /&gt;
* OMG - Oh, My God!&lt;br /&gt;
* OO - Object Oriented&lt;br /&gt;
* P2P - Peer-to-Peer&lt;br /&gt;
* PCI - Peripheral Component Interconnect&lt;br /&gt;
* PS - Post Scriptum (Latin, &amp;quot;written after&amp;quot;)&lt;br /&gt;
* PS - Power Supply&lt;br /&gt;
* PXI - PCI eXtensions for Instrumentation&lt;br /&gt;
* RT - Real Time&lt;br /&gt;
* RTFM - Read The F#cking/Fine Manual&lt;br /&gt;
* RTSI - Real-Time System Integration&lt;br /&gt;
* TCP - Transmission Control Protocol&lt;br /&gt;
* TMI - Too Much Information&lt;br /&gt;
* VBA - Visual Basic for Applications&lt;br /&gt;
* VI - Virtual Instrument&lt;br /&gt;
* VISTA : Virus Inside Switch To Apple&lt;br /&gt;
* VIT - Virtual Instrument Template&lt;br /&gt;
* VOIP - Voice Over Internet Protocol&lt;br /&gt;
* W3C - World Wide Web Consortium&lt;br /&gt;
* WTF - What The F#ck? ... sometimes voiced using the US military names for the letters, &amp;quot;Whisky Tango Foxtrot?!&amp;quot;&lt;br /&gt;
* XML - eXtensible Markup Language&lt;br /&gt;
&lt;br /&gt;
[[Category:Lists]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Lists]]&lt;/div&gt;</summary>
		<author><name>Daklu</name></author>
	</entry>
	<entry>
		<id>https://labviewwiki.org/w/index.php?title=Mercurial&amp;diff=5297</id>
		<title>Mercurial</title>
		<link rel="alternate" type="text/html" href="https://labviewwiki.org/w/index.php?title=Mercurial&amp;diff=5297"/>
		<updated>2013-05-17T12:46:42Z</updated>

		<summary type="html">&lt;p&gt;Daklu: /* Configure */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction  =&lt;br /&gt;
&lt;br /&gt;
{{TOCright}}[[Image:Logo.Mercurial.png|right]]&lt;br /&gt;
&lt;br /&gt;
Mercurial is a [[Source Code Control|Source Code Control]] system by Selenic, it&#039;s key feature is the distributed nature of the system. This means that changes (commits) are stored in a local repository, which can be sent (pushed) to a central repository and which can be downloaded (pulled) by others.&lt;br /&gt;
&lt;br /&gt;
= Getting started =&lt;br /&gt;
&lt;br /&gt;
Joel Spolsky has written a How-To and Why-To page called [http://Www.hginit.com HG init] (hg is the chemical symbol for Mercury).&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
&lt;br /&gt;
Mercurial stores it&#039;s setting in a file called &#039;hgrc&#039; inside a hidden folder &#039;.hg&#039;&lt;br /&gt;
&lt;br /&gt;
== Setting up LVMerge  ==&lt;br /&gt;
&lt;br /&gt;
[http://zone.ni.com/reference/en-XX/help/371361F-01/lvhowto/configmerge_thirdparty/ LVMerge] can be used by Mercurial as a Merge tool. Add the following text to the hgrc file:&lt;br /&gt;
&amp;lt;pre&amp;gt;[merge-tools]&lt;br /&gt;
LVMerge.args = $base $other $local $output&lt;br /&gt;
LVMerge.executable = C:\Program Files\National Instruments\Shared\LabVIEW Merge\LVMerge.exe&lt;br /&gt;
LVMerge.gui = True&lt;br /&gt;
LVMerge.binary = True&lt;br /&gt;
[merge-patterns]&lt;br /&gt;
**.vi = LVMerge&lt;br /&gt;
**.ctl = LVMerge&lt;br /&gt;
**.lvclass = LVMerge&lt;br /&gt;
**.xctl = LVMerge&lt;br /&gt;
**.lvlib =LVMerge&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now use TortoiseHG to perfrom a merge ([[Merge with TortoiseHG|How-To]])&lt;br /&gt;
&lt;br /&gt;
[[Category:SCC]]&lt;br /&gt;
&lt;br /&gt;
== Setting up LVDiff ==&lt;br /&gt;
&lt;br /&gt;
[http://meta-diff.sourceforge.net/ LVDiff] is a software package that uses the built in diff-functionality from LabVIEW to do command line based LVDiffs.&lt;br /&gt;
&lt;br /&gt;
=== Download ===&lt;br /&gt;
&lt;br /&gt;
First thing is to [http://meta-diff.sourceforge.net/ download] LVDiff, copy the contents of the zip-file to a location where you have writing priviliges (lvdiff uses a local ini file).&amp;lt;br /&amp;gt;&lt;br /&gt;
Alternative: Installer from [http://decibel.ni.com/content/groups/mercurial NI Community Mercurial User Group]&lt;br /&gt;
&lt;br /&gt;
=== Adjust ===&lt;br /&gt;
&lt;br /&gt;
Then you need to open up the lvdiff.vi and implement these changes.&lt;br /&gt;
&lt;br /&gt;
[[Image:Lvdiffcopy.png]]&lt;br /&gt;
&lt;br /&gt;
This snippet (the actual code inside lvdiff copy is shown) tests if the filenames are the same and if that&#039;s the case it calls a VI called lvdiffcopy, which creates a copy of the file2.&lt;br /&gt;
For LabVIEW 2011 (and up) a patch file is available, use this to replace lvdiff.vi in the lvdiff installer folder[[File:Lvdiff_2011_patch.vi|lvdiff 2011 patch]].&lt;br /&gt;
&lt;br /&gt;
=== Configure ===&lt;br /&gt;
&lt;br /&gt;
To be able to select lvdiff as the diff tool you need to add the following settings to the [merge-tools] section of the hgrc configuration file:&lt;br /&gt;
&amp;lt;pre&amp;gt;lvdiff.diffargs = $child $parent&lt;br /&gt;
lvdiff.executable =C:\Program Files\lvdiff\lvdiff.exe&lt;br /&gt;
lvdiff.gui = True&lt;br /&gt;
lvdiff.binary = True&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are using TortoiseHg 1.0 or later, you can add a [diff-patterns] section to your hgrc file, analogous to the merge-patterns section mentioned above. This will enable automatic selection of the visual diff tool (see [http://tortoisehg.bitbucket.org/manual/1.0/common.html#word-diffs]):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[diff-patterns]&lt;br /&gt;
**.vi = lvdiff&lt;br /&gt;
**.ctl = lvdiff&lt;br /&gt;
**.lvclass = lvdiff&lt;br /&gt;
**.xctl = lvdiff&lt;br /&gt;
**.lvlib = lvdiff&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Start LVDiff ===&lt;br /&gt;
&lt;br /&gt;
You can start lvdiff in TorsoiseHg in the &#039;commit&#039; dialog with right-click and &#039;Visual Diff&#039;:&lt;br /&gt;
&lt;br /&gt;
[[Image:StartVisualDiff.png]]&lt;br /&gt;
&lt;br /&gt;
In the following dialog, select &#039;LVDiff&#039; and double click on the VI to diff:&lt;br /&gt;
&lt;br /&gt;
[[Image:HG_LVDIffStart.png]]&lt;br /&gt;
&lt;br /&gt;
After this LVdiff will launch LabVIEW and both VI (current and committed) will be compared.&lt;br /&gt;
&lt;br /&gt;
== Ignoring files ==&lt;br /&gt;
&lt;br /&gt;
Mercurial stores general ignore patterns in a file called &#039;.hgignore&#039; in the repository root, so you can add the patterns to the repository. I use the following patterns&lt;br /&gt;
&amp;lt;pre&amp;gt;.ogp$&lt;br /&gt;
/built*$&lt;br /&gt;
/build*$&lt;br /&gt;
.lvlps$&lt;br /&gt;
.aliases$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Globally ignoring files ===&lt;br /&gt;
If you&#039;re using TortoiseHG you can use a global ignore file, by adding the following in your %profile%\mercurial.ini file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ui]&lt;br /&gt;
...&lt;br /&gt;
ignore = %userprofile%\.hgignore&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Next to the mercurial.ini file you create the reference .hgignore file with the contents of your choice ([http://programmer.brettveenstra.com/2010/02/27/mercurial-on-windows-tip-global-ignore-file/ source]).&lt;br /&gt;
&lt;br /&gt;
= Performing a merge  =&lt;br /&gt;
&lt;br /&gt;
The following conditions needs to be true to be able to perform a merge:&lt;br /&gt;
&lt;br /&gt;
*All local changes needs to be commited (hg st should only show&amp;amp;nbsp;?)&lt;br /&gt;
*A changeset is pushed by another user to the central repository&lt;br /&gt;
*The other changeset is not yet pulled&lt;br /&gt;
&lt;br /&gt;
The merge will try to detect the differences and call LVMerge if necesarry, LVmerge will show four VIs:&lt;br /&gt;
&lt;br /&gt;
*Base, the base VI which was present in the changeset that is the same on both repositories&lt;br /&gt;
*Mine, local commited VI&lt;br /&gt;
*Their, remote VI with edits from the other user&lt;br /&gt;
&lt;br /&gt;
These are not editable.&lt;br /&gt;
&lt;br /&gt;
*Resulting, this is the VI that will be stored to disc after the merge finalizes. This file can be edited by the user&lt;br /&gt;
&lt;br /&gt;
For each diff LVMerge will give options to use either, &#039;base&#039;, &#039;mine&#039; or &#039;their&#039; code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After the merge the code should be committed and pushed.&lt;br /&gt;
&lt;br /&gt;
Most Mercurial Clients will show a graph with the following layout:&lt;br /&gt;
&lt;br /&gt;
[[Image:MergeTrackHG.png|border]]&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the same graph from the &#039;other&#039; user, which actually performed the merge:&lt;br /&gt;
&lt;br /&gt;
[[Image:MergeTrackHG_Other.png|border]]&lt;br /&gt;
&lt;br /&gt;
Here you see the opposite actions, two changesets in the local repo and one in the remote. Only difference is the moment of branching.&lt;br /&gt;
&lt;br /&gt;
= Mercurial clients  =&lt;br /&gt;
&lt;br /&gt;
On Windows[[Image:Logo.Windows.png]], Mac[[Image:Logo.Mac.png]] and&amp;amp;nbsp; Linux [[Image:Logo.Linux.png]], there is a command line client called &#039;hg&#039;. On windows there is a context menu tool called [http://tortoisehg.bitbucket.org TortoiseHG] based on the popular TortoiseSVN and TortoiseCVS tools&lt;br /&gt;
&lt;br /&gt;
= External Links  =&lt;br /&gt;
&lt;br /&gt;
*[http://mercurial.selenic.com Official website]&lt;br /&gt;
*[http://www.hginit.com HG Init]&lt;br /&gt;
*[http://hgbook.red-bean.com/ Mercurial: The Definitive Guide]&lt;br /&gt;
*[http://redline6561.livejournal.com/362393.html Setting Up Mercurial with Apache]&lt;br /&gt;
*[http://kiln.stackexchange.com Kiln / Mercurial Knowledge site]&lt;br /&gt;
*[http://decibel.ni.com/content/groups/mercurial NI Community Mercurial User Group]&lt;br /&gt;
&lt;br /&gt;
[[Category:SCC]]&lt;br /&gt;
[[Category:SCC]]&lt;br /&gt;
&lt;br /&gt;
[[Category:SCC]]&lt;br /&gt;
[[Category:SCC]]&lt;/div&gt;</summary>
		<author><name>Daklu</name></author>
	</entry>
	<entry>
		<id>https://labviewwiki.org/w/index.php?title=LabVIEW_object-oriented_programming_FAQ&amp;diff=4634</id>
		<title>LabVIEW object-oriented programming FAQ</title>
		<link rel="alternate" type="text/html" href="https://labviewwiki.org/w/index.php?title=LabVIEW_object-oriented_programming_FAQ&amp;diff=4634"/>
		<updated>2012-03-16T20:56:48Z</updated>

		<summary type="html">&lt;p&gt;Daklu: /* What are the differences between public, protected, and private class members? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a stub page for Frequently Asked Questions (FAQ) about LVOOP. Please feel free to add to the list of FAQ and answer any of the questions that have been posted.&lt;br /&gt;
&lt;br /&gt;
You may find many questions already answered on the [http://zone.ni.com/devzone/cda/tut/p/id/3573 LVOOP FAQ on NI&#039;s website]. That FAQ will be updated by NI for new versions of LabVIEW and new OO tools as they become available.&lt;br /&gt;
&lt;br /&gt;
== Why is class data private?  ==&lt;br /&gt;
&lt;br /&gt;
In general object-oriented programming terms, attributes (like methods) can have private, protected, or public visibility. In practice individual object-oriented programming languages have differing capabilities when it comes to specifying visibility. In the UML attributes are generally assumed to have private visibility unless otherwise specified. (Operations, on the other hand, are assumed to be public unless otherwise specified.) Generally, OOP style guides say never to give attributes public visibility, and the so-called “Law of Demeter” in its strong form limits attribute visibilities to private. In other words, access to data in a class from outside the class is always through accessor methods (‘set’ or ‘get’) methods. In LVOOP this is the only choice, a decision designed to promote good code designs with minimal coupling. (See further here: [http://zone.ni.com/devzone/cda/tut/p/id/3574]). (Note that LabVIEW 8.5 introduces a “Create Accessor” dialog box to simplify the creation of accessor methods. For more information on this dialog box see the LabVIEW 8.5 Upgrade Notes here: [http://digital.ni.com/manuals.nsf/websearch/7A60FDCEA6D2D8C4862572FD00159F5A].)&lt;br /&gt;
&lt;br /&gt;
== What are the differences between public, protected, and private class members?  ==&lt;br /&gt;
&lt;br /&gt;
In Object-Oriented Programming terms these generally mean:&lt;br /&gt;
&lt;br /&gt;
A private feature (UML abbreviation -) is accessible only from the defining class. A public feature (+) is accessible from outside the class. A protected feature (#) is (in C++, for example) accessible from the defining class and any of its child classes. The UML also has an abbreviation for package (~) visibility. The exact meaning of the different visibilities varies among different programming languages.&lt;br /&gt;
&lt;br /&gt;
In 2009 LabVIEW introduced &#039;&#039;Community&#039;&#039; scoping to classes (and other project libraries.)  Community scoped items are the same as private items, except they are visible to external entities specifically designated as &amp;quot;Friends of This Library.&amp;quot;  Some important things to keep in mind with community scoping are:&lt;br /&gt;
&lt;br /&gt;
* Friendship is a one-way permission granted by a class giving external entities access to community scoped items.  If Class A makes Class B a friend, Class B has access to Class A&#039;s community scoped items, but Class A does not have access to Class B&#039;s community scoped items.&lt;br /&gt;
&lt;br /&gt;
* Child classes are not automatically granted access to a parent&#039;s community scoped items.&lt;br /&gt;
&lt;br /&gt;
== Why are there no class constructor and destructor?  ==&lt;br /&gt;
&lt;br /&gt;
== Are objects by value or by reference?  ==&lt;br /&gt;
&lt;br /&gt;
== What does LVOOP mean?  ==&lt;br /&gt;
&lt;br /&gt;
== How can I create by reference objects?  ==&lt;br /&gt;
&lt;br /&gt;
== How can I create active objects?  ==&lt;br /&gt;
&lt;br /&gt;
== Are there any add on tools for LVOOP?  ==&lt;br /&gt;
&lt;br /&gt;
== What does the &amp;quot;Dynamic Dispatch&amp;quot; connector pane terminal setting do?  ==&lt;br /&gt;
&lt;br /&gt;
== My LVOOP class control has a black border, what does that mean&amp;amp;nbsp;?  ==&lt;br /&gt;
&lt;br /&gt;
A LVOOP class has a default value that is determined by the default value of the private data control in the .lvclass file. However, a control on a vi front panel, or a constant on a block diagram can also have a default value that is different from the default data for the class as a whole.&amp;amp;nbsp;When this happens the control (or constant) is given a black border.&amp;amp;nbsp;It can just as easily be a non-default value of the class itself, so if your private data cluster contains a numeric whose default value is 5, this control may have the numeric with a default value of 6.&lt;br /&gt;
&lt;br /&gt;
When there is a class heirarchy, it is possible for a parent class method to process an instance of a child class. Similarily, it is possible to set the default value of a parent class control or constant to be an instance of a child class. This will also result in a black border around the parent class control or constant. When this happens with a member vi of the parent class, the parent class becomes dependent on the child class in addition to the normal dependency of the child on the parent. This can be confusing and awkward to locate.&lt;br /&gt;
&lt;br /&gt;
To change the default value of a class control run a VI such that a non-default value ends up in an indicator, then do one of the following:&amp;lt;br&amp;gt;A) Right click on that indicator and choose &amp;quot;Make Current Value Default&amp;quot; or&amp;lt;br&amp;gt;B) Right click on that indicator and choose &amp;quot;Change to Constant&amp;quot; (the current value of a control/indicator always becomes the value of the constant)&lt;br /&gt;
&lt;br /&gt;
[[Category:GOOP]]&lt;/div&gt;</summary>
		<author><name>Daklu</name></author>
	</entry>
	<entry>
		<id>https://labviewwiki.org/w/index.php?title=Loading_VIs&amp;diff=4488</id>
		<title>Loading VIs</title>
		<link rel="alternate" type="text/html" href="https://labviewwiki.org/w/index.php?title=Loading_VIs&amp;diff=4488"/>
		<updated>2011-04-24T18:49:21Z</updated>

		<summary type="html">&lt;p&gt;Daklu: moved Loading VIs to Loading vis: Improperly used capitalization&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{wikify}}&lt;br /&gt;
==Flowchart==&lt;br /&gt;
&lt;br /&gt;
This is a simplified flow chart showing LabVIEW&#039;s decision tree when loading a vi into memory from disk.&amp;lt;br /&amp;gt;&lt;br /&gt;
Note this diagram applies to LabVIEW 2010 when compiled code is not separated from source code.  Other versions may be slightly different.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[Image:LoadingLabviewVI.png|center|thumb|500px]]&lt;br /&gt;
==Discussion==&lt;br /&gt;
&#039;&#039;&#039;Aristos Queue&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;m going to try to explain some details of loading a VI. What happens during load depends upon what happened when the VI was last saved, so let&#039;s start there.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A good VI is one that has an unbroken run arrow. A broken VI is one that has a red X next to its name in the Error List Window because that VI itself has some problem. A bad VI is one that is listed in the Error List Window because some other VI/library that it depends upon is broken. There&#039;s a special case involving typedefs, poly VIs, and global VIs that are in the middle of being edited but are at the moment valid typedefs (i.e., they would not be broken if user did Apply Changes). Such VIs have the pencil icon next to their name in the Error List Window. Those VIs are good, but VIs that use them are bad.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
If a VI was good, then we can compile the VI, meaning we can generate the assembly instructions for that VI to run. If a VI is good, when we save, we compile the VI, and we save the compiled code as part of the VI.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a VI was broken or bad then we can&#039;t compile it, so when we save such a VI, we obviously can&#039;t save the compiled code. However, a VI might have been good, been compiled, and then become bad without any changes to its own block diagram. In that case, we already have the compiled code for the VI, and so we&#039;ll save that with the VI. There&#039;s also the special case of a VI that is broken only because it is missing subVIs. We may already have compiled code for such a VI, and so we&#039;ll keep that code around if we are asked to save again. (In the case of typedefs, they do have compiled code. They carry the instructions for copying and comparing their data. PolyVIs have no code. I&#039;m not sure about global VIs.)&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Ok. That covers save (or, rather, it covers enough of save that we can now talk about load).&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
When we use the phrase &amp;quot;a VI is in loaded into memory&amp;quot;, we really mean, &amp;quot;some portion of the VI&#039;s file is in memory in a way that other VIs may link to it and it can be edited and/or executed.&amp;quot; If you use the VI Server method &amp;quot;Read Linker Info&amp;quot;, that reads the connection information of a VI without loading the VI -- so although we opened the VI file and read some data out of it, we didn&#039;t properly make the VI available to the editor and execution system. Same when the palettes load -- they read the icons out of the VIs in the directories, without actually loading the VIs.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
There are N parts of a VI, where N is a number I don&#039;t remember right now. But for the purposes of this conversation, we can really think of there being just three parts: the front panel (FP), the block diagram (BD) and something I&#039;m going to call &amp;quot;the linker/code block&amp;quot; (LC). That&#039;s not a term you&#039;ll find anywhere else because I just made it up. The LC is all the stuff that makes a VI be a VI in memory, including:&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*the linker information (the list of other LV files upon which this VI depends)&lt;br /&gt;
*the identity of the VI (which library owns this VI)&lt;br /&gt;
*the compiled assembly code (unless the VI is broken, in which case there is no compiled assembly code)&lt;br /&gt;
*and probably some other stuff not relevant to this conversation.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In the development environment, whenever you say File &amp;gt;&amp;gt; Open and load a top-level VI, the LC and FP load into memory. If the VI was last saved as bad or broken or if it turns out to be bad/broken after it finishes loading its dependencies, then the BD also loads into memory. If that VI has subVIs, the LC for all those subVIs load into memory. The FP loads if the subVI is considered necessary (see my earlier post in this thread for things that make that necessary). Both the FP and BD are loaded if those subVIs were saved bad or broken OR if they turn out to be bad/broken once dependencies are loaded.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
For all VIs, if an edit is needed during load (say, a subVI conpane changed while the caller was not in memory, or a typedef needs to update, or LV version mutation, or updating the path to a subVI), both FP and BD load.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the runtime engine, the BD never loads. Obviously, the BD doesn&#039;t load if the VI was saved without a block diagram. In a real-time system, neither the FP nor the BD ever load.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
After loading the VI (and all its dependencies), if the compiled code is missing and the block diagram is loaded and the VI is not broken/bad, then LV will go ahead and compile the VI and put a docmod on the VI (the little asterisk that means &amp;quot;this VI has unsaved changes&amp;quot;).&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The FP and BD will eagerly unload as soon as the reasons for them staying in memory are dealt with. So if you fix a broken VI and then save the changes, FP and BD will unload unless the windows are open or the FP is necessary for the VI.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
If you want proof that the diagram loads independently, try this: Save a caller VI and its subVI. Open the caller VI. In the operating system, copy the subVI file on disk to a temp location. Back in LV, open and modify the subVI&#039;s diagram. Save the subVI and close the panel and diagram (keep the caller VI open). Now copy the temp file over the subVI file. Now open the block diagram of the subVI again. You&#039;ll get one of the more interesting dialogs that LV has to offer, noting that the diagram saved doesn&#039;t match the VI in memory and you can either choose not reload the diagram or do load the diagram which will recompile your VI for the new diagram code. If you didn&#039;t save the subVI (meaning you choose Defer Decision on the Save Changes dialog), then the diagram is already in memory and I&#039;m pretty sure you won&#039;t get that dialog because LV doesn&#039;t bother to check disk for stuff it already has loaded.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Daklu&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Say you&#039;re editing a typedef cluster and all the dependent LC blocks are loaded, but their FP/BD&#039;s are not. When the typedef&#039;s changes are applied, LV finds all the dependent vis, loads the block diagrams, and makes the necessary edits transparently to the user. (i.e. Without opening windows to the block diagrams.) Since the dependent vis are now dirty their FPs are also loaded into memory, forcing data copies for those FP controls when the app is executed, even though the FP windows aren&#039;t open, right?&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Aristos Queue&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Yes. All that is correct.&amp;lt;br /&amp;gt;&lt;br /&gt;
There&#039;s another variant -- the FP could be the thing hosting the typedef, and when the typedef changes, LV will load both the FP and the BD into memory in order to update the FP. The reason the BD loads is because the VI has to recompile to deal with the typedef change.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Daklu&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Does this behavior change when separating compiled code in LV10? My initial thought is that LV ought to be able to recompile the dependent vi&#039;s source code and remove the FP/BD from memory without marking them dirty, and simply wait until the user opens that vi before giving it a dirty dot. But that could lead to confusing behavior when multiple typedef changes are applied sequentially (like what happens when a vi&#039;s LC block isn&#039;t loaded when changes are applied) so I&#039;m guessing no.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Aristos Queue&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
I know that it does change. I do not know how dramatic the change is. Your analysis sounds completely plausible, but I haven&#039;t really stayed up-to-date on the source-obj splitting.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Daklu&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
The one open question I still don&#039;t have an answer to is why does the FP have to be loaded when the BD loaded?&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Aristos Queue&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Up until LV 2009, the default values of controls were stored as part of the front panel, so any time the VI wanted to recompile, the panel was actually necessary to generate the code. Nowadays the default values have been moved out of the panel, and we are inching closer to the day when the recompile could happen with just the diagram without the panel, but there are 25 years worth of code that assumes &amp;quot;if I have the diagram then I know the panel is in memory, so I don&#039;t have to test for NULL&amp;quot;. It&#039;s a low priority refactoring that is ooching forward.&lt;br /&gt;
&lt;br /&gt;
==External Links==&lt;br /&gt;
Original [http://lavag.org/topic/7015-using-lv-class-vs-passing-cluster/page__view__findpost__p__82679 LAVA] discussion.&lt;br /&gt;
&lt;br /&gt;
[[Category:LabVIEW internals]]&lt;/div&gt;</summary>
		<author><name>Daklu</name></author>
	</entry>
	<entry>
		<id>https://labviewwiki.org/w/index.php?title=Loading_VIs&amp;diff=4487</id>
		<title>Loading VIs</title>
		<link rel="alternate" type="text/html" href="https://labviewwiki.org/w/index.php?title=Loading_VIs&amp;diff=4487"/>
		<updated>2011-04-24T18:47:32Z</updated>

		<summary type="html">&lt;p&gt;Daklu: Added note to flowchart indicating it only applies to 2010.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{wikify}}&lt;br /&gt;
==Flowchart==&lt;br /&gt;
&lt;br /&gt;
This is a simplified flow chart showing LabVIEW&#039;s decision tree when loading a vi into memory from disk.&amp;lt;br /&amp;gt;&lt;br /&gt;
Note this diagram applies to LabVIEW 2010 when compiled code is not separated from source code.  Other versions may be slightly different.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[Image:LoadingLabviewVI.png|center|thumb|500px]]&lt;br /&gt;
==Discussion==&lt;br /&gt;
&#039;&#039;&#039;Aristos Queue&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;m going to try to explain some details of loading a VI. What happens during load depends upon what happened when the VI was last saved, so let&#039;s start there.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A good VI is one that has an unbroken run arrow. A broken VI is one that has a red X next to its name in the Error List Window because that VI itself has some problem. A bad VI is one that is listed in the Error List Window because some other VI/library that it depends upon is broken. There&#039;s a special case involving typedefs, poly VIs, and global VIs that are in the middle of being edited but are at the moment valid typedefs (i.e., they would not be broken if user did Apply Changes). Such VIs have the pencil icon next to their name in the Error List Window. Those VIs are good, but VIs that use them are bad.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
If a VI was good, then we can compile the VI, meaning we can generate the assembly instructions for that VI to run. If a VI is good, when we save, we compile the VI, and we save the compiled code as part of the VI.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a VI was broken or bad then we can&#039;t compile it, so when we save such a VI, we obviously can&#039;t save the compiled code. However, a VI might have been good, been compiled, and then become bad without any changes to its own block diagram. In that case, we already have the compiled code for the VI, and so we&#039;ll save that with the VI. There&#039;s also the special case of a VI that is broken only because it is missing subVIs. We may already have compiled code for such a VI, and so we&#039;ll keep that code around if we are asked to save again. (In the case of typedefs, they do have compiled code. They carry the instructions for copying and comparing their data. PolyVIs have no code. I&#039;m not sure about global VIs.)&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Ok. That covers save (or, rather, it covers enough of save that we can now talk about load).&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
When we use the phrase &amp;quot;a VI is in loaded into memory&amp;quot;, we really mean, &amp;quot;some portion of the VI&#039;s file is in memory in a way that other VIs may link to it and it can be edited and/or executed.&amp;quot; If you use the VI Server method &amp;quot;Read Linker Info&amp;quot;, that reads the connection information of a VI without loading the VI -- so although we opened the VI file and read some data out of it, we didn&#039;t properly make the VI available to the editor and execution system. Same when the palettes load -- they read the icons out of the VIs in the directories, without actually loading the VIs.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
There are N parts of a VI, where N is a number I don&#039;t remember right now. But for the purposes of this conversation, we can really think of there being just three parts: the front panel (FP), the block diagram (BD) and something I&#039;m going to call &amp;quot;the linker/code block&amp;quot; (LC). That&#039;s not a term you&#039;ll find anywhere else because I just made it up. The LC is all the stuff that makes a VI be a VI in memory, including:&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*the linker information (the list of other LV files upon which this VI depends)&lt;br /&gt;
*the identity of the VI (which library owns this VI)&lt;br /&gt;
*the compiled assembly code (unless the VI is broken, in which case there is no compiled assembly code)&lt;br /&gt;
*and probably some other stuff not relevant to this conversation.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In the development environment, whenever you say File &amp;gt;&amp;gt; Open and load a top-level VI, the LC and FP load into memory. If the VI was last saved as bad or broken or if it turns out to be bad/broken after it finishes loading its dependencies, then the BD also loads into memory. If that VI has subVIs, the LC for all those subVIs load into memory. The FP loads if the subVI is considered necessary (see my earlier post in this thread for things that make that necessary). Both the FP and BD are loaded if those subVIs were saved bad or broken OR if they turn out to be bad/broken once dependencies are loaded.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
For all VIs, if an edit is needed during load (say, a subVI conpane changed while the caller was not in memory, or a typedef needs to update, or LV version mutation, or updating the path to a subVI), both FP and BD load.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the runtime engine, the BD never loads. Obviously, the BD doesn&#039;t load if the VI was saved without a block diagram. In a real-time system, neither the FP nor the BD ever load.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
After loading the VI (and all its dependencies), if the compiled code is missing and the block diagram is loaded and the VI is not broken/bad, then LV will go ahead and compile the VI and put a docmod on the VI (the little asterisk that means &amp;quot;this VI has unsaved changes&amp;quot;).&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The FP and BD will eagerly unload as soon as the reasons for them staying in memory are dealt with. So if you fix a broken VI and then save the changes, FP and BD will unload unless the windows are open or the FP is necessary for the VI.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
If you want proof that the diagram loads independently, try this: Save a caller VI and its subVI. Open the caller VI. In the operating system, copy the subVI file on disk to a temp location. Back in LV, open and modify the subVI&#039;s diagram. Save the subVI and close the panel and diagram (keep the caller VI open). Now copy the temp file over the subVI file. Now open the block diagram of the subVI again. You&#039;ll get one of the more interesting dialogs that LV has to offer, noting that the diagram saved doesn&#039;t match the VI in memory and you can either choose not reload the diagram or do load the diagram which will recompile your VI for the new diagram code. If you didn&#039;t save the subVI (meaning you choose Defer Decision on the Save Changes dialog), then the diagram is already in memory and I&#039;m pretty sure you won&#039;t get that dialog because LV doesn&#039;t bother to check disk for stuff it already has loaded.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Daklu&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Say you&#039;re editing a typedef cluster and all the dependent LC blocks are loaded, but their FP/BD&#039;s are not. When the typedef&#039;s changes are applied, LV finds all the dependent vis, loads the block diagrams, and makes the necessary edits transparently to the user. (i.e. Without opening windows to the block diagrams.) Since the dependent vis are now dirty their FPs are also loaded into memory, forcing data copies for those FP controls when the app is executed, even though the FP windows aren&#039;t open, right?&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Aristos Queue&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Yes. All that is correct.&amp;lt;br /&amp;gt;&lt;br /&gt;
There&#039;s another variant -- the FP could be the thing hosting the typedef, and when the typedef changes, LV will load both the FP and the BD into memory in order to update the FP. The reason the BD loads is because the VI has to recompile to deal with the typedef change.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Daklu&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Does this behavior change when separating compiled code in LV10? My initial thought is that LV ought to be able to recompile the dependent vi&#039;s source code and remove the FP/BD from memory without marking them dirty, and simply wait until the user opens that vi before giving it a dirty dot. But that could lead to confusing behavior when multiple typedef changes are applied sequentially (like what happens when a vi&#039;s LC block isn&#039;t loaded when changes are applied) so I&#039;m guessing no.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Aristos Queue&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
I know that it does change. I do not know how dramatic the change is. Your analysis sounds completely plausible, but I haven&#039;t really stayed up-to-date on the source-obj splitting.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Daklu&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
The one open question I still don&#039;t have an answer to is why does the FP have to be loaded when the BD loaded?&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Aristos Queue&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Up until LV 2009, the default values of controls were stored as part of the front panel, so any time the VI wanted to recompile, the panel was actually necessary to generate the code. Nowadays the default values have been moved out of the panel, and we are inching closer to the day when the recompile could happen with just the diagram without the panel, but there are 25 years worth of code that assumes &amp;quot;if I have the diagram then I know the panel is in memory, so I don&#039;t have to test for NULL&amp;quot;. It&#039;s a low priority refactoring that is ooching forward.&lt;br /&gt;
&lt;br /&gt;
==External Links==&lt;br /&gt;
Original [http://lavag.org/topic/7015-using-lv-class-vs-passing-cluster/page__view__findpost__p__82679 LAVA] discussion.&lt;br /&gt;
&lt;br /&gt;
[[Category:LabVIEW internals]]&lt;/div&gt;</summary>
		<author><name>Daklu</name></author>
	</entry>
	<entry>
		<id>https://labviewwiki.org/w/index.php?title=Loading_VIs&amp;diff=4486</id>
		<title>Loading VIs</title>
		<link rel="alternate" type="text/html" href="https://labviewwiki.org/w/index.php?title=Loading_VIs&amp;diff=4486"/>
		<updated>2011-04-24T18:43:10Z</updated>

		<summary type="html">&lt;p&gt;Daklu: Cleaned up formatting.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{wikify}}&lt;br /&gt;
==Flowchart==&lt;br /&gt;
&lt;br /&gt;
This is a simplified flow chart showing how Labview loads a vi into memory from disk.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[Image:LoadingLabviewVI.png|center|thumb|500px|Loading VI]]&lt;br /&gt;
==Discussion==&lt;br /&gt;
&#039;&#039;&#039;Aristos Queue&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;m going to try to explain some details of loading a VI. What happens during load depends upon what happened when the VI was last saved, so let&#039;s start there.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A good VI is one that has an unbroken run arrow. A broken VI is one that has a red X next to its name in the Error List Window because that VI itself has some problem. A bad VI is one that is listed in the Error List Window because some other VI/library that it depends upon is broken. There&#039;s a special case involving typedefs, poly VIs, and global VIs that are in the middle of being edited but are at the moment valid typedefs (i.e., they would not be broken if user did Apply Changes). Such VIs have the pencil icon next to their name in the Error List Window. Those VIs are good, but VIs that use them are bad.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
If a VI was good, then we can compile the VI, meaning we can generate the assembly instructions for that VI to run. If a VI is good, when we save, we compile the VI, and we save the compiled code as part of the VI.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a VI was broken or bad then we can&#039;t compile it, so when we save such a VI, we obviously can&#039;t save the compiled code. However, a VI might have been good, been compiled, and then become bad without any changes to its own block diagram. In that case, we already have the compiled code for the VI, and so we&#039;ll save that with the VI. There&#039;s also the special case of a VI that is broken only because it is missing subVIs. We may already have compiled code for such a VI, and so we&#039;ll keep that code around if we are asked to save again. (In the case of typedefs, they do have compiled code. They carry the instructions for copying and comparing their data. PolyVIs have no code. I&#039;m not sure about global VIs.)&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Ok. That covers save (or, rather, it covers enough of save that we can now talk about load).&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
When we use the phrase &amp;quot;a VI is in loaded into memory&amp;quot;, we really mean, &amp;quot;some portion of the VI&#039;s file is in memory in a way that other VIs may link to it and it can be edited and/or executed.&amp;quot; If you use the VI Server method &amp;quot;Read Linker Info&amp;quot;, that reads the connection information of a VI without loading the VI -- so although we opened the VI file and read some data out of it, we didn&#039;t properly make the VI available to the editor and execution system. Same when the palettes load -- they read the icons out of the VIs in the directories, without actually loading the VIs.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
There are N parts of a VI, where N is a number I don&#039;t remember right now. But for the purposes of this conversation, we can really think of there being just three parts: the front panel (FP), the block diagram (BD) and something I&#039;m going to call &amp;quot;the linker/code block&amp;quot; (LC). That&#039;s not a term you&#039;ll find anywhere else because I just made it up. The LC is all the stuff that makes a VI be a VI in memory, including:&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*the linker information (the list of other LV files upon which this VI depends)&lt;br /&gt;
*the identity of the VI (which library owns this VI)&lt;br /&gt;
*the compiled assembly code (unless the VI is broken, in which case there is no compiled assembly code)&lt;br /&gt;
*and probably some other stuff not relevant to this conversation.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In the development environment, whenever you say File &amp;gt;&amp;gt; Open and load a top-level VI, the LC and FP load into memory. If the VI was last saved as bad or broken or if it turns out to be bad/broken after it finishes loading its dependencies, then the BD also loads into memory. If that VI has subVIs, the LC for all those subVIs load into memory. The FP loads if the subVI is considered necessary (see my earlier post in this thread for things that make that necessary). Both the FP and BD are loaded if those subVIs were saved bad or broken OR if they turn out to be bad/broken once dependencies are loaded.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
For all VIs, if an edit is needed during load (say, a subVI conpane changed while the caller was not in memory, or a typedef needs to update, or LV version mutation, or updating the path to a subVI), both FP and BD load.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the runtime engine, the BD never loads. Obviously, the BD doesn&#039;t load if the VI was saved without a block diagram. In a real-time system, neither the FP nor the BD ever load.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
After loading the VI (and all its dependencies), if the compiled code is missing and the block diagram is loaded and the VI is not broken/bad, then LV will go ahead and compile the VI and put a docmod on the VI (the little asterisk that means &amp;quot;this VI has unsaved changes&amp;quot;).&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The FP and BD will eagerly unload as soon as the reasons for them staying in memory are dealt with. So if you fix a broken VI and then save the changes, FP and BD will unload unless the windows are open or the FP is necessary for the VI.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
If you want proof that the diagram loads independently, try this: Save a caller VI and its subVI. Open the caller VI. In the operating system, copy the subVI file on disk to a temp location. Back in LV, open and modify the subVI&#039;s diagram. Save the subVI and close the panel and diagram (keep the caller VI open). Now copy the temp file over the subVI file. Now open the block diagram of the subVI again. You&#039;ll get one of the more interesting dialogs that LV has to offer, noting that the diagram saved doesn&#039;t match the VI in memory and you can either choose not reload the diagram or do load the diagram which will recompile your VI for the new diagram code. If you didn&#039;t save the subVI (meaning you choose Defer Decision on the Save Changes dialog), then the diagram is already in memory and I&#039;m pretty sure you won&#039;t get that dialog because LV doesn&#039;t bother to check disk for stuff it already has loaded.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Daklu&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Say you&#039;re editing a typedef cluster and all the dependent LC blocks are loaded, but their FP/BD&#039;s are not. When the typedef&#039;s changes are applied, LV finds all the dependent vis, loads the block diagrams, and makes the necessary edits transparently to the user. (i.e. Without opening windows to the block diagrams.) Since the dependent vis are now dirty their FPs are also loaded into memory, forcing data copies for those FP controls when the app is executed, even though the FP windows aren&#039;t open, right?&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Aristos Queue&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Yes. All that is correct.&amp;lt;br /&amp;gt;&lt;br /&gt;
There&#039;s another variant -- the FP could be the thing hosting the typedef, and when the typedef changes, LV will load both the FP and the BD into memory in order to update the FP. The reason the BD loads is because the VI has to recompile to deal with the typedef change.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Daklu&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Does this behavior change when separating compiled code in LV10? My initial thought is that LV ought to be able to recompile the dependent vi&#039;s source code and remove the FP/BD from memory without marking them dirty, and simply wait until the user opens that vi before giving it a dirty dot. But that could lead to confusing behavior when multiple typedef changes are applied sequentially (like what happens when a vi&#039;s LC block isn&#039;t loaded when changes are applied) so I&#039;m guessing no.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Aristos Queue&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
I know that it does change. I do not know how dramatic the change is. Your analysis sounds completely plausible, but I haven&#039;t really stayed up-to-date on the source-obj splitting.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Daklu&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
The one open question I still don&#039;t have an answer to is why does the FP have to be loaded when the BD loaded?&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Aristos Queue&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Up until LV 2009, the default values of controls were stored as part of the front panel, so any time the VI wanted to recompile, the panel was actually necessary to generate the code. Nowadays the default values have been moved out of the panel, and we are inching closer to the day when the recompile could happen with just the diagram without the panel, but there are 25 years worth of code that assumes &amp;quot;if I have the diagram then I know the panel is in memory, so I don&#039;t have to test for NULL&amp;quot;. It&#039;s a low priority refactoring that is ooching forward.&lt;br /&gt;
&lt;br /&gt;
==External Links==&lt;br /&gt;
Original [http://lavag.org/topic/7015-using-lv-class-vs-passing-cluster/page__view__findpost__p__82679 LAVA] discussion.&lt;br /&gt;
&lt;br /&gt;
[[Category:LabVIEW internals]]&lt;/div&gt;</summary>
		<author><name>Daklu</name></author>
	</entry>
	<entry>
		<id>https://labviewwiki.org/w/index.php?title=Loading_VIs&amp;diff=4485</id>
		<title>Loading VIs</title>
		<link rel="alternate" type="text/html" href="https://labviewwiki.org/w/index.php?title=Loading_VIs&amp;diff=4485"/>
		<updated>2011-04-24T18:25:48Z</updated>

		<summary type="html">&lt;p&gt;Daklu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Underconstruction}}&lt;br /&gt;
{{inuse}}&lt;br /&gt;
==Flowchart==&lt;br /&gt;
&lt;br /&gt;
This is a simplified flow chart showing how Labview loads a vi into memory from disk.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[Image:LoadingLabviewVI.png|center|thumb|500px|Loading VI]]&lt;br /&gt;
==Discussion==&lt;br /&gt;
&#039;&#039;&#039;Aristos Queue&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;m going to try to explain some details of loading a VI. What happens during load depends upon what happened when the VI was last saved, so let&#039;s start there.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A good VI is one that has an unbroken run arrow. A broken VI is one that has a red X next to its name in the Error List Window because that VI itself has some problem. A bad VI is one that is listed in the Error List Window because some other VI/library that it depends upon is broken. There&#039;s a special case involving typedefs, poly VIs, and global VIs that are in the middle of being edited but are at the moment valid typedefs (i.e., they would not be broken if user did Apply Changes). Such VIs have the pencil icon next to their name in the Error List Window. Those VIs are good, but VIs that use them are bad.&amp;lt;br /&amp;gt;                                   &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
If a VI was good, then we can compile the VI, meaning we can generate the assembly instructions for that VI to run. If a VI is good, when we save, we compile the VI, and we save the compiled code as part of the VI.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a VI was broken or bad then we can&#039;t compile it, so when we save such a VI, we obviously can&#039;t save the compiled code. However, a VI might have been good, been compiled, and then become bad without any changes to its own block diagram. In that case, we already have the compiled code for the VI, and so we&#039;ll save that with the VI. There&#039;s also the special case of a VI that is broken only because it is missing subVIs. We may already have compiled code for such a VI, and so we&#039;ll keep that code around if we are asked to save again. (In the case of typedefs, they do have compiled code. They carry the instructions for copying and comparing their data. PolyVIs have no code. I&#039;m not sure about global VIs.)&amp;lt;br /&amp;gt;                               &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Ok. That covers save (or, rather, it covers enough of save that we can now talk about load).&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
When we use the phrase &amp;quot;a VI is in loaded into memory&amp;quot;, we really mean, &amp;quot;some portion of the VI&#039;s file is in memory in a way that other VIs may link to it and it can be edited and/or executed.&amp;quot; If you use the VI Server method &amp;quot;Read Linker Info&amp;quot;, that reads the connection information of a VI without loading the VI -- so although we opened the VI file and read some data out of it, we didn&#039;t properly make the VI available to the editor and execution system. Same when the palettes load -- they read the icons out of the VIs in the directories, without actually loading the VIs.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
There are N parts of a VI, where N is a number I don&#039;t remember right now. But for the purposes of this conversation, we can really think of there being just three parts: the front panel (FP), the block diagram (BD) and something I&#039;m going to call &amp;quot;the linker/code block&amp;quot; (LC). That&#039;s not a term you&#039;ll find anywhere else because I just made it up. The LC is all the stuff that makes a VI be a VI in memory, including:&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*the linker information (the list of other LV files upon which this VI depends)&lt;br /&gt;
*the identity of the VI (which library owns this VI)&lt;br /&gt;
*the compiled assembly code (unless the VI is broken, in which case there is no compiled assembly code)&lt;br /&gt;
*and probably some other stuff not relevant to this conversation.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In the development environment, whenever you say File &amp;gt;&amp;gt; Open and load a top-level VI, the LC and FP load into memory. If the VI was last saved as bad or broken or if it turns out to be bad/broken after it finishes loading its dependencies, then the BD also loads into memory. If that VI has subVIs, the LC for all those subVIs load into memory. The FP loads if the subVI is considered necessary (see my earlier post in this thread for things that make that necessary). Both the FP and BD are loaded if those subVIs were saved bad or broken OR if they turn out to be bad/broken once dependencies are loaded.&amp;lt;br /&amp;gt;                               &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
For all VIs, if an edit is needed during load (say, a subVI conpane changed while the caller was not in memory, or a typedef needs to update, or LV version mutation, or updating the path to a subVI), both FP and BD load.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the runtime engine, the BD never loads. Obviously, the BD doesn&#039;t load if the VI was saved without a block diagram. In a real-time system, neither the FP nor the BD ever load.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
After loading the VI (and all its dependencies), if the compiled code is missing and the block diagram is loaded and the VI is not broken/bad, then LV will go ahead and compile the VI and put a docmod on the VI (the little asterisk that means &amp;quot;this VI has unsaved changes&amp;quot;).&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The FP and BD will eagerly unload as soon as the reasons for them staying in memory are dealt with. So if you fix a broken VI and then save the changes, FP and BD will unload unless the windows are open or the FP is necessary for the VI.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
If you want proof that the diagram loads independently, try this: Save a caller VI and its subVI. Open the caller VI. In the operating system, copy the subVI file on disk to a temp location. Back in LV, open and modify the subVI&#039;s diagram. Save the subVI and close the panel and diagram (keep the caller VI open). Now copy the temp file over the subVI file. Now open the block diagram of the subVI again. You&#039;ll get one of the more interesting dialogs that LV has to offer, noting that the diagram saved doesn&#039;t match the VI in memory and you can either choose not reload the diagram or do load the diagram which will recompile your VI for the new diagram code. If you didn&#039;t save the subVI (meaning you choose Defer Decision on the Save Changes dialog), then the diagram is already in memory and I&#039;m pretty sure you won&#039;t get that dialog because LV doesn&#039;t bother to check disk for stuff it already has loaded.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Daklu&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Say you&#039;re editing a typedef cluster and all the dependent LC blocks are loaded, but their FP/BD&#039;s are not. When the typedef&#039;s changes are applied, LV finds all the dependent vis, loads the block diagrams, and makes the necessary edits transparently to the user. (i.e. Without opening windows to the block diagrams.) Since the dependent vis are now dirty their FPs are also loaded into memory, forcing data copies for those FP controls when the app is executed, even though the FP windows aren&#039;t open, right?&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Aristos Queue&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Yes. All that is correct.&amp;lt;br /&amp;gt;&lt;br /&gt;
There&#039;s another variant -- the FP could be the thing hosting the typedef, and when the typedef changes, LV will load both the FP and the BD into memory in order to update the FP. The reason the BD loads is because the VI has to recompile to deal with the typedef change.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Daklu&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Does this behavior change when separating compiled code in LV10? My initial thought is that LV ought to be able to recompile the dependent vi&#039;s source code and remove the FP/BD from memory without marking them dirty, and simply wait until the user opens that vi before giving it a dirty dot. But that could lead to confusing behavior when multiple typedef changes are applied sequentially (like what happens when a vi&#039;s LC block isn&#039;t loaded when changes are applied) so I&#039;m guessing no.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Aristos Queue&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
I know that it does change. I do not know how dramatic the change is. Your analysis sounds completely plausible, but I haven&#039;t really stayed up-to-date on the source-obj splitting.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Daklu&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
The one open question I still don&#039;t have an answer to is why does the FP have to be loaded when the BD loaded?&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Aristos Queue&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Up until LV 2009, the default values of controls were stored as part of the front panel, so any time the VI wanted to recompile, the panel was actually necessary to generate the code. Nowadays the default values have been moved out of the panel, and we are inching closer to the day when the recompile could happen with just the diagram without the panel, but there are 25 years worth of code that assumes &amp;quot;if I have the diagram then I know the panel is in memory, so I don&#039;t have to test for NULL&amp;quot;. It&#039;s a low priority refactoring that is ooching forward.&lt;br /&gt;
&lt;br /&gt;
==External Links==&lt;br /&gt;
Original LAVA discussion. [http://lavag.org/topic/7015-using-lv-class-vs-passing-cluster/page__view__findpost__p__82679 Link]&lt;/div&gt;</summary>
		<author><name>Daklu</name></author>
	</entry>
	<entry>
		<id>https://labviewwiki.org/w/index.php?title=Loading_VIs&amp;diff=4484</id>
		<title>Loading VIs</title>
		<link rel="alternate" type="text/html" href="https://labviewwiki.org/w/index.php?title=Loading_VIs&amp;diff=4484"/>
		<updated>2011-04-24T18:03:49Z</updated>

		<summary type="html">&lt;p&gt;Daklu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Underconstruction}}&lt;br /&gt;
{{inuse}}&lt;br /&gt;
The information on this page is taken from [http://lavag.org/topic/7015-using-lv-class-vs-passing-cluster/page__view__findpost__p__82679 this] discussion on LAVA.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
----------&lt;br /&gt;
[[Image:LoadingLabviewVI.png|Loading VI]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Aristos Queue:&amp;lt;br /&amp;gt;&lt;br /&gt;
I&#039;m going to try to explain some details of loading a VI. What happens during load depends upon what happened when the VI was last saved, so let&#039;s start there.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A good VI is one that has an unbroken run arrow.  A broken VI is one that has a red X next to its name in the Error List Window because that VI itself has some problem.  A bad VI is one that is listed in the Error List Window because some other VI/library that it depends upon is broken.  There&#039;s a special case involving typedefs, poly VIs, and global VIs that are in the middle of being edited but are at the moment valid typedefs (i.e., they would not be broken if user did Apply Changes). Such VIs have the pencil icon next to their name in the Error List Window. Those VIs are good, but VIs that use them are bad.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
If a VI was good, then we can compile the VI, meaning we can generate the assembly instructions for that VI to run. If a VI is good, when we save, we compile the VI, and we save the compiled code as part of the VI.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a VI was broken or bad then we can&#039;t compile it, so when we save such a VI, we obviously can&#039;t save the compiled code. However, a VI might have been good, been compiled, and then become bad without any changes to its own block diagram. In that case, we already have the compiled code for the VI, and so we&#039;ll save that with the VI. There&#039;s also the special case of a VI that is broken only because it is missing subVIs. We may already have compiled code for such a VI, and so we&#039;ll keep that code around if we are asked to save again.  (In the case of typedefs, they do have compiled code. They carry the instructions for copying and comparing their data. PolyVIs have no code. I&#039;m not sure about global VIs.)&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Ok. That covers save (or, rather, it covers enough of save that we can now talk about load).&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
When we use the phrase &amp;quot;a VI is in loaded into memory&amp;quot;, we really mean, &amp;quot;some portion of the VI&#039;s file is in memory in a way that other VIs may link to it and it can be edited and/or executed.&amp;quot; If you use the VI Server method &amp;quot;Read Linker Info&amp;quot;, that reads the connection information of a VI without&lt;br /&gt;
loading the VI -- so although we opened the VI file and read some data out of it, we didn&#039;t properly make the VI available to the editor and execution system. Same when the palettes load -- they read the icons out of the VIs in the directories, without actually loading the VIs.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
There are N parts of a VI, where N is a number I don&#039;t remember right now. But for the purposes of this conversation, we can really think of there being just three parts: the front panel (FP), the block diagram (BD) and something I&#039;m going to call &amp;quot;the linker/code block&amp;quot; (LC). That&#039;s not a term you&#039;ll find anywhere else because I just made it up. The LC is all the stuff that makes a VI be a VI in memory, including:&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*the linker information (the list of other LV files upon which this VI depends)&lt;br /&gt;
*the identity of the VI (which library owns this VI)&lt;br /&gt;
*the compiled assembly code (unless the VI is broken, in which case there is no compiled assembly code)&lt;br /&gt;
*and probably some other stuff not relevant to this conversation.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In the development environment, whenever you say File &amp;gt;&amp;gt; Open and load a top-level VI, the LC and FP load into memory. If the VI was last saved as bad or broken or if it turns out to be bad/broken after it finishes loading its dependencies, then the BD also loads into memory.  If that VI has subVIs, the LC for all those subVIs load into memory. The FP loads if the subVI is considered necessary (see my earlier post in this thread for things that make that necessary). Both the FP and BD are loaded if those subVIs were saved bad or broken OR if they turn out to be bad/broken once dependencies are loaded.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
For all VIs, if an edit is needed during load (say, a subVI conpane changed while the caller was not in memory, or a typedef needs to update, or LV version mutation, or updating the path to a subVI), both FP and BD load.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the runtime engine, the BD never loads. Obviously, the BD doesn&#039;t load if the VI was saved without a block diagram. In a real-time system, neither the FP nor the BD ever load.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
After loading the VI (and all its dependencies), if the compiled code is missing and the block diagram is loaded and the VI is not broken/bad, then LV will go ahead and compile the VI and put a docmod on the VI (the little asterisk that means &amp;quot;this VI has unsaved changes&amp;quot;).&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The FP and BD will eagerly unload as soon as the reasons for them staying in memory are dealt with. So if you fix a broken VI and then save the changes, FP and BD will unload unless the windows are open or the FP is necessary for the VI.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
If you want proof that the diagram loads independently, try this: Save a caller VI and its subVI. Open the caller VI. In the operating system, copy the subVI file on disk to a temp location. Back in LV, open and modify the subVI&#039;s diagram. Save the subVI and close the panel and diagram (keep the caller VI open). Now copy the temp file over the subVI file. Now open the block diagram of the subVI again. You&#039;ll get one of the more interesting dialogs that LV has to offer, noting that the diagram saved doesn&#039;t match the VI in memory and you can either choose not reload the diagram or do load the diagram which will recompile your VI for the new diagram code. If you didn&#039;t save the subVI (meaning you choose Defer Decision on the Save Changes dialog), then the diagram is already in memory and I&#039;m pretty sure you won&#039;t get that dialog because LV doesn&#039;t bother to check disk for stuff it already has loaded.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Daklu:&amp;lt;br /&amp;gt;&lt;br /&gt;
Say you&#039;re editing a typedef cluster and all the dependent LC blocks are loaded, but their FP/BD&#039;s are not. When the typedef&#039;s changes are applied, LV finds all the dependent vis, loads the block diagrams, and makes the necessary edits transparently to the user. (i.e. Without opening windows to the block diagrams.) Since the dependent vis are now dirty their FPs are also loaded into memory, forcing data copies for those FP controls when the app is executed, even though the FP windows aren&#039;t open, right?&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Aristos Queue:&amp;lt;br /&amp;gt;&lt;br /&gt;
Yes. All that is correct.&amp;lt;br /&amp;gt;&lt;br /&gt;
There&#039;s another variant -- the FP could be the thing hosting the typedef, and when the typedef changes, LV will load both the FP and the BD into memory in order to update the FP. The reason the BD loads is because the VI has to recompile to deal with the typedef change.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Daklu:&amp;lt;br /&amp;gt;&lt;br /&gt;
Does this behavior change when separating compiled code in LV10? My initial thought is that LV ought to be able to recompile the dependent vi&#039;s source code and remove the FP/BD from memory without marking them dirty, and simply wait until the user opens that vi before giving it a dirty dot. But that could lead to confusing behavior when multiple typedef changes are applied sequentially (like what happens when a vi&#039;s LC block isn&#039;t loaded when changes are applied) so I&#039;m guessing no.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Aristos Queue:&amp;lt;br /&amp;gt;&lt;br /&gt;
I know that it does change. I do not know how dramatic the change is. Your analysis sounds completely plausible, but I haven&#039;t really stayed up-to-date on the source-obj splitting.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Daklu:&amp;lt;br /&amp;gt;&lt;br /&gt;
The one open question I still don&#039;t have an answer to is why does the FP have to be loaded when the BD loaded?&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Aristos Queue:&amp;lt;br /&amp;gt;&lt;br /&gt;
Up until LV 2009, the default values of controls were stored as part of the front panel, so any time the VI wanted to recompile, the panel was actually necessary to generate the code. Nowadays the default values have been moved out of the panel, and we are inching closer to the day when the recompile could happen with just the diagram without the panel, but there are 25 years worth of code that assumes &amp;quot;if I have the diagram then I know the panel is in memory, so I don&#039;t have to test for NULL&amp;quot;. It&#039;s a low priority refactoring that is ooching forward.&lt;/div&gt;</summary>
		<author><name>Daklu</name></author>
	</entry>
	<entry>
		<id>https://labviewwiki.org/w/index.php?title=File:LoadingLabviewVI.png&amp;diff=4483</id>
		<title>File:LoadingLabviewVI.png</title>
		<link rel="alternate" type="text/html" href="https://labviewwiki.org/w/index.php?title=File:LoadingLabviewVI.png&amp;diff=4483"/>
		<updated>2011-04-24T18:02:01Z</updated>

		<summary type="html">&lt;p&gt;Daklu: A flowchart showing Labview&amp;#039;s decision tree when loading a vi from disk.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A flowchart showing Labview&#039;s decision tree when loading a vi from disk.&lt;/div&gt;</summary>
		<author><name>Daklu</name></author>
	</entry>
	<entry>
		<id>https://labviewwiki.org/w/index.php?title=Loading_VIs&amp;diff=4482</id>
		<title>Loading VIs</title>
		<link rel="alternate" type="text/html" href="https://labviewwiki.org/w/index.php?title=Loading_VIs&amp;diff=4482"/>
		<updated>2011-04-24T18:00:20Z</updated>

		<summary type="html">&lt;p&gt;Daklu: Initial page creation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Underconstruction}}&lt;br /&gt;
The information on this page is taken from [http://lavag.org/topic/7015-using-lv-class-vs-passing-cluster/page__view__findpost__p__82679 this] discussion on LAVA.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
----------&lt;br /&gt;
[[Image:LoadingLabviewVI.png|Loading VI]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Aristos Queue:&amp;lt;br /&amp;gt;&lt;br /&gt;
I&#039;m going to try to explain some details of loading a VI. What happens during load depends upon what happened when the VI was last saved, so let&#039;s start there.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A good VI is one that has an unbroken run arrow.  A broken VI is one that has a red X next to its name in the Error List Window because that VI itself has some problem.  A bad VI is one that is listed in the Error List Window because some other VI/library that it depends upon is broken.  There&#039;s a special case involving typedefs, poly VIs, and global VIs that are in the middle of being edited but are at the moment valid typedefs (i.e., they would not be broken if user did Apply Changes). Such VIs have the pencil icon next to their name in the Error List Window. Those VIs are good, but VIs that use them are bad.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
If a VI was good, then we can compile the VI, meaning we can generate the assembly instructions for that VI to run. If a VI is good, when we save, we compile the VI, and we save the compiled code as part of the VI.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a VI was broken or bad then we can&#039;t compile it, so when we save such a VI, we obviously can&#039;t save the compiled code. However, a VI might have been good, been compiled, and then become bad without any changes to its own block diagram. In that case, we already have the compiled code for the VI, and so we&#039;ll save that with the VI. There&#039;s also the special case of a VI that is broken only because it is missing subVIs. We may already have compiled code for such a VI, and so we&#039;ll keep that code around if we are asked to save again.  (In the case of typedefs, they do have compiled code. They carry the instructions for copying and comparing their data. PolyVIs have no code. I&#039;m not sure about global VIs.)&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Ok. That covers save (or, rather, it covers enough of save that we can now talk about load).&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
When we use the phrase &amp;quot;a VI is in loaded into memory&amp;quot;, we really mean, &amp;quot;some portion of the VI&#039;s file is in memory in a way that other VIs may link to it and it can be edited and/or executed.&amp;quot; If you use the VI Server method &amp;quot;Read Linker Info&amp;quot;, that reads the connection information of a VI without&lt;br /&gt;
loading the VI -- so although we opened the VI file and read some data out of it, we didn&#039;t properly make the VI available to the editor and execution system. Same when the palettes load -- they read the icons out of the VIs in the directories, without actually loading the VIs.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
There are N parts of a VI, where N is a number I don&#039;t remember right now. But for the purposes of this conversation, we can really think of there being just three parts: the front panel (FP), the block diagram (BD) and something I&#039;m going to call &amp;quot;the linker/code block&amp;quot; (LC). That&#039;s not a term you&#039;ll find anywhere else because I just made it up. The LC is all the stuff that makes a VI be a VI in memory, including:&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*the linker information (the list of other LV files upon which this VI depends)&lt;br /&gt;
*the identity of the VI (which library owns this VI)&lt;br /&gt;
*the compiled assembly code (unless the VI is broken, in which case there is no compiled assembly code)&lt;br /&gt;
*and probably some other stuff not relevant to this conversation.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In the development environment, whenever you say File &amp;gt;&amp;gt; Open and load a top-level VI, the LC and FP load into memory. If the VI was last saved as bad or broken or if it turns out to be bad/broken after it finishes loading its dependencies, then the BD also loads into memory.  If that VI has subVIs, the LC for all those subVIs load into memory. The FP loads if the subVI is considered necessary (see my earlier post in this thread for things that make that necessary). Both the FP and BD are loaded if those subVIs were saved bad or broken OR if they turn out to be bad/broken once dependencies are loaded.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
For all VIs, if an edit is needed during load (say, a subVI conpane changed while the caller was not in memory, or a typedef needs to update, or LV version mutation, or updating the path to a subVI), both FP and BD load.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the runtime engine, the BD never loads. Obviously, the BD doesn&#039;t load if the VI was saved without a block diagram. In a real-time system, neither the FP nor the BD ever load.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
After loading the VI (and all its dependencies), if the compiled code is missing and the block diagram is loaded and the VI is not broken/bad, then LV will go ahead and compile the VI and put a docmod on the VI (the little asterisk that means &amp;quot;this VI has unsaved changes&amp;quot;).&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The FP and BD will eagerly unload as soon as the reasons for them staying in memory are dealt with. So if you fix a broken VI and then save the changes, FP and BD will unload unless the windows are open or the FP is necessary for the VI.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
If you want proof that the diagram loads independently, try this: Save a caller VI and its subVI. Open the caller VI. In the operating system, copy the subVI file on disk to a temp location. Back in LV, open and modify the subVI&#039;s diagram. Save the subVI and close the panel and diagram (keep the caller VI open). Now copy the temp file over the subVI file. Now open the block diagram of the subVI again. You&#039;ll get one of the more interesting dialogs that LV has to offer, noting that the diagram saved doesn&#039;t match the VI in memory and you can either choose not reload the diagram or do load the diagram which will recompile your VI for the new diagram code. If you didn&#039;t save the subVI (meaning you choose Defer Decision on the Save Changes dialog), then the diagram is already in memory and I&#039;m pretty sure you won&#039;t get that dialog because LV doesn&#039;t bother to check disk for stuff it already has loaded.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Daklu:&amp;lt;br /&amp;gt;&lt;br /&gt;
Say you&#039;re editing a typedef cluster and all the dependent LC blocks are loaded, but their FP/BD&#039;s are not. When the typedef&#039;s changes are applied, LV finds all the dependent vis, loads the block diagrams, and makes the necessary edits transparently to the user. (i.e. Without opening windows to the block diagrams.) Since the dependent vis are now dirty their FPs are also loaded into memory, forcing data copies for those FP controls when the app is executed, even though the FP windows aren&#039;t open, right?&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Aristos Queue:&amp;lt;br /&amp;gt;&lt;br /&gt;
Yes. All that is correct.&amp;lt;br /&amp;gt;&lt;br /&gt;
There&#039;s another variant -- the FP could be the thing hosting the typedef, and when the typedef changes, LV will load both the FP and the BD into memory in order to update the FP. The reason the BD loads is because the VI has to recompile to deal with the typedef change.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Daklu:&amp;lt;br /&amp;gt;&lt;br /&gt;
Does this behavior change when separating compiled code in LV10? My initial thought is that LV ought to be able to recompile the dependent vi&#039;s source code and remove the FP/BD from memory without marking them dirty, and simply wait until the user opens that vi before giving it a dirty dot. But that could lead to confusing behavior when multiple typedef changes are applied sequentially (like what happens when a vi&#039;s LC block isn&#039;t loaded when changes are applied) so I&#039;m guessing no.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Aristos Queue:&amp;lt;br /&amp;gt;&lt;br /&gt;
I know that it does change. I do not know how dramatic the change is. Your analysis sounds completely plausible, but I haven&#039;t really stayed up-to-date on the source-obj splitting.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Daklu:&amp;lt;br /&amp;gt;&lt;br /&gt;
The one open question I still don&#039;t have an answer to is why does the FP have to be loaded when the BD loaded?&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Aristos Queue:&amp;lt;br /&amp;gt;&lt;br /&gt;
Up until LV 2009, the default values of controls were stored as part of the front panel, so any time the VI wanted to recompile, the panel was actually necessary to generate the code. Nowadays the default values have been moved out of the panel, and we are inching closer to the day when the recompile could happen with just the diagram without the panel, but there are 25 years worth of code that assumes &amp;quot;if I have the diagram then I know the panel is in memory, so I don&#039;t have to test for NULL&amp;quot;. It&#039;s a low priority refactoring that is ooching forward.&lt;/div&gt;</summary>
		<author><name>Daklu</name></author>
	</entry>
	<entry>
		<id>https://labviewwiki.org/w/index.php?title=Code_Distribution&amp;diff=4088</id>
		<title>Code Distribution</title>
		<link rel="alternate" type="text/html" href="https://labviewwiki.org/w/index.php?title=Code_Distribution&amp;diff=4088"/>
		<updated>2009-08-13T19:11:11Z</updated>

		<summary type="html">&lt;p&gt;Daklu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the portal for information related to Building an executable, creating an installer and distributing your code.&lt;br /&gt;
&lt;br /&gt;
==== Distributing Executable Code: ====&lt;br /&gt;
&lt;br /&gt;
*[[How to Build an Executable]] &lt;br /&gt;
*[http://labviewwiki.org/Executable_Directory_Structure Executable Directory Structure]&lt;br /&gt;
*[[Associate your own file type with Windows Explorer]] &lt;br /&gt;
*[[Including ini settings]] &lt;br /&gt;
*[[EXE has the wrong date]] &lt;br /&gt;
*[[Getting Command Line Parameters]] &lt;br /&gt;
*[[Run-Time Engine Limitations]]&lt;/div&gt;</summary>
		<author><name>Daklu</name></author>
	</entry>
	<entry>
		<id>https://labviewwiki.org/w/index.php?title=Executable_Directory_Structure&amp;diff=4087</id>
		<title>Executable Directory Structure</title>
		<link rel="alternate" type="text/html" href="https://labviewwiki.org/w/index.php?title=Executable_Directory_Structure&amp;diff=4087"/>
		<updated>2009-08-13T18:56:03Z</updated>

		<summary type="html">&lt;p&gt;Daklu: New page: When building an executable in Labview some VIs may be remapped to a different folder structure either inside or outside the executable. This can impact an executable that uses path consta...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When building an executable in Labview some VIs may be remapped to a different folder structure either inside or outside the executable. This can impact an executable that uses path constants in source code to locate sub VIs or other resources. Versions prior to 2009 remapped VIs to a directory tree &#039;&#039;outside&#039;&#039; the executable. Labview 2009 has fixed this problem. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Yes, by default all VIs will go into the .exe using the same relative path between them as you had outside the .exe (you can, of course, tell the build spec to put specific VIs in specific locations using custom destinations). It finds the most common root folder of all the VIs and uses that as the top-level directory inside the .exe. If the VIs span drives on Windows then the top-level directories will be the drive letters.&amp;lt;/blockquote&amp;gt;&amp;lt;blockquote&amp;gt;The one exception is vi.ilb, which gets its own top-level directory. This is to prevent common cases from having really deep hierarchies just for vi.lib VIs. This means if you call a vi.lib VI dynamically then you should write a wrapper VI for it in your .exe which you can then call using a relative path. The idea is to not have any code which has to check whether you&#039;re in an .exe or not in order to build different paths. The paths should always be the same.&amp;lt;br&amp;gt;(Quoted from &#039;&#039;Adam Kemp&#039;&#039; on [http://lavag.org/topic/9251-name-conflicts-using-vis-for-override/page__view__findpost__p__64037 LAVA])&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;For example, an executable&#039;s internal directory structure would look like: &lt;br /&gt;
&amp;lt;blockquote&amp;gt;application.exe/main.vi&amp;lt;br&amp;gt;application.exe/subfolder/subvi1.vi &amp;lt;br&amp;gt;application.exe/LabVIEW 2009/vi.lib/vilibVI1.vi &amp;lt;br&amp;gt;application.exe/LabVIEW 2009/user.lib/_OpenG/openGVI.vi &amp;lt;br&amp;gt;application.exe/LabVIEW 2009/instr.lib/Instrument Driver1/initialize.vi &amp;lt;br&amp;gt;(Quoted from &#039;&#039;gmart&#039;&#039; on [http://lavag.org/topic/9251-name-conflicts-using-vis-for-override/page__view__findpost__p__64051 LAVA])&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:LabVIEW internals]]&lt;br /&gt;
[[Category:Application builder]]&lt;br /&gt;
[[Category:Building executables]]&lt;br /&gt;
[[Category:Code distribution]]&lt;/div&gt;</summary>
		<author><name>Daklu</name></author>
	</entry>
</feed>