<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Using a reference to an xcontrol in a class in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/Using-a-reference-to-an-xcontrol-in-a-class/m-p/3170217#M915516</link>
    <description>&lt;P&gt;Hi.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to use dynamic dispatch OOP-methods to write to Xcontrols on the front panel of the main VI. In the image below, I have illustrated a very simple example, using static methods.&lt;/P&gt;
&lt;P&gt;However, as soon as I introduce a strict reference to the Xcontrol anywhere into the class, the Xcontrol becomes locked, &lt;STRONG&gt;even when all VI's of the project are closed&lt;/STRONG&gt;. I know, I can unlock the Xcontrol, edit it and lock it again.&lt;/P&gt;
&lt;P&gt;However, in my real project, I have an additional Singleton that is used both in main as well as in one of the Xcontrols. This class then becomes completely locked meaning that there is no possibility any more to edit it from within the project or do a search for callers. The latter is quite annoying as this makes any search for callers impossible, as the search is done on VI's in memory.&lt;/P&gt;
&lt;P&gt;Is there a reason for this locking, when nothing but the project is open, is there some alternative solution?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Herbert&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/962fda0584dcb084b63e83fa014b23ffe048198f/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31373033313669354344314135433544323132303332432f696d6167652d73697a652f6f726967696e616c3f763d6d70626c2d312670783d2d31" border="0" alt="XCtlRef ScrShot1.jpg" title="XCtlRef ScrShot1.jpg" /&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 26 Jul 2015 04:01:26 GMT</pubDate>
    <dc:creator>Herbert</dc:creator>
    <dc:date>2015-07-26T04:01:26Z</dc:date>
    <item>
      <title>Using a reference to an xcontrol in a class</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Using-a-reference-to-an-xcontrol-in-a-class/m-p/3170217#M915516</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to use dynamic dispatch OOP-methods to write to Xcontrols on the front panel of the main VI. In the image below, I have illustrated a very simple example, using static methods.&lt;/P&gt;
&lt;P&gt;However, as soon as I introduce a strict reference to the Xcontrol anywhere into the class, the Xcontrol becomes locked, &lt;STRONG&gt;even when all VI's of the project are closed&lt;/STRONG&gt;. I know, I can unlock the Xcontrol, edit it and lock it again.&lt;/P&gt;
&lt;P&gt;However, in my real project, I have an additional Singleton that is used both in main as well as in one of the Xcontrols. This class then becomes completely locked meaning that there is no possibility any more to edit it from within the project or do a search for callers. The latter is quite annoying as this makes any search for callers impossible, as the search is done on VI's in memory.&lt;/P&gt;
&lt;P&gt;Is there a reason for this locking, when nothing but the project is open, is there some alternative solution?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Herbert&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/962fda0584dcb084b63e83fa014b23ffe048198f/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31373033313669354344314135433544323132303332432f696d6167652d73697a652f6f726967696e616c3f763d6d70626c2d312670783d2d31" border="0" alt="XCtlRef ScrShot1.jpg" title="XCtlRef ScrShot1.jpg" /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jul 2015 04:01:26 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Using-a-reference-to-an-xcontrol-in-a-class/m-p/3170217#M915516</guid>
      <dc:creator>Herbert</dc:creator>
      <dc:date>2015-07-26T04:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using a reference to an xcontrol in a class</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Using-a-reference-to-an-xcontrol-in-a-class/m-p/3170228#M915521</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/13583"&gt;@Herbert&lt;/a&gt; wrote:&lt;BR /&gt;&lt;BR /&gt;
&lt;P&gt;Is there a reason for this locking, when nothing but the project is open, is there some alternative solution?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I don't have experience with this, so I'm not aware of a solution, but you can search to find other people asking about this, as it has come up before. Basically, classes load all their VIs when they load (which happens when you open the project). When a VI calling an XCtrl is loaded, it locks the XCtrl. Combine the two and there's your reason.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jul 2015 09:26:35 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Using-a-reference-to-an-xcontrol-in-a-class/m-p/3170228#M915521</guid>
      <dc:creator>tst</dc:creator>
      <dc:date>2015-07-26T09:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: Using a reference to an xcontrol in a class</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Using-a-reference-to-an-xcontrol-in-a-class/m-p/3170242#M915532</link>
      <description>&lt;P&gt;Thank's tst,&lt;/P&gt;
&lt;P&gt;I really was not aware that all classes, and maybe also lvlib's, load into memory on opening the project. This makes everything clear and I have to get a better solution to my use of a singleton in the Xcontrol.&lt;/P&gt;
&lt;P&gt;This is probably better anyway, as the Xcontrol becomes more independent of the rest of the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Herbert&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jul 2015 12:45:18 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Using-a-reference-to-an-xcontrol-in-a-class/m-p/3170242#M915532</guid>
      <dc:creator>Herbert</dc:creator>
      <dc:date>2015-07-26T12:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Using a reference to an xcontrol in a class</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Using-a-reference-to-an-xcontrol-in-a-class/m-p/3170247#M915535</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/13583"&gt;@Herbert&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I really was not aware that all classes, and maybe also lvlib's,&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;lvlib no, lvclass yes and I think also xctl and xnode, although I'm not sure about those.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jul 2015 13:27:23 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Using-a-reference-to-an-xcontrol-in-a-class/m-p/3170247#M915535</guid>
      <dc:creator>tst</dc:creator>
      <dc:date>2015-07-26T13:27:23Z</dc:date>
    </item>
  </channel>
</rss>

