<?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: Inconsistent newline using Write to Text function in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2799080#M821237</link>
    <description>&lt;P&gt;Why don't you post the actual code instead of a picture so we can see what is in the other cases not visible in the picture?&amp;nbsp; Seems kind of convoluted for simple log file.&lt;/P&gt;</description>
    <pubDate>Mon, 31 Mar 2014 17:55:03 GMT</pubDate>
    <dc:creator>billko</dc:creator>
    <dc:date>2014-03-31T17:55:03Z</dc:date>
    <item>
      <title>Inconsistent newline using Write to Text function</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2798954#M821212</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a subvi in my project that is used to log data to a text file according to a user specified recording interval. I use the Get Date/Time in seconds function and concatenate the output to my data using format into string. Then I use the Write to Text File function to write the string to the file. 99% of the time, Write to Text seem to appends a CRLF to the end of the line&lt;SPAN style="line-height: 15px;"&gt;. 1% of the time it doesn't seem to append a CRLF and I end up with a line in my log file that looks like "Timestamp,Data,Next_Timestamp,Next_Data"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect a race condition maybe causing my trouble due to the inconsistent nature of the problem, but I don't see where it could be coming from. I've attached a .png showing my logfile code. Please let me know if you need any additional information. Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2014 16:23:18 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2798954#M821212</guid>
      <dc:creator>_Ben_</dc:creator>
      <dc:date>2014-03-31T16:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent newline using Write to Text function</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2799010#M821221</link>
      <description>&lt;P&gt;Your issue would have to be coming from the Current Data input.&amp;nbsp; So you need to look everywhere that you call this subVI and make sure the end of line constant is correct.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2014 17:04:46 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2799010#M821221</guid>
      <dc:creator>crossrulz</dc:creator>
      <dc:date>2014-03-31T17:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent newline using Write to Text function</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2799048#M821229</link>
      <description>&lt;P&gt;Thanks for the reply!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unless I am somehow mistaken, I am not providing the end of line constant. Instead, the Write to Text function is appending it to the string I am passing. It's just sometimes, for whatever reason, Write to Text doesn't append the end of line.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2014 17:33:00 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2799048#M821229</guid>
      <dc:creator>_Ben_</dc:creator>
      <dc:date>2014-03-31T17:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent newline using Write to Text function</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2799062#M821230</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;_Ben_ wrote: &lt;BR /&gt;
&lt;P&gt;Unless I am somehow mistaken, I am not providing the end of line constant. Instead, the Write to Text function is appending it to the string I am passing. It's just sometimes, for whatever reason, Write to Text doesn't append the end of line.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You are mistaken.&amp;nbsp; The Write To Text File does not append an End Of Line.&amp;nbsp; You have to write it.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2014 17:41:39 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2799062#M821230</guid>
      <dc:creator>crossrulz</dc:creator>
      <dc:date>2014-03-31T17:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent newline using Write to Text function</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2799080#M821237</link>
      <description>&lt;P&gt;Why don't you post the actual code instead of a picture so we can see what is in the other cases not visible in the picture?&amp;nbsp; Seems kind of convoluted for simple log file.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2014 17:55:03 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2799080#M821237</guid>
      <dc:creator>billko</dc:creator>
      <dc:date>2014-03-31T17:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent newline using Write to Text function</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2799136#M821250</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/288383"&gt;@_Ben_&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a subvi in my project that is used to log data to a text file according to a user specified recording interval. I use the Get Date/Time in seconds function and concatenate the output to my data using format into string. Then I use the Write to Text File function to write the string to the file. 99% of the time, Write to Text seem to appends a CRLF to the end of the line&lt;SPAN style="line-height: 15px;"&gt;. 1% of the time it doesn't seem to append a CRLF and I end up with a line in my log file that looks like "Timestamp,Data,Next_Timestamp,Next_Data"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect a race condition maybe causing my trouble due to the inconsistent nature of the problem, but I don't see where it could be coming from. I've attached a .png showing my logfile code. Please let me know if you need any additional information. Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;just slap a build array on the string in front of the write to text file.&lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://ni.lithium.com/i/smilies/16x16_smiley-wink.gif" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know, that kind of sucks to have such a simple solution available but it works without having to go and dig through all the callers. &amp;nbsp;That EOL conversion can forgive a lot of string formating mistakes.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2014 18:28:29 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2799136#M821250</guid>
      <dc:creator>JÞB</dc:creator>
      <dc:date>2014-03-31T18:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent newline using Write to Text function</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2799148#M821253</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/123634"&gt;@JÞB&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/288383"&gt;@_Ben_&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a subvi in my project that is used to log data to a text file according to a user specified recording interval. I use the Get Date/Time in seconds function and concatenate the output to my data using format into string. Then I use the Write to Text File function to write the string to the file. 99% of the time, Write to Text seem to appends a CRLF to the end of the line&lt;SPAN style="line-height: 15px;"&gt;. 1% of the time it doesn't seem to append a CRLF and I end up with a line in my log file that looks like "Timestamp,Data,Next_Timestamp,Next_Data"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect a race condition maybe causing my trouble due to the inconsistent nature of the problem, but I don't see where it could be coming from. I've attached a .png showing my logfile code. Please let me know if you need any additional information. Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;just slap a build array on the string in front of the write to text file.&lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://ni.lithium.com/i/smilies/16x16_smiley-wink.gif" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know, that kind of sucks to have such a simple solution available but it works without having to go and dig through all the callers. &amp;nbsp;That EOL conversion can forgive a lot of string formating mistakes.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So it won't add an extra EOL if one is already there?&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2014 18:34:15 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2799148#M821253</guid>
      <dc:creator>billko</dc:creator>
      <dc:date>2014-03-31T18:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent newline using Write to Text function</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2799156#M821254</link>
      <description>&lt;P&gt;@ Not so lowly minion&lt;/P&gt;
&lt;P&gt;Nope, &amp;nbsp;It'll convert any EOL it sees to the OS specific EOL and only add one if its missing one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Open the example from the help and play with it to prove it to yourself.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2014 18:45:25 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2799156#M821254</guid>
      <dc:creator>JÞB</dc:creator>
      <dc:date>2014-03-31T18:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent newline using Write to Text function</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2799202#M821265</link>
      <description>&lt;P&gt;Sorry about that! Here is the code.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2014 19:22:08 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2799202#M821265</guid>
      <dc:creator>_Ben_</dc:creator>
      <dc:date>2014-03-31T19:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent newline using Write to Text function</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2799210#M821267</link>
      <description>&lt;P&gt;This code looks very fragile.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 15px;"&gt;How do expect a reasonable refnum out if the FALSE case executes?&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 15px;"&gt;Definitely don't convert EOL when writing (right-click...uncheck convert EOL)&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 15px;"&gt;What is the reason for the sequence structure? Makes no difference here.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 15px;"&gt;...&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Mon, 31 Mar 2014 19:29:29 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2799210#M821267</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2014-03-31T19:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent newline using Write to Text function</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2799214#M821268</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/123634"&gt;@JÞB&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;@ Not so lowly minion&lt;/P&gt;
&lt;P&gt;Nope, &amp;nbsp;It'll convert any EOL it sees to the OS specific EOL and only add one if its missing one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Open the example from the help and play with it to prove it to yourself.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Guess again, Jeff.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://ni.lithium.com/ni/attachments/ni/170/821268/1/Write%20and%20Read%20Text%20File.png" border="0" alt="" title="" align="middle" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2014 19:31:44 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2799214#M821268</guid>
      <dc:creator>crossrulz</dc:creator>
      <dc:date>2014-03-31T19:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent newline using Write to Text function</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2799252#M821273</link>
      <description>&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/aa5b2584fbf23e063965e4853f621eca5fb00700/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31333737363669464131394641383841343341353437342f696d6167652d73697a652f6f726967696e616c3f763d6d70626c2d312670783d2d31" border="0" alt="Capture.PNG" title="Capture.PNG" align="center" /&gt;&lt;/P&gt;
&lt;P&gt;That's not quite kosher&lt;img id="smileyfrustrated" class="emoticon emoticon-smileyfrustrated" src="https://ni.lithium.com/i/smilies/16x16_smiley-frustrated.gif" alt="Smiley Frustrated" title="Smiley Frustrated" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2014 19:47:28 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2799252#M821273</guid>
      <dc:creator>JÞB</dc:creator>
      <dc:date>2014-03-31T19:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent newline using Write to Text function</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2799260#M821274</link>
      <description>&lt;P&gt;Thanks for your reply, altenbach. I will try to answer your questions, and if you have suggestions for a better way, please let me know!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The false case can only execute after the true case. The true case queries a device to obtain current channel names, which are then used as a header in the log file. The false case writes numeric data to the log file under the header.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you elaborate on why I should uncheck convert EOL? Is this causing the inconsistent behavior that I am seeing? If I add an end of line to my format into string function and uncheck convert EOL, do you believe that will fix the problem?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The sequence structure is leftover from some debugging I was doing and should be deleted. Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2014 19:49:12 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Inconsistent-newline-using-Write-to-Text-function/m-p/2799260#M821274</guid>
      <dc:creator>_Ben_</dc:creator>
      <dc:date>2014-03-31T19:49:12Z</dc:date>
    </item>
  </channel>
</rss>

