<?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: Basic question TDMS in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4023501#M1151908</link>
    <description>&lt;P&gt;Hi Gerd again,&lt;/P&gt;
&lt;P&gt;You are seeing all, the space was not wanted.&lt;/P&gt;
&lt;P&gt;---&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;SPAN&gt;Open the file&amp;nbsp;&lt;/SPAN&gt;&lt;U&gt;once&lt;/U&gt;&lt;SPAN&gt;&amp;nbsp;on "start logging" and close it&amp;nbsp;&lt;/SPAN&gt;&lt;U&gt;once&lt;/U&gt;&lt;SPAN&gt;&amp;nbsp;at "Stop logging", but use the file reference in between!&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I´m sorry but i didn´t understand&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Mar 2020 18:00:31 GMT</pubDate>
    <dc:creator>Hulk1978</dc:creator>
    <dc:date>2020-03-12T18:00:31Z</dc:date>
    <item>
      <title>Basic question TDMS</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4023358#M1151842</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i build a small datalogger. It works now fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;But i have a strange effect at tdms datalogging. It always stops at around 3h. Sometimes with error 6, sometimes not.&lt;/P&gt;
&lt;P&gt;Samplerate is 100 and samples 100,too. So should be 100Hz.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 12:18:53 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4023358#M1151842</guid>
      <dc:creator>Hulk1978</dc:creator>
      <dc:date>2020-03-12T12:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: Basic question TDMS</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4023361#M1151845</link>
      <description>&lt;P&gt;What version of OS (32/64?)&lt;BR /&gt;File size after stopping?&lt;BR /&gt;And what file system?&lt;BR /&gt;You may have reached the file size limit in your environment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;upd:&lt;/P&gt;
&lt;P&gt;Also show your source code if it is really small. Maybe there is some kind of mistake&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 12:32:25 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4023361#M1151845</guid>
      <dc:creator>Artem.SPb</dc:creator>
      <dc:date>2020-03-12T12:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Basic question TDMS</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4023371#M1151850</link>
      <description>&lt;P&gt;I´m using windows 10 64bit professionell. Filesystem is NTFS?&lt;/P&gt;
&lt;P&gt;Labview is 2016 32bit.&lt;/P&gt;
&lt;P&gt;Filesize of tdms is ~15mb after ~3h&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 13:07:19 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4023371#M1151850</guid>
      <dc:creator>Hulk1978</dc:creator>
      <dc:date>2020-03-12T13:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Basic question TDMS</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4023379#M1151851</link>
      <description>&lt;P&gt;Hi Hulk,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/344934"&gt;@Hulk1978&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;But i have a strange effect at tdms datalogging. It always stops at around 3h. Sometimes with error 6, sometimes not.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You are constantly opening the TDMS file, but you are never closing the file!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Open the file &lt;U&gt;once&lt;/U&gt; on "start logging" and close it &lt;U&gt;once&lt;/U&gt; at "Stop logging", but use the file reference in between!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Btw. is there a reason to have a space at the end of the filename of "create path " VI?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 13:21:00 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4023379#M1151851</guid>
      <dc:creator>GerdW</dc:creator>
      <dc:date>2020-03-12T13:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: Basic question TDMS</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4023501#M1151908</link>
      <description>&lt;P&gt;Hi Gerd again,&lt;/P&gt;
&lt;P&gt;You are seeing all, the space was not wanted.&lt;/P&gt;
&lt;P&gt;---&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;SPAN&gt;Open the file&amp;nbsp;&lt;/SPAN&gt;&lt;U&gt;once&lt;/U&gt;&lt;SPAN&gt;&amp;nbsp;on "start logging" and close it&amp;nbsp;&lt;/SPAN&gt;&lt;U&gt;once&lt;/U&gt;&lt;SPAN&gt;&amp;nbsp;at "Stop logging", but use the file reference in between!&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I´m sorry but i didn´t understand&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 18:00:31 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4023501#M1151908</guid>
      <dc:creator>Hulk1978</dc:creator>
      <dc:date>2020-03-12T18:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: Basic question TDMS</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4023540#M1151924</link>
      <description>&lt;P&gt;Hi Hulk,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/344934"&gt;@Hulk1978&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;SPAN&gt;Open the file&amp;nbsp;&lt;/SPAN&gt;&lt;U&gt;once&lt;/U&gt;&lt;SPAN&gt;&amp;nbsp;on "start logging" and close it&amp;nbsp;&lt;/SPAN&gt;&lt;U&gt;once&lt;/U&gt;&lt;SPAN&gt;&amp;nbsp;at "Stop logging", but use the file reference in between!&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I´m sorry but i didn´t understand &lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Right now you open a new file ref with each iteration, but NEVER close all those references. Both is bad: no need to open so many references, and each reference you open should be closed too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Simple solution: open the file once when you start to log data, and close the file once you stop the logging!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 20:11:06 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4023540#M1151924</guid>
      <dc:creator>GerdW</dc:creator>
      <dc:date>2020-03-12T20:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Basic question TDMS</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4023579#M1151933</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="references.png" style="width: 565px;"&gt;&lt;img src="https://ip1.i.lithium.com/d7d24f6c932158a2b4ce63bdf274f6f4e924f73c/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32363339333369443234464332364546313838314532302f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="references.png" alt="references.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that you could use a shift register in the second loop, but since it's a reference it shouldn't matter for this case.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 21:50:21 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4023579#M1151933</guid>
      <dc:creator>BertMcMahan</dc:creator>
      <dc:date>2020-03-12T21:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Basic question TDMS</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4023632#M1151954</link>
      <description>&lt;P&gt;As a quick further note on references and shift registers:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;While loops will always execute at least once. So a tunnel is fine provided you wire it through&lt;/LI&gt;
&lt;LI&gt;For loops can execute zero times (depending on the way their iteration count is controlled - e.g. empty array set to autoindex). This means that the value out of tunnels is the "default default" for the type, which for a reference is invalid. So use a Shift Register with a For loop even with references if the number of iterations can ever be zero (even if you don't expect it to be zero).&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Fri, 13 Mar 2020 02:53:28 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4023632#M1151954</guid>
      <dc:creator>cbutcher</dc:creator>
      <dc:date>2020-03-13T02:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: Basic question TDMS</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4026291#M1153417</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i tested the version with permanent open and close the tdms file. That´s not possible. System performance is going down.&lt;/P&gt;
&lt;P&gt;The second solution is not possible because i need to open the file inside of while loop. I´m sending the path from the event struct.&lt;/P&gt;
&lt;P&gt;Any other solutions?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 11:36:55 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4026291#M1153417</guid>
      <dc:creator>Hulk1978</dc:creator>
      <dc:date>2020-03-19T11:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: Basic question TDMS</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4026297#M1153421</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/344934"&gt;@Hulk1978&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;i tested the version with permanent open and close the tdms file. That´s not possible. System performance is going down.&lt;/P&gt;
&lt;P&gt;The second solution is not possible because i need to open the file inside of while loop. I´m sending the path from the event struct.&lt;/P&gt;
&lt;P&gt;Any other solutions?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Naturally, it is crazy to open and close the file at every step.&lt;BR /&gt;It is very possible to open the file “before” the cycle, for this you need to learn two simple mechanisms: a state machine and a shift register.&lt;BR /&gt;Here are three cases in ONE loop. You do not need to do three separate cycles, I showed them only to understand what is happening in hidden cases.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sm.png" style="width: 356px;"&gt;&lt;img src="https://ip1.i.lithium.com/756e2ec2b2c026343bb48b6759b05b1e37a24447/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32363432363169324442393444374637454136463334332f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="sm.png" alt="sm.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 11:50:14 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4026297#M1153421</guid>
      <dc:creator>Artem.SPb</dc:creator>
      <dc:date>2020-03-19T11:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: Basic question TDMS</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4026301#M1153424</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/16916"&gt;@GerdW&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Hulk,&lt;/P&gt;
&lt;P&gt;You are constantly opening the TDMS file, but you are never closing the file!&lt;/P&gt;
&lt;P&gt;Open the file &lt;U&gt;once&lt;/U&gt; on "start logging" and close it &lt;U&gt;once&lt;/U&gt; at "Stop logging", but use the file reference in between!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, this should be spot on.&lt;/P&gt;
&lt;P&gt;With the afforementioned 100 samples/sec and 3 hours you get to 1 million refs, which should stop the system.&lt;/P&gt;
&lt;P&gt;/Y&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 12:21:23 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4026301#M1153424</guid>
      <dc:creator>Yamaeda</dc:creator>
      <dc:date>2020-03-19T12:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: Basic question TDMS</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4026319#M1153436</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/344934"&gt;@Hulk1978&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi guys,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i tested the version with permanent open and close the tdms file. That´s not possible. System performance is going down.&lt;/P&gt;
&lt;P&gt;The second solution is not possible because i need to open the file inside of while loop. I´m sending the path from the event struct.&lt;/P&gt;
&lt;P&gt;Any other solutions?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I was going to demonstrate passing the path to the appropriate case, but I see you already do that in your code.&lt;/P&gt;
&lt;P&gt;I'd like to suggest that you might find some value in using an enum (as you already are) and a variant as the datatype in order to allow passing more arbitrary "data", but that's up to you and may not be necessary.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As to the path and opening/closing, you should do as Artem.SPb shows and only use TDMS Open in the "Start" case, TDMS Close in the "Stop" case, and then write during the write case.&lt;/P&gt;
&lt;P&gt;To handle sometimes logging and sometimes not, you can check if the refnum is a valid refnum using&amp;nbsp;&lt;A href="https://zone.ni.com/reference/en-XX/help/371361R-01/glang/not_a_number_path_refnum/" target="_self"&gt;Not a Number/Path/Refnum&lt;/A&gt;&amp;nbsp;or you can just always try to write, but ignore the error from an invalid reference (be careful if you choose to do this).&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 13:21:41 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4026319#M1153436</guid>
      <dc:creator>cbutcher</dc:creator>
      <dc:date>2020-03-19T13:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: Basic question TDMS</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4026359#M1153454</link>
      <description>&lt;P&gt;hm,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;it seems that i need a state machine....&lt;/P&gt;
&lt;P&gt;I need more time to reconstruct &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 15:00:34 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Basic-question-TDMS/m-p/4026359#M1153454</guid>
      <dc:creator>Hulk1978</dc:creator>
      <dc:date>2020-03-19T15:00:34Z</dc:date>
    </item>
  </channel>
</rss>

