<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Directory Open Endless loop problem</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/8c0236785a/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/8c0236785a/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/8c0236785a/</id><updated>2020-02-27T14:11:23.728000Z</updated><subtitle>Recent posts to Directory Open Endless loop problem</subtitle><entry><title>Directory Open Endless loop problem</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/8c0236785a/?limit=25#0bc6" rel="alternate"/><published>2020-02-27T14:11:23.728000Z</published><updated>2020-02-27T14:11:23.728000Z</updated><author><name>timvh</name><uri>https://forge.codesys.com/u/timvh/</uri></author><id>https://forge.codesys.com3fea2c60fb1460c59c8be348a572df9e36826fca</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Yes, that is my experience.&lt;br/&gt;
It is made like this to make sure it is non-blocking.&lt;br/&gt;
With the SysFile library the PLC execution halted untill the OS returned a result, but this was not good for time critical applications.&lt;/p&gt;
&lt;p&gt;I don't know the exact reason behind it (internal operation) why it takes at least 2 scans.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Directory Open Endless loop problem</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/8c0236785a/?limit=25#f945" rel="alternate"/><published>2020-02-27T14:11:22.567000Z</published><updated>2020-02-27T14:11:22.567000Z</updated><author><name>yue-qi-qi</name><uri>https://forge.codesys.com/u/yue-qi-qi/</uri></author><id>https://forge.codesys.com09cb549d5875888e552afbf5839918725db15a7d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TimvH hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
Remove the repeat / untill loop&lt;br/&gt;
It could take some scans before the OS returns a result.&lt;br/&gt;
Wait for the done/error and then set a condition to handle the next step.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;====================================================&lt;br/&gt;
Do you mean that the scan cannot be excute during a PLC cycle even if the PLC cycle takes a long time? but must be execute during the intervals between two PLC cycles?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Directory Open Endless loop problem</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/8c0236785a/?limit=25#86a3" rel="alternate"/><published>2020-02-27T14:11:22.226000Z</published><updated>2020-02-27T14:11:22.226000Z</updated><author><name>timvh</name><uri>https://forge.codesys.com/u/timvh/</uri></author><id>https://forge.codesys.com2582461336aef8da2c2e74a019c8182c7076cf91</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Remove the repeat / untill loop&lt;br/&gt;
It could take some scans before the OS returns a result.&lt;br/&gt;
Wait for the done/error and then set a condition to handle the next step.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Directory Open Endless loop problem</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/8c0236785a/?limit=25#2575" rel="alternate"/><published>2020-02-27T14:11:21.880000Z</published><updated>2020-02-27T14:11:21.880000Z</updated><author><name>yue-qi-qi</name><uri>https://forge.codesys.com/u/yue-qi-qi/</uri></author><id>https://forge.codesys.com75431d3fc26de1de2e0054dcd1e79a501ce95b8a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;If I want to open some directory by the following way:&lt;/p&gt;
&lt;p&gt;PROGRAM PLC_PRG&lt;br/&gt;
   VAR&lt;br/&gt;
      xDirOpen:BOOL;&lt;br/&gt;
      DirOpen:FILE.DirOpen;&lt;br/&gt;
   END_VAR&lt;/p&gt;
&lt;p&gt;===================&lt;br/&gt;
  IF  xDirOpen THEN&lt;br/&gt;
      REPEAT&lt;br/&gt;
          DirOpen(xExecute:=xDirOpen,sDirName:='D:\myTestDir';&lt;br/&gt;
          IF DirOpen.xDone OR DirOpen.xError THEN&lt;br/&gt;
             xDirOpen:=FALSE;&lt;br/&gt;
              DirOpen(xExecute:=FALSE);&lt;br/&gt;
          END_IF&lt;br/&gt;
      UNTIL NOT xDirOpen&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;  &lt;span class="n"&gt;END_REPEAT&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;END_IF&lt;/p&gt;
&lt;p&gt;When the program is running,I change the value of xDirOpen from FALSE to TURE,but the result is endless loop! &lt;br/&gt;
  Can someone give some explaination?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>