I am trying to use som file acces on my Raspberry PI but i don't know what i'm doing wrong.
For a test i first try to open a directory for listing but it doesn't work.
here is my code
PROGRAMPLC_PRGVAR  TimerOn    :TON:=(pt:=T#30S);  xDirOpen   :BOOL;  DirOpen    :FILE.DirOpen;  DirList    :FILE.DirList;END_VARTimerOn(IN:=DirList.xExecute);DirOpen.sDirName:='/tmp';IFxDirOpen THENDirOpen.xExecute:=TRUE;xDirOpen:=FALSE;END_IFDirList.hDir:=DirOpen.hDir;IFDirOpen.xDoneORTimerOn.QORDirOpen.eError>0ORDirOpen.xErrorTHEN  DirOpen.xExecute:=FALSE;END_IF
And here is the watchlist output.
DirOpen.xExecute is TRUE but no error or busy and done also stays FALSE
i hope someone has a solution for me.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In your code snippet we are missing the function call:
SysDirOpen();
you only set the Inputs of SysDirOpen you missed to call the function.
There is a good example in the store:
Hi,
I am trying to use som file acces on my Raspberry PI but i don't know what i'm doing wrong.
For a test i first try to open a directory for listing but it doesn't work.
here is my code
And here is the watchlist output.
DirOpen.xExecute is TRUE but no error or busy and done also stays FALSE
i hope someone has a solution for me.
Hi,
In your code snippet we are missing the function call:
SysDirOpen();
you only set the Inputs of SysDirOpen you missed to call the function.
There is a good example in the store:
http://store.codesys.com/application/fi ... ities.html
Regards
plcmax
Ty for your answer. I tested the example and sysdiropen worked oke. So i can use it in my program.