<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to CSV Utility write file problems</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/21cc9cafad/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/21cc9cafad/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/21cc9cafad/</id><updated>2023-03-07T19:37:17.061000Z</updated><subtitle>Recent posts to CSV Utility write file problems</subtitle><entry><title>CSV Utility write file problems</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/21cc9cafad/?limit=25#3781" rel="alternate"/><published>2023-03-07T19:37:17.061000Z</published><updated>2023-03-07T19:37:17.061000Z</updated><author><name>snhatton</name><uri>https://forge.codesys.com/u/snhatton/</uri></author><id>https://forge.codesys.comb914c95d85b2560d2bb02e797c5de5dfe3913f9a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Wonderful! Glad you got it working!&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CSV Utility write file problems</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/21cc9cafad/?limit=25#ec2e" rel="alternate"/><published>2023-03-07T18:37:01.088000Z</published><updated>2023-03-07T18:37:01.088000Z</updated><author><name>dagi89</name><uri>https://forge.codesys.com/u/dagi89/</uri></author><id>https://forge.codesys.coma32d31c1043b78b0ee6597ad6ae710b6537b019c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;THANKS.. fixed. &lt;/p&gt;
&lt;p&gt;i had to use the function New File of CSV Utility Package. &lt;/p&gt;
&lt;p&gt;Regards, &lt;/p&gt;
&lt;p&gt;Dagi89&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CSV Utility write file problems</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/21cc9cafad/?limit=25#e9a6" rel="alternate"/><published>2023-03-01T19:16:44.480000Z</published><updated>2023-03-01T19:16:44.480000Z</updated><author><name>snhatton</name><uri>https://forge.codesys.com/u/snhatton/</uri></author><id>https://forge.codesys.comee42a7e40bf9579682b3c81534c837d77adc937d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Good morning @Dagi89, &lt;/p&gt;
&lt;p&gt;I've attached an example for your consideration. The attached example saves a formatted csv file every 5 seconds and is based on the CSV Utility example located in: C:\Users\&amp;lt;user name=""&amp;gt;\CSV Utility SL\1.0.2.0. &amp;lt;/user&amp;gt;&lt;/p&gt;
&lt;p&gt;The csv file is limited by number of lines that can be written and file size. The program Sequential_Add_Values is where the CSV fields are defined. The program Sequential_Save will save the csv, or create a new csv if the file size is exceeded. I hope this helps!&lt;/p&gt;
&lt;p&gt;Regards, &lt;/p&gt;
&lt;p&gt;Shawn &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CSV Utility write file problems</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/21cc9cafad/?limit=25#7aa0" rel="alternate"/><published>2023-02-27T16:50:28.521000Z</published><updated>2023-02-27T16:50:28.521000Z</updated><author><name>dagi89</name><uri>https://forge.codesys.com/u/dagi89/</uri></author><id>https://forge.codesys.com2793dc8141a5a0ea861f491c04d7ef859c9b3c27</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Dear all, &lt;/p&gt;
&lt;p&gt;I am using csv utility yo write a file &lt;/p&gt;
&lt;p&gt;the functions that I use are:&lt;/p&gt;
&lt;p&gt;init:&lt;br/&gt;
VAR&lt;br/&gt;
csvWriterTemp_2Init : CSV.Init;&lt;br/&gt;
AddProductFamily    : CSV.AddSTRING;&lt;br/&gt;
CSVFileWrite        : CSV.WriteFile;&lt;/p&gt;
&lt;p&gt;END_VAR&lt;/p&gt;
&lt;p&gt;1st   csvWriterTemp_2Init(xExecute :=FALSE,sFileName:=_StringWipWrite,sDirectoryPath:=_szDir_OrdersInProduction,sRowSeparator:='$N',sColumnSeparator:=',',rCSVWriter:=CSVWriter);&lt;/p&gt;
&lt;p&gt;2nd   csvWriterTemp_2Init(xExecute :=TRUE,sFileName:=_StringWipWrite,sDirectoryPath:=_szDir_OrdersInProduction,sRowSeparator:='$N',sColumnSeparator:=',',rCSVWriter:=CSVWriter);&lt;/p&gt;
&lt;p&gt;3rd   AddProductFamily(xExecute:= TRUE,xAbort:=FALSE, sInput:=_0ProductFamily,rCSVWriter:=CSVWriter);&lt;br/&gt;
4th   AddProductFamily(xExecute:= FALSE,xAbort:=FALSE, sInput:=_0ProductFamily,rCSVWriter:=CSVWriter);&lt;/p&gt;
&lt;p&gt;Others Add functions to add additionals elements&lt;/p&gt;
&lt;p&gt;5th   CSVFileWrite(xExecute:=TRUE,xAbort:=FALSE,rCSVWriter:=CSVWriter);&lt;br/&gt;
6th   CSVFileWrite(xExecute:=FALSE,xAbort:=FALSE,rCSVWriter:=CSVWriter);    &lt;/p&gt;
&lt;p&gt;7th   csvReaderTemp_0Init(xExecute :=FALSE,szFileName:=_StringWipWrite,sLineSeparator:='$N',sColumnSeparator:=',',xCloseFile:=TRUE);&lt;br/&gt;
8th   csvReaderTemp_0Init(xExecute :=TRUE,szFileName:=_StringWipWrite,sLineSeparator:='$N',sColumnSeparator:=',',xCloseFile:=TRUE);&lt;/p&gt;
&lt;p&gt;the problem is:&lt;br/&gt;
- at the first execution the file is well created as expected.&lt;br/&gt;
text into file:(P01,M00001,PENNA 01,KitB.csv,RICETTA PERNNA 10,D,DT#2023-02-24-18:51:23,DT#2023-02-24-18:51:43,OK,NO ERROR&lt;br/&gt;
P01,M00002,PENNA 01,KitB.csv,RICETTA PERNNA 10,D,DT#2023-02-24-18:51:23,DT#2023-02-24-18:51:43,OK,NO ERROR&lt;br/&gt;
P01,M00003,PENNA 01,KitB.csv,RICETTA PERNNA 10,D,DT#2023-02-24-18:51:23,DT#2023-02-24-18:51:43,OK,NO ERROR)&lt;br/&gt;
- after that the file is renamed&lt;br/&gt;
- at the second execution the file is written wrong and the system at the beginning of the file writes ','. &lt;br/&gt;
text into file:(,P01,M00001,PENNA 01,KitB.csv,RICETTA PERNNA 10,D,DT#2023-02-24-18:51:23,DT#2023-02-24-18:51:43,OK,NO ERROR&lt;br/&gt;
P01,M00002,PENNA 01,KitB.csv,RICETTA PERNNA &lt;/p&gt;
&lt;p&gt;I do not know how to overcome this problem. &lt;/p&gt;
&lt;p&gt;is there any solution or suggestion that can help me to find a solution?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>