<?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 LabVIEW Hosted Application Example in InstrumentStudio</title>
    <link>https://forums.ni.com/t5/InstrumentStudio/LabVIEW-Hosted-Application-Example/m-p/4067990#M6</link>
    <description>&lt;P&gt;&lt;FONT size="5"&gt;Background&lt;/FONT&gt;&lt;BR /&gt;You can use InstrumentStudio to host applications written in LabVIEW or C#. These applications run alongside the InstrumentStudio panels used to configure PXI instruments. Support for hosted applications is experimental in InstrumentStudio 2019.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;This attached example is provided as-is. It is not a fully-vetted template. It demonstrates the core functionality currently available in InstrumentStudio 2019 for hosted LabVIEW applications.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Requirements&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;InstrumentStudio 19.0.2&lt;/LI&gt;
&lt;LI&gt;LabVIEW 2016 or newer, 64-bit versions only (example is saved in LabVIEW 2016)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;FONT size="5"&gt;How it works&lt;/FONT&gt;&lt;BR /&gt;InstrumentStudio will look for LV DLLs in the &lt;FONT face="courier new,courier"&gt;National Instruments\InstrumentStudio 2019\Addons\LabVIEW Plugins&lt;/FONT&gt; in the location of the public documents (e.g., &lt;FONT face="courier new,courier"&gt;C:\Public\Documents&lt;/FONT&gt;). Using the template provided, you can create your own VI that can be hosted in InstrumentStudio.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The DLL must contain certain entry points. The build specification in this template is already set up to map the required VIs in the "Reserved" folder to the correct entry points (including &lt;FONT face="courier new,courier"&gt;Close.vi&lt;/FONT&gt;, &lt;FONT face="courier new,courier"&gt;GetConfiguration.vi&lt;/FONT&gt;, &lt;FONT face="courier new,courier"&gt;GetInformation.vi&lt;/FONT&gt;, and &lt;FONT face="courier new,courier"&gt;Launch.vi&lt;/FONT&gt;). Do not attempt to edit these VIs or remove them from the build spec.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You must edit &lt;FONT face="courier new,courier"&gt;Get Hostable VIs.vi&lt;/FONT&gt; to list the VI(s) you want to expose. On the block diagram, change the cluster array constant to match the name(s) of the top-level VI(s) that will be hostable in InstrumentStudio as well as what presentation types each supports. The project has one hostable VIs listed: &lt;FONT face="courier new,courier"&gt;Basic SMU.vi&lt;/FONT&gt;. Hostable VIs should be added to your build spec as well under the &lt;STRONG&gt;Always Included&lt;/STRONG&gt; list. In order for your VIs to run properly, we recommend going through the checklist below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Hostable VI examples&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;template.vi&lt;/FONT&gt; - This VI can be used as starting point for you to create a hostable VI. The main requirement is that you must have front panel control for two typedefs: &lt;FONT face="courier new,courier"&gt;InstrumentStudio initialization parameters.ctl&lt;/FONT&gt;&amp;nbsp; and&amp;nbsp;&lt;FONT face="courier new,courier"&gt;StopAllOutputsEventInfo.ctl&lt;/FONT&gt; (provided in the Reserved folder) and that their labels must be "InstrumentStudio initialization parameters" and "StopAllOutputs Event Info" respectively.&lt;BR /&gt;The cluster contains the InstrumentStudio event, the presentation type (large or small), and a data value reference for your configuration. You can use the presentation type to determine how your UI should render, either in a small panel or a large panel.&lt;BR /&gt;The data value reference is for a cluster of two strings. The two strings represent your VI's edit-time configuration and run-time configuration respectively. Use the in-place data structure to query or set the values in the DVR. InstrumentStudio will periodically query this to determine if your VI's state has changed. The strings are saved with the &lt;FONT face="courier new,courier"&gt;.sfp&lt;/FONT&gt; file in InstrumentStudio. Upon opening the &lt;FONT face="courier new,courier"&gt;.sfp&lt;/FONT&gt; file, InstrumentStudio will pass the saved configurations in the DVR so your VI can deserialize and set your VI's initial state.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;Basic SMU.vi&lt;/FONT&gt; - A simple example using the available plugin features using a simulation of a third-party SMU. It demonstrates how to save and restore the plugin configuration and how to respond to events from InstrumentStudio, such as &lt;STRONG&gt;Close&lt;/STRONG&gt; and &lt;STRONG&gt;Stop all outputs&lt;/STRONG&gt;.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Hosted VI Requirements and Details&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Make the VI reentrant. This allows the VI to be run in multiple tabs.&lt;/LI&gt;
&lt;LI&gt;Do not show any modal dialog upon launch/shutdown of your VI. It is OK to display modal dialogs as a response to user action (like a button being clicked) but not upon startup/shutdown.&lt;/LI&gt;
&lt;LI&gt;Set your VI's window title in VI Properties. This is what will be used in InstrumentStudio when you select the VI.&lt;/LI&gt;
&lt;LI&gt;Upon closing a document containing a hosted LV plugin, InstrumentStudio will send an event to your VI (see the examples in the project). A "shutdown" string will be sent to your VI's event structure that you can handle. Whatever code that executes should complete before a 3 second timeout, otherwise InstrumentStudio will abort and close your VI.&lt;/LI&gt;
&lt;LI&gt;For saving state in the configuration DVR, we recommend using LabVIEW's &lt;STRONG&gt;Flatten to Json&lt;/STRONG&gt; or &lt;STRONG&gt;Flatten to XML&lt;/STRONG&gt;. &lt;STRONG&gt;Flatten to String&lt;/STRONG&gt; will not work because the string can contain null characters which will not persist properly.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Using your plugin in InstrumentStudio&lt;/FONT&gt;&lt;BR /&gt;After building your DLL and copying it to the &lt;FONT face="courier new,courier"&gt;&amp;lt;Public Documents&amp;gt;\National Instruments\InstrumentStudio 2019\Addons\LabVIEW Plugins&lt;/FONT&gt; directory, launch InstrumentStudio. Enable the Hosted Applications experimental feature from &lt;STRONG&gt;File&amp;gt;&amp;gt;Preferences&amp;gt;&amp;gt;Hosted applications&lt;/STRONG&gt;. On the Home tab, click the &lt;STRONG&gt;Manual Layout&lt;/STRONG&gt; button. In the &lt;STRONG&gt;Edit Layout&lt;/STRONG&gt; dialog, scroll down the listbox on the left until you see &lt;STRONG&gt;Other devices&lt;/STRONG&gt;. There should be a LabVIEW plug-in option for each of your hostable VIs. Choose to create one of your LabVIEW plug-in in a large or small panel. Click OK to close the &lt;STRONG&gt;Edit Layout&lt;/STRONG&gt; dialog and create a new document that includes your LabVIEW plugin.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Limitations&lt;/FONT&gt;&lt;BR /&gt;InstrumentStudio and LabVIEW use different UI frameworks, which leads to some "airspace" issues when hosting the LabVIEW front panel UI within InstrumentStudio. The incompatibility of UI frameworks is a known issue documented by Microsoft.​ Airspace issues include unexpected visual behavior when resizing the window, using scrollbars, and for some pop-overs like the InstrumentStudio Welcome Mat and Project Files pane. Additionally, when LabVIEW panels have command focus, InstrumentStudio won’t receive or process keyboard commands like &lt;STRONG&gt;Ctrl+S&lt;/STRONG&gt;.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Jul 2020 17:07:04 GMT</pubDate>
    <dc:creator>K_Joy</dc:creator>
    <dc:date>2020-07-16T17:07:04Z</dc:date>
    <item>
      <title>LabVIEW Hosted Application Example</title>
      <link>https://forums.ni.com/t5/InstrumentStudio/LabVIEW-Hosted-Application-Example/m-p/4067990#M6</link>
      <description>&lt;P&gt;&lt;FONT size="5"&gt;Background&lt;/FONT&gt;&lt;BR /&gt;You can use InstrumentStudio to host applications written in LabVIEW or C#. These applications run alongside the InstrumentStudio panels used to configure PXI instruments. Support for hosted applications is experimental in InstrumentStudio 2019.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;This attached example is provided as-is. It is not a fully-vetted template. It demonstrates the core functionality currently available in InstrumentStudio 2019 for hosted LabVIEW applications.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Requirements&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;InstrumentStudio 19.0.2&lt;/LI&gt;
&lt;LI&gt;LabVIEW 2016 or newer, 64-bit versions only (example is saved in LabVIEW 2016)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;FONT size="5"&gt;How it works&lt;/FONT&gt;&lt;BR /&gt;InstrumentStudio will look for LV DLLs in the &lt;FONT face="courier new,courier"&gt;National Instruments\InstrumentStudio 2019\Addons\LabVIEW Plugins&lt;/FONT&gt; in the location of the public documents (e.g., &lt;FONT face="courier new,courier"&gt;C:\Public\Documents&lt;/FONT&gt;). Using the template provided, you can create your own VI that can be hosted in InstrumentStudio.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The DLL must contain certain entry points. The build specification in this template is already set up to map the required VIs in the "Reserved" folder to the correct entry points (including &lt;FONT face="courier new,courier"&gt;Close.vi&lt;/FONT&gt;, &lt;FONT face="courier new,courier"&gt;GetConfiguration.vi&lt;/FONT&gt;, &lt;FONT face="courier new,courier"&gt;GetInformation.vi&lt;/FONT&gt;, and &lt;FONT face="courier new,courier"&gt;Launch.vi&lt;/FONT&gt;). Do not attempt to edit these VIs or remove them from the build spec.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You must edit &lt;FONT face="courier new,courier"&gt;Get Hostable VIs.vi&lt;/FONT&gt; to list the VI(s) you want to expose. On the block diagram, change the cluster array constant to match the name(s) of the top-level VI(s) that will be hostable in InstrumentStudio as well as what presentation types each supports. The project has one hostable VIs listed: &lt;FONT face="courier new,courier"&gt;Basic SMU.vi&lt;/FONT&gt;. Hostable VIs should be added to your build spec as well under the &lt;STRONG&gt;Always Included&lt;/STRONG&gt; list. In order for your VIs to run properly, we recommend going through the checklist below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Hostable VI examples&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;template.vi&lt;/FONT&gt; - This VI can be used as starting point for you to create a hostable VI. The main requirement is that you must have front panel control for two typedefs: &lt;FONT face="courier new,courier"&gt;InstrumentStudio initialization parameters.ctl&lt;/FONT&gt;&amp;nbsp; and&amp;nbsp;&lt;FONT face="courier new,courier"&gt;StopAllOutputsEventInfo.ctl&lt;/FONT&gt; (provided in the Reserved folder) and that their labels must be "InstrumentStudio initialization parameters" and "StopAllOutputs Event Info" respectively.&lt;BR /&gt;The cluster contains the InstrumentStudio event, the presentation type (large or small), and a data value reference for your configuration. You can use the presentation type to determine how your UI should render, either in a small panel or a large panel.&lt;BR /&gt;The data value reference is for a cluster of two strings. The two strings represent your VI's edit-time configuration and run-time configuration respectively. Use the in-place data structure to query or set the values in the DVR. InstrumentStudio will periodically query this to determine if your VI's state has changed. The strings are saved with the &lt;FONT face="courier new,courier"&gt;.sfp&lt;/FONT&gt; file in InstrumentStudio. Upon opening the &lt;FONT face="courier new,courier"&gt;.sfp&lt;/FONT&gt; file, InstrumentStudio will pass the saved configurations in the DVR so your VI can deserialize and set your VI's initial state.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;Basic SMU.vi&lt;/FONT&gt; - A simple example using the available plugin features using a simulation of a third-party SMU. It demonstrates how to save and restore the plugin configuration and how to respond to events from InstrumentStudio, such as &lt;STRONG&gt;Close&lt;/STRONG&gt; and &lt;STRONG&gt;Stop all outputs&lt;/STRONG&gt;.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Hosted VI Requirements and Details&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Make the VI reentrant. This allows the VI to be run in multiple tabs.&lt;/LI&gt;
&lt;LI&gt;Do not show any modal dialog upon launch/shutdown of your VI. It is OK to display modal dialogs as a response to user action (like a button being clicked) but not upon startup/shutdown.&lt;/LI&gt;
&lt;LI&gt;Set your VI's window title in VI Properties. This is what will be used in InstrumentStudio when you select the VI.&lt;/LI&gt;
&lt;LI&gt;Upon closing a document containing a hosted LV plugin, InstrumentStudio will send an event to your VI (see the examples in the project). A "shutdown" string will be sent to your VI's event structure that you can handle. Whatever code that executes should complete before a 3 second timeout, otherwise InstrumentStudio will abort and close your VI.&lt;/LI&gt;
&lt;LI&gt;For saving state in the configuration DVR, we recommend using LabVIEW's &lt;STRONG&gt;Flatten to Json&lt;/STRONG&gt; or &lt;STRONG&gt;Flatten to XML&lt;/STRONG&gt;. &lt;STRONG&gt;Flatten to String&lt;/STRONG&gt; will not work because the string can contain null characters which will not persist properly.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Using your plugin in InstrumentStudio&lt;/FONT&gt;&lt;BR /&gt;After building your DLL and copying it to the &lt;FONT face="courier new,courier"&gt;&amp;lt;Public Documents&amp;gt;\National Instruments\InstrumentStudio 2019\Addons\LabVIEW Plugins&lt;/FONT&gt; directory, launch InstrumentStudio. Enable the Hosted Applications experimental feature from &lt;STRONG&gt;File&amp;gt;&amp;gt;Preferences&amp;gt;&amp;gt;Hosted applications&lt;/STRONG&gt;. On the Home tab, click the &lt;STRONG&gt;Manual Layout&lt;/STRONG&gt; button. In the &lt;STRONG&gt;Edit Layout&lt;/STRONG&gt; dialog, scroll down the listbox on the left until you see &lt;STRONG&gt;Other devices&lt;/STRONG&gt;. There should be a LabVIEW plug-in option for each of your hostable VIs. Choose to create one of your LabVIEW plug-in in a large or small panel. Click OK to close the &lt;STRONG&gt;Edit Layout&lt;/STRONG&gt; dialog and create a new document that includes your LabVIEW plugin.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Limitations&lt;/FONT&gt;&lt;BR /&gt;InstrumentStudio and LabVIEW use different UI frameworks, which leads to some "airspace" issues when hosting the LabVIEW front panel UI within InstrumentStudio. The incompatibility of UI frameworks is a known issue documented by Microsoft.​ Airspace issues include unexpected visual behavior when resizing the window, using scrollbars, and for some pop-overs like the InstrumentStudio Welcome Mat and Project Files pane. Additionally, when LabVIEW panels have command focus, InstrumentStudio won’t receive or process keyboard commands like &lt;STRONG&gt;Ctrl+S&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 17:07:04 GMT</pubDate>
      <guid>https://forums.ni.com/t5/InstrumentStudio/LabVIEW-Hosted-Application-Example/m-p/4067990#M6</guid>
      <dc:creator>K_Joy</dc:creator>
      <dc:date>2020-07-16T17:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: LabVIEW Hosted Application Example</title>
      <link>https://forums.ni.com/t5/InstrumentStudio/LabVIEW-Hosted-Application-Example/m-p/4068078#M7</link>
      <description>&lt;P&gt;Known issue: If you're using a computer with a touch screen, when you try to create an InstrumentStudio document with the hosted application you may get a crash with&amp;nbsp;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;DAbort 0xB78CFE1B in window.cpp&lt;/STRONG&gt;&lt;/FONT&gt;. This is the result of a known LabVIEW issue that has been fixed in LabVIEW 2019 SP1.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 22:02:48 GMT</pubDate>
      <guid>https://forums.ni.com/t5/InstrumentStudio/LabVIEW-Hosted-Application-Example/m-p/4068078#M7</guid>
      <dc:creator>K_Joy</dc:creator>
      <dc:date>2020-07-16T22:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: LabVIEW Hosted Application Example</title>
      <link>https://forums.ni.com/t5/InstrumentStudio/LabVIEW-Hosted-Application-Example/m-p/4350856#M127</link>
      <description>&lt;P&gt;Hello, thank you for sharing the excellent content. I'm curious to know if the latest version of InstrumentStudio still supports plugins in the same manner as described in your article. Currently, both my customer and I are facing challenges in replacing our existing test systems with a combination of RFmx, TestStand, and LabVIEW. The DUT (Device Under Test) we're working with requires TCP/VISA controls, and we've developed an application to address that requirement.&lt;/P&gt;
&lt;P&gt;Our next goal is to efficiently control both RF measurements and the DUT. If we can seamlessly operate both RFmx and the DUT within the user-friendly environment of InstrumentStudio, it would be a significant achievement. This ambitious endeavor aligns with my customer's objective to further standardize the NI eco-system within his company.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 09:44:28 GMT</pubDate>
      <guid>https://forums.ni.com/t5/InstrumentStudio/LabVIEW-Hosted-Application-Example/m-p/4350856#M127</guid>
      <dc:creator>UMASO</dc:creator>
      <dc:date>2024-01-25T09:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: LabVIEW Hosted Application Example</title>
      <link>https://forums.ni.com/t5/InstrumentStudio/LabVIEW-Hosted-Application-Example/m-p/4358119#M141</link>
      <description>&lt;P&gt;Hello UMASO,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am the current product manager for InstrumentStudio and can address this for you. In the simplest terms, InstrumentStudio plugins still exist and NI has produced a number of solutions built on top of the technology. You'll notice that outside of NI, information regarding plugins is pretty sparse and that has also been intentional. Access to the latest and greatest source and documentation has been funnelled into a request-type, need-to-know basis. I would love to work with you (and anyone else reading) to better understand what you're wanting to accomplish and how we can help support your goals.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you send me a direct message so that we can start working together on your success?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;RyanF&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 17:27:06 GMT</pubDate>
      <guid>https://forums.ni.com/t5/InstrumentStudio/LabVIEW-Hosted-Application-Example/m-p/4358119#M141</guid>
      <dc:creator>RyanF</dc:creator>
      <dc:date>2024-03-01T17:27:06Z</dc:date>
    </item>
  </channel>
</rss>

