<?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 Re: Save and load global variables in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/Save-and-load-global-variables/m-p/549551#M258564</link>
    <description>Dave,&lt;BR /&gt;&lt;BR /&gt;Look at the Configuration File VIs.  They are designed for exactly this type of application.&lt;BR /&gt;&lt;BR /&gt;You may also want to think about keeping the data in a shift register or Action Engine rather than globals.  Direct wiring of data is always preferable to other means of getting data to various parts of the program.  Globals may lead to race conditions (perhaps not an issue in your case since you rarely change the values) and break the dataflow pardigm of LabVIEW.&lt;BR /&gt;&lt;BR /&gt;Lynn</description>
    <pubDate>Thu, 12 Jul 2007 12:09:08 GMT</pubDate>
    <dc:creator>johnsold</dc:creator>
    <dc:date>2007-07-12T12:09:08Z</dc:date>
    <item>
      <title>Save and load global variables</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Save-and-load-global-variables/m-p/549547#M258561</link>
      <description>&lt;DIV&gt;
&lt;DIV&gt;Hi all&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I've got the following problem: &lt;/DIV&gt;
&lt;DIV&gt;At the moment I'm working with a spectroscope. I have to extract some peaks, which are produced when the ligth is refracted by different materials. And I've got two references saved as global variables to compare with: one is a dark reference (without any light &amp;amp; materials) and one only with the light. &lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;But when I'm restarting my system at the moment, I have to store both references again (because they're just saved within the vi's). &lt;/DIV&gt;
&lt;DIV&gt;Is there a possibility to save this variables in a .txt or .xls-file, where they can be easily&amp;nbsp;load from after restarting the program?&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Thanks in advance&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Dave&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Jul 2007 12:02:38 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Save-and-load-global-variables/m-p/549547#M258561</guid>
      <dc:creator>Reepicheep</dc:creator>
      <dc:date>2007-07-12T12:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: Save and load global variables</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Save-and-load-global-variables/m-p/549551#M258564</link>
      <description>Dave,&lt;BR /&gt;&lt;BR /&gt;Look at the Configuration File VIs.  They are designed for exactly this type of application.&lt;BR /&gt;&lt;BR /&gt;You may also want to think about keeping the data in a shift register or Action Engine rather than globals.  Direct wiring of data is always preferable to other means of getting data to various parts of the program.  Globals may lead to race conditions (perhaps not an issue in your case since you rarely change the values) and break the dataflow pardigm of LabVIEW.&lt;BR /&gt;&lt;BR /&gt;Lynn</description>
      <pubDate>Thu, 12 Jul 2007 12:09:08 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Save-and-load-global-variables/m-p/549551#M258564</guid>
      <dc:creator>johnsold</dc:creator>
      <dc:date>2007-07-12T12:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: Save and load global variables</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Save-and-load-global-variables/m-p/549552#M258565</link>
      <description>Hi Dave,&lt;BR /&gt;&lt;BR /&gt;two (easy) methods:&lt;BR /&gt;1) Use the Config file functions in the File palette, they are made just for this purpose!&lt;BR /&gt;2) Save the values using the text or spreadsheet file functions using your own file format...&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Jul 2007 12:10:51 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Save-and-load-global-variables/m-p/549552#M258565</guid>
      <dc:creator>GerdW</dc:creator>
      <dc:date>2007-07-12T12:10:51Z</dc:date>
    </item>
    <item>
      <title>Re : Save and load global variables</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Save-and-load-global-variables/m-p/549554#M258566</link>
      <description>I would say that the easiest way to do that is to use .ini files. You can find specific fonctions to read and write these files in the File I/O=&amp;gt;Config File VIs library. It's really easy and fast.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Jul 2007 12:12:04 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Save-and-load-global-variables/m-p/549554#M258566</guid>
      <dc:creator>CyGa</dc:creator>
      <dc:date>2007-07-12T12:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: Re : Save and load global variables</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Save-and-load-global-variables/m-p/549655#M258613</link>
      <description>Ok, I could do it with the &lt;SPAN class="noindex"&gt; spreadsheet file functions...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;But anyway,&amp;nbsp; thanks to all of you!&lt;BR /&gt;Dave&lt;/SPAN&gt;&lt;SPAN class="noindex"&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Jul 2007 14:17:02 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Save-and-load-global-variables/m-p/549655#M258613</guid>
      <dc:creator>Reepicheep</dc:creator>
      <dc:date>2007-07-12T14:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: Re : Save and load global variables</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Save-and-load-global-variables/m-p/550376#M258912</link>
      <description>Since your files are "waveforms" and likely to be somewhat large, you may want to consider one of the binary formats (HWS or TDMS).&amp;nbsp; They will read and write much faster and HWS even has compression.&amp;nbsp; TDMS is available from the LVM read/write express VIs in LV 8.2.&amp;nbsp; HWS is on the driver CD next to the computer based instruments.&amp;nbsp; If you have one of the computer based instrument drivers installed, you probably already have it.&amp;nbsp; It became available at LV 7.1.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 13 Jul 2007 13:32:59 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Save-and-load-global-variables/m-p/550376#M258912</guid>
      <dc:creator>DFGray</dc:creator>
      <dc:date>2007-07-13T13:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: Save and load global variables</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Save-and-load-global-variables/m-p/550635#M259031</link>
      <description>On Jul 12, 8:10 am, Reepicheep &amp;lt;x...@no.email&amp;gt; wrote:&lt;BR /&gt;
&amp;gt; Hi all&lt;BR /&gt;
&amp;gt; &amp;amp;nbsp;&lt;BR /&gt;
&amp;gt; I've got the following problem:&lt;BR /&gt;
&amp;gt; At the moment I'm working with a spectroscope. I have to extract some peaks, which are produced when the ligth is refracted by different materials. And I've got two references saved as global variables to compare with: one is a dark reference (without any light &amp;amp;amp; materials) and one only with the light.&lt;BR /&gt;
&amp;gt; &amp;amp;nbsp;&lt;BR /&gt;
&amp;gt; But when I'm restarting my system at the moment, I have to store both references again (because they're just saved within the vi's).&lt;BR /&gt;
&amp;gt; Is there a possibility to save this variables in a .txt or .xls-file, where they can be easily&amp;amp;nbsp;load from after restarting the program?&lt;BR /&gt;
&amp;gt; &amp;amp;nbsp;&lt;BR /&gt;
&amp;gt; Thanks in advance&lt;BR /&gt;
&amp;gt; &amp;amp;nbsp;&lt;BR /&gt;
&amp;gt; Dave&lt;BR /&gt;
&lt;BR /&gt;
If the variables are not written at any moment during the software&lt;BR /&gt;
execution, you can wire the global variables to those values as&lt;BR /&gt;
constant at the begining of the program.&lt;BR /&gt;
&lt;BR /&gt;</description>
      <pubDate>Fri, 13 Jul 2007 19:40:04 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Save-and-load-global-variables/m-p/550635#M259031</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-07-13T19:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: Save and load global variables</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Save-and-load-global-variables/m-p/550641#M259034</link>
      <description>You could use spreadsheets or a text file but the easiest would be to use a small Jet database. There would be less reformatting to do, the database engine itself is free (bundled inside Windows) and I can send you the code to do it. In addition if these reference values should change over time the database would be able to store historical values as well as timestamps of when they changed. In terms of formatting you simply flatten the structure (whatever it might be) to a string for insertion and then unflatten it when you read it back. In the long run a lot easier than doing it with Excel.&lt;BR /&gt;&lt;BR /&gt;Mike...&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 13 Jul 2007 19:49:17 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Save-and-load-global-variables/m-p/550641#M259034</guid>
      <dc:creator>mikeporter</dc:creator>
      <dc:date>2007-07-13T19:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Save and load global variables</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Save-and-load-global-variables/m-p/551050#M259226</link>
      <description>If you do this, be aware that "flatten to string" is a very brittle operation.&amp;nbsp; You have to know, a priori, what the data type is before you can read it.&amp;nbsp; If you lose your reader/writer code, the data becomes almost useless.&amp;nbsp; ASCII, TDMS, and HWS are all "self-describing" files.&amp;nbsp; You can find browse them without knowing their contents ahead of time.&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 16 Jul 2007 12:47:16 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Save-and-load-global-variables/m-p/551050#M259226</guid>
      <dc:creator>DFGray</dc:creator>
      <dc:date>2007-07-16T12:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: Save and load global variables</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Save-and-load-global-variables/m-p/551065#M259232</link>
      <description>While it is true that you have to know ahead of time what the datatype of the flattened data is, I don't agree that it's "useless" without the LV-based reader code. I routinely store flattened strings to Oracle blobs precisely because it is so easy for other applications to read and recover the data. The format for flattened data is well-documented and easy to code in other environments such as Java.&lt;BR /&gt;&lt;BR /&gt;Mke...&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 16 Jul 2007 13:32:07 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Save-and-load-global-variables/m-p/551065#M259232</guid>
      <dc:creator>mikeporter</dc:creator>
      <dc:date>2007-07-16T13:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: Save and load global variables</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Save-and-load-global-variables/m-p/787148#M359642</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;In my program, I&amp;nbsp;use&amp;nbsp;Global&amp;nbsp;variables table to load and process parameter. Now I want to adjust some parameter without doing in my Global&amp;nbsp;variables table ( because when I do in this way I have to compile it again). So I want to load a file include my program and it will be load in to my Global&amp;nbsp;variables table. How can I do it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Oct 2008 03:04:48 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Save-and-load-global-variables/m-p/787148#M359642</guid>
      <dc:creator>Lumidu</dc:creator>
      <dc:date>2008-10-06T03:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Save and load global variables</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Save-and-load-global-variables/m-p/787234#M359687</link>
      <description>&lt;P&gt;Hi Lumidu,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;do as said before:&lt;/P&gt;&lt;P&gt;put the values of interest into an ini-file and use the "configuration file"-vis to load them. Then write them into your globals...&lt;/P&gt;</description>
      <pubDate>Mon, 06 Oct 2008 08:22:19 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Save-and-load-global-variables/m-p/787234#M359687</guid>
      <dc:creator>GerdW</dc:creator>
      <dc:date>2008-10-06T08:22:19Z</dc:date>
    </item>
  </channel>
</rss>

