<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Codesys Boot application not working on boot</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ab540ef4f2/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ab540ef4f2/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/ab540ef4f2/</id><updated>2022-08-19T11:11:24.612000Z</updated><subtitle>Recent posts to Codesys Boot application not working on boot</subtitle><entry><title>Codesys Boot application not working on boot</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ab540ef4f2/?limit=25#a8d6" rel="alternate"/><published>2022-08-19T11:11:24.612000Z</published><updated>2022-08-19T11:11:24.612000Z</updated><author><name>master-student</name><uri>https://forge.codesys.com/u/master-student/</uri></author><id>https://forge.codesys.com2602897c0d9bf0c31cfab9ddd577d20ee2578eb1</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I am using Beagle Bone Black as device(similar to raspberry pi), I created a ST program to read one-wire temperature file and make a string value out of it and it works fine when I try it in codesys. but once I made the boot application and when I restart the beagle bone the application it is not working. I tried changing the file location and then restarted the beagle bone and the application seems to be working. Does anyone have any Idea why exactly this file is not compatible?. Thank you in advance.&lt;br/&gt;
I included the code bellow~~~&lt;/p&gt;
&lt;p&gt;code&lt;br/&gt;
~~~PROGRAM FIlE_OP&lt;br/&gt;
VAR&lt;/p&gt;
&lt;p&gt;sFileName      : FILE.CAA.FILENAME;&lt;br/&gt;
   FileOpen       : File.Open;&lt;br/&gt;
   FileClose      : File.Close;&lt;br/&gt;
   FileRead       : File.Read;&lt;br/&gt;
   iState         : UINT; &lt;br/&gt;
   hfile          : FILE.CAA.HANDLE;&lt;/p&gt;
&lt;p&gt;END_VAR&lt;br/&gt;
VAR_INPUT&lt;br/&gt;
   xInit          : BOOL;&lt;/p&gt;
&lt;p&gt;END_VAR&lt;br/&gt;
VAR_OUTPUT&lt;br/&gt;
   xError         : BOOL;&lt;br/&gt;
   xDone          : BOOL:=true;&lt;br/&gt;
sReadLine         : STRING(1024); &lt;/p&gt;
&lt;p&gt;END_VAR&lt;br/&gt;
CASE iState OF&lt;br/&gt;
     0: &lt;br/&gt;
      sFileName := '/sys/bus/w1/devices/28-44260f1e64ff/w1_slave';&lt;br/&gt;
      xDone := FALSE;&lt;br/&gt;
      xError := FALSE;&lt;br/&gt;
      iState:= 3;&lt;br/&gt;
3: // Open the file with read access.&lt;br/&gt;
      FileOpen(xExecute:= TRUE, sFileName:= sFileName, xExclusive:= FALSE, eFileMode:= File.MODE.MREAD);&lt;br/&gt;
      IF FileOpen.xDone = TRUE THEN&lt;br/&gt;
         hfile := FileOpen.hFile;&lt;br/&gt;
         FileOpen(xExecute:= FALSE);&lt;br/&gt;
         iState := 4;&lt;br/&gt;
      ELSIF FileOpen.xError = TRUE THEN&lt;br/&gt;
         iState:= 32767;&lt;br/&gt;
         FileOpen(xExecute:= FALSE);&lt;br/&gt;
      END_IF&lt;/p&gt;
&lt;p&gt;4: // Read the string from the file.&lt;br/&gt;
      FileRead(xExecute:= TRUE, hFile:= hfile, pBuffer:= ADR(sReadLine), szBuffer:= SIZEOF(sReadLine));&lt;br/&gt;
      IF FileRead.xDone = TRUE THEN&lt;br/&gt;
         iState := 5;&lt;br/&gt;
         // Cut off the unused characters.&lt;br/&gt;
         //sReadLine := MID(sReadLine, ANY_TO_INT(FileRead.szSize), 1);&lt;br/&gt;
         FileRead(xExecute:= FALSE);&lt;br/&gt;
      ELSIF FileRead.xError = TRUE THEN&lt;br/&gt;
         iState:= 32767;&lt;br/&gt;
         FileRead(xExecute:= FALSE);&lt;br/&gt;
      END_IF&lt;/p&gt;
&lt;p&gt;5: // Close that file.&lt;br/&gt;
      FileClose(xExecute:= TRUE, hFile:= hfile);&lt;br/&gt;
      IF FileClose.xDone = TRUE THEN&lt;br/&gt;
         iState:= 0;&lt;br/&gt;
         FileClose(xExecute:= FALSE);&lt;br/&gt;
      ELSIF FileClose.xError = TRUE THEN&lt;br/&gt;
         iState:= 32767;&lt;br/&gt;
         FileClose(xExecute:= FALSE);&lt;br/&gt;
      END_IF&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt;END_CASE&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</summary></entry></feed>