<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to how to read a text file using codesys..</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/e4a7e1b7d5/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/e4a7e1b7d5/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/e4a7e1b7d5/</id><updated>2020-02-27T19:50:41.602000Z</updated><subtitle>Recent posts to how to read a text file using codesys..</subtitle><entry><title>how to read a text file using codesys..</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/e4a7e1b7d5/?limit=25#f91d" rel="alternate"/><published>2020-02-27T19:50:41.602000Z</published><updated>2020-02-27T19:50:41.602000Z</updated><author><name>Avgur</name><uri>https://forge.codesys.com/u/avgur/</uri></author><id>https://forge.codesys.comfecc0e9ed70775faeff193c124b11ed5a12d36c0</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;I think CoDeSys just SIMULATE behaviour of the controller and can't create or read files as well as it can't simulate COM port and work with it. Thus the function SysFileOpen always returns 0.&lt;/p&gt;
&lt;p&gt;my example&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;hnd&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;SysFileOpen&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/data/mylog.txt'&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'r'&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;...&lt;/span&gt;
&lt;span class="nt"&gt;SysFileRead&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;hnd&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;buffer&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt;&lt;span class="nt"&gt;bytes_to_read&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;It's a good idea to use forum search: &lt;a class="" href="http://forum-en.3s-software.com/viewtopic.php?t=157" rel="nofollow"&gt;the same question on this page&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>how to read a text file using codesys..</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/e4a7e1b7d5/?limit=25#aa66" rel="alternate"/><published>2020-02-27T19:50:40.262000Z</published><updated>2020-02-27T19:50:40.262000Z</updated><author><name>bharathreddy</name><uri>https://forge.codesys.com/u/bharathreddy/</uri></author><id>https://forge.codesys.combb56dc6dc759a54961bab2398319ea325a6e0467</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi everybody,&lt;/p&gt;
&lt;p&gt;In my project i need to read a text file ,for this purpose i am using SysFileOpen, SysFileRead functions .But when i run the application in simulation mode and checked the output from SysFileOpen block it always showing 0 only.I included necessary library file also (SysLibFile.Lib) .&lt;/p&gt;
&lt;p&gt;can anybody help me in this regard or i need to do anything further...&lt;/p&gt;
&lt;p&gt;any help is appreciated&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; regards,&lt;/p&gt;
&lt;p&gt;bharath&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>