Beruflich Dokumente
Kultur Dokumente
CoDeSys V 3.x
SysFileAsync.library
CONTENT
1 OVERVIEW 3
2 LIBRARY MODULES 4
CHANGE HISTORY 6
libdoc_e.dot / V1.0
1 Overview
Note: It depends on the target system, which system libraries can be used in the application program.
This library supports asynchronous file accesses out of the IEC application. It automatically
includes the library SysFile.library for synchronous communication, whose modules are used
as a basis for the corresponding asynchronous functionality. The modules of SysFile.library
make available their parameters to the SysComAsync.library in appropriate structures. Thus
these parameters can be used by the methods and wrapper-methods of SysFileAsync.library.
Attention: Asynchronous file access might influence the real time behaviour of the system!
libdoc_e.dot / V1.0
2 Library Modules
Due to the fact that the async-functionality for file accesses is basing on the modules of
SysFile.library, using wrapper-methods and shared structures (DUTs), the async-modules
always need the following input parameters:
Input-Variable Datentyp Beschreibung
The functions:
SysFileCloseAsync
SysFileCopyAsync
SysFileDeleteAsync
SysFileDeleteByHandleAsync
SysFileEOFAsync
SysFileGetNameAsync
SysFileGetPathAsync
SysFileGetPosAsync
SysFileGetSizeAsync
SysFileGetSizeByHandleAsync
SysFileGetStatusAsync
SysFileGetTimeAsync
SysFileOpenAsync
SysFileReadAsync
libdoc_e.dot / V1.0
SysFileRenameAsync
SysFileSetPosAsync
SysFileWriteAsync
The structures (DUTs, Data Unit Types) are named according to the following syntax:
t<function of SysCom.library>. Example: tSysFileOpen.
The return value of each function is given in the structure element pulOut resp. pOut or
pszOut.
Example:
DECLARATION:
udStateOpen: UDINT := ASYNCSTATE_INVALID;
ParamOpen : tSysFileOpen;
TestFB : SysFileAsyncFB;
Result: UDINT;
IMPLEMENTATION:
ParamOpen.pResult := adr(Result);
ParamOpen.pulOut := adr(hCom);
ParamOpen.wPort := 1;
hJob := TestFB.SysFileOpenAsync(adr(ParamOpen), adr(udStateOpen),
adr(Result));
When calling the method SysFileOpenAsync, the asynchronous job gets started. The job will
be finished as soon as the status has got one of the following three values:
For a description of the particular parameters please see the chapters on the corresponding
functions in the documentation on SysFile.library.
libdoc_e.dot / V1.0
Change History
Version Description Date