<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to CSV.CSVWriter End of Buffer Error</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/60b3fc4221/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/60b3fc4221/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/60b3fc4221/</id><updated>2021-10-15T10:34:19.928000Z</updated><subtitle>Recent posts to CSV.CSVWriter End of Buffer Error</subtitle><entry><title>CSV.CSVWriter End of Buffer Error</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/60b3fc4221/?limit=25#3284" rel="alternate"/><published>2021-10-15T10:34:19.928000Z</published><updated>2021-10-15T10:34:19.928000Z</updated><author><name>i-campbell</name><uri>https://forge.codesys.com/u/i-campbell/</uri></author><id>https://forge.codesys.com88a199de3101dc0df287b41de951bdde3c35d21c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;You need to install an IIoT Libraries SL license on your PLC, to use any libraries from IIoT Libraries SL.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CSV.CSVWriter End of Buffer Error</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/60b3fc4221/?limit=25#ac97" rel="alternate"/><published>2021-10-14T19:48:04.058000Z</published><updated>2021-10-14T19:48:04.058000Z</updated><author><name>mrehberg</name><uri>https://forge.codesys.com/u/mrehberg/</uri></author><id>https://forge.codesys.comcd8ac2c2313788e6496ec0fa73fb404acb20a00f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Nope. It appears the it was not limited by the amount of data but instead there is a 30 minute timer on the CSV utility before it is not possible to write data. &lt;/p&gt;
&lt;p&gt;But there is no license for the CSV utility since its part of the IIOT library now. Codesys, what is the solution here?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CSV.CSVWriter End of Buffer Error</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/60b3fc4221/?limit=25#9c8f" rel="alternate"/><published>2021-10-14T19:48:00.219000Z</published><updated>2021-10-14T19:48:00.219000Z</updated><author><name>mrehberg</name><uri>https://forge.codesys.com/u/mrehberg/</uri></author><id>https://forge.codesys.come8a1d736374a32d095ee8a4040b96703cbbb1c73</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Nope. It appears the it was not limited by the amount of data but instead there is a 30 minute timer on the CSV utility before it is not possible to write data. &lt;/p&gt;
&lt;p&gt;But there is no license for the CSV utility since its part of the IIOT library now. Codesys, what is the solution here?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CSV.CSVWriter End of Buffer Error</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/60b3fc4221/?limit=25#0ae9" rel="alternate"/><published>2021-10-14T18:59:09.118000Z</published><updated>2021-10-14T18:59:09.118000Z</updated><author><name>mrehberg</name><uri>https://forge.codesys.com/u/mrehberg/</uri></author><id>https://forge.codesys.com0d07fb4fedaf21d26c97b2b6521cb7e6253eff74</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Figured it out I believe. Its been able to save  16, 8 kb files so far and is still trugging along. &lt;/p&gt;
&lt;p&gt;The save program from the codesys example project does not CSVWriter.InitSave the new file that is created when the max file size has been reached. The following code changes the the initiated file name to the new file. 'First' is written to be TRUE by a StartDone program. &lt;/p&gt;
&lt;p&gt;IF First THEN&lt;br/&gt;
    FileName:=standard.CONCAT(sFileName,'.csv');&lt;br/&gt;
ELSE&lt;br/&gt;
    FileName:=standard.CONCAT(sFileName,standard.CONCAT('(',standard.CONCAT(INT_TO_STRING(count), standard.CONCAT( ')', '.csv'))));&lt;br/&gt;
END_IF&lt;/p&gt;
&lt;p&gt;IF NOT xInit THEN&lt;br/&gt;
    eError := Globals.gCSVWriter.InitSave( sDirectoryPath:=sDirectoryPath, sFileName:=FileName);&lt;br/&gt;
    IF eError &amp;lt;&amp;gt; CSV.CSV_ERROR.NO_ERROR THEN&lt;br/&gt;
        iSave := 32767;&lt;br/&gt;
    END_IF&lt;br/&gt;
    xInit := TRUE;&lt;br/&gt;
END_IF&lt;/p&gt;
&lt;p&gt;CASE iSave OF&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;0&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="o"&gt;(*&lt;/span&gt; &lt;span class="nt"&gt;Save&lt;/span&gt; &lt;span class="nt"&gt;the&lt;/span&gt; &lt;span class="nt"&gt;data&lt;/span&gt; &lt;span class="nt"&gt;from&lt;/span&gt; &lt;span class="nt"&gt;the&lt;/span&gt; &lt;span class="nt"&gt;buffer&lt;/span&gt;&lt;span class="o"&gt;*)&lt;/span&gt;
    &lt;span class="nt"&gt;IF&lt;/span&gt; &lt;span class="nt"&gt;Globals&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;gCSVWriter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Save&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;CSV&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CSV_ERROR&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;NO_ERROR&lt;/span&gt; &lt;span class="nt"&gt;THEN&lt;/span&gt;
        &lt;span class="nt"&gt;iSave&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;32767&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="nt"&gt;END_IF&lt;/span&gt;
    &lt;span class="o"&gt;(*&lt;/span&gt; &lt;span class="nt"&gt;When&lt;/span&gt; &lt;span class="nt"&gt;the&lt;/span&gt; &lt;span class="nt"&gt;file&lt;/span&gt; &lt;span class="nt"&gt;is&lt;/span&gt; &lt;span class="nt"&gt;bigger&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;than&lt;/span&gt; &lt;span class="nt"&gt;8000&lt;/span&gt; &lt;span class="nt"&gt;Byte&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="nt"&gt;new&lt;/span&gt; &lt;span class="nt"&gt;file&lt;/span&gt; &lt;span class="nt"&gt;with&lt;/span&gt; &lt;span class="nt"&gt;an&lt;/span&gt; &lt;span class="nt"&gt;generated&lt;/span&gt; &lt;span class="nt"&gt;name&lt;/span&gt; &lt;span class="nt"&gt;is&lt;/span&gt; &lt;span class="nt"&gt;created&lt;/span&gt;&lt;span class="o"&gt;.*)&lt;/span&gt;
    &lt;span class="nt"&gt;udiFileSize&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt;  &lt;span class="nt"&gt;Globals&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;gCSVWriter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetFileSize&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;peError&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;ADR&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;eError&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
    &lt;span class="nt"&gt;IF&lt;/span&gt; &lt;span class="nt"&gt;eError&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nt"&gt;CSV&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CSV_ERROR&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;NO_ERROR&lt;/span&gt; &lt;span class="nt"&gt;AND&lt;/span&gt; &lt;span class="nt"&gt;udiFileSize&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;8000&lt;/span&gt; &lt;span class="nt"&gt;THEN&lt;/span&gt;
        &lt;span class="nt"&gt;count&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;count&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nt"&gt;1&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="nt"&gt;First&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;FALSE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="nt"&gt;Globals&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;gCSVWriter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;NewFile&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="nt"&gt;Sequential_Add_Values&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;First&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;TRUE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="nt"&gt;END_IF&lt;/span&gt;

    &lt;span class="nt"&gt;IF&lt;/span&gt;  &lt;span class="nt"&gt;eError&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;CSV&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CSV_ERROR&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;NO_ERROR&lt;/span&gt; &lt;span class="nt"&gt;THEN&lt;/span&gt;
        &lt;span class="nt"&gt;iSave&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;32767&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="nt"&gt;END_IF&lt;/span&gt;

&lt;span class="nt"&gt;32767&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="o"&gt;(*&lt;/span&gt; &lt;span class="nt"&gt;Error&lt;/span&gt; &lt;span class="o"&gt;*);&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;END_CASE&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CSV.CSVWriter End of Buffer Error</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/60b3fc4221/?limit=25#bd10" rel="alternate"/><published>2021-10-14T18:08:02.158000Z</published><updated>2021-10-14T18:08:02.158000Z</updated><author><name>mrehberg</name><uri>https://forge.codesys.com/u/mrehberg/</uri></author><id>https://forge.codesys.comc40f9437276af3e9d738d4c1e03060273e507883</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hey there, &lt;/p&gt;
&lt;p&gt;I am running an application and using the CSVWriter as a data logger. It will work well for 29 kb but then stops recording. &lt;br/&gt;
The CSVWriter parameter logDemoExiration turns true when this 29 kb limit is hit. I have the license for the SL IoT library which contains the CSV utility installed on my workstation so I am thinking it may be some other reason. At this time my add values to file function throws the "End_of_buffer" error. &lt;/p&gt;
&lt;p&gt;I essentially copied the code I am using to write the CSV from the Codesys sample project on the matter. &lt;/p&gt;
&lt;p&gt;Anyone know why this 29 kb limit is being reached? Or a better way of logging data (my application will only be used for a batch experiment so server level data management doesn't really apply) ?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>