<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Create and write data in a file text (csv)</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/0827fca7f6/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Runtime/thread/0827fca7f6/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Runtime/thread/0827fca7f6/</id><updated>2021-03-10T10:51:31.600000Z</updated><subtitle>Recent posts to Create and write data in a file text (csv)</subtitle><entry><title>Create and write data in a file text (csv)</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/0827fca7f6/?limit=25#8f75" rel="alternate"/><published>2021-03-10T10:51:31.600000Z</published><updated>2021-03-10T10:51:31.600000Z</updated><author><name>i-campbell</name><uri>https://forge.codesys.com/u/i-campbell/</uri></author><id>https://forge.codesys.com14ee8ecfdd67204d34228cd7812a221ded99cfae</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I do not know the answer to your problem. For me though, I think the CAA File is still very low level and difficult to get right.  If you want to save yourself some hassle, use the &lt;a class="" href="https://store.codesys.com/iiot-libraries-sl.html" rel="nofollow"&gt;CSV Utils SL library&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Create and write data in a file text (csv)</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/0827fca7f6/?limit=25#f1e6" rel="alternate"/><published>2021-03-10T07:27:41.261000Z</published><updated>2021-03-10T07:27:41.261000Z</updated><author><name>julien</name><uri>https://forge.codesys.com/u/julien/</uri></author><id>https://forge.codesys.comf5aedc2ea90e4ddc4527809f58bc536ffd9c679b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello everybody,&lt;/p&gt;
&lt;p&gt;i try to write data in a file text without succes.&lt;br/&gt;
I use the CAA_File library. &lt;br/&gt;
First problem, I never get the position at the end of the file.&lt;br/&gt;
I know the handling of the files is asynchronous, so I put a timeout between fileof and filwr to make sure the return from fileof.xDone and fileof.xEOF is done correctly.&lt;br/&gt;
If xEOF is false, I increment the position by one and execute filsp (setPosition) and retest fileof (xExecute: = TRUE)&lt;br/&gt;
However my pointer position index increases to values exceeding thousands when there are less than 10 characters.&lt;br/&gt;
I have to write a file of three lines and twenty-one columns from an array of variables (nothing complicated there to loop).&lt;br/&gt;
The loop work as:&lt;br/&gt;
1 - getPosition&lt;br/&gt;
2 - test if xEOF&lt;br/&gt;
3 - If not xEOF then iPosition++, setPosition and back to test xEOF.&lt;br/&gt;
4 - If xEOF then write the data&lt;span&gt;[i]&lt;/span&gt; in the text file and back to getPosition for pprocess the data&lt;span&gt;[i+1]&lt;/span&gt;&lt;br/&gt;
5 - i and j = maxCounter then filcl&lt;/p&gt;
&lt;p&gt;I can't find the right way to do this with filgp, fileof, and filsp.&lt;br/&gt;
Would you like to explain to me how and how fileof works?&lt;br/&gt;
Thanks.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>