Sunteți pe pagina 1din 6

Library Description:

CoDeSys V 3.x
SysFileAsync.library

Document Version 1.0


libdoc_e.dot / V1.0

3S - Smart Software Solutions GmbH Page 1 of 6


SysFileAsync_V3x_E.doc
Library SysFileAsync.library

CONTENT

1 OVERVIEW 3

2 LIBRARY MODULES 4

CHANGE HISTORY 6
libdoc_e.dot / V1.0

3S - Smart Software Solutions GmbH Page 2 of 6


SysFileAsync_V3x_E.doc
Library SysFileAsync.library

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.

The target system must support the functionality!

Attention: Asynchronous file access might influence the real time behaviour of the system!
libdoc_e.dot / V1.0

3S - Smart Software Solutions GmbH Page 3 of 6


SysFileAsync_V3x_E.doc
Library SysFileAsync.library

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

p<function of POINTER TO Pointer on the structure containing the parameters


SysFile.library> t<function of of the corresponding SysCom.library function.
SysCom.library>
e.g. structure tSysComOpen

pudState POINTER TO Pointer on current status:


UDINT
ASYNCSTATE_INVALID
: UDINT := 16#FFFFFFFF;
ASYNCSTATE_PENDING
: UDINT := 0;
ASYNCSTATE_ACTIVE
: UDINT := 1;
ASYNCSTATE_READY
: UDINT := 2;
ASYNCSTATE_ERROR
: UDINT := 3;
ASYNCSTATE_TIMEOUT
: UDINT := 4;

pResult POINTER TO Pointer on error code; see document Runtime Error


UDINT Codes.

The functions:

SysFileCloseAsync
SysFileCopyAsync
SysFileDeleteAsync
SysFileDeleteByHandleAsync
SysFileEOFAsync
SysFileGetNameAsync
SysFileGetPathAsync
SysFileGetPosAsync
SysFileGetSizeAsync
SysFileGetSizeByHandleAsync
SysFileGetStatusAsync
SysFileGetTimeAsync
SysFileOpenAsync
SysFileReadAsync
libdoc_e.dot / V1.0

SysFileRenameAsync
SysFileSetPosAsync
SysFileWriteAsync

3S - Smart Software Solutions GmbH Page 4 of 6


SysFileAsync_V3x_E.doc
Library SysFileAsync.library

For each of the methods a corresponding wrapper-method is called: <method name>wrapper

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.

The status at starting the asynchronous job always is ASYNCSTATE_INVALID.

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:

ASYNCSTATE_READY: Job successfully finished

ASYNCSTATE_ERROR: Job terminated with error

ASYNCSTATE_TIMEOUT: Job timeout reached before job could be finished


successfully

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

3S - Smart Software Solutions GmbH Page 5 of 6


SysFileAsync_V3x_E.doc
SysFileAsync.library

Change History
Version Description Date

0.1 Issued acc. to German V0.2 09.08.2007


0.2 Corrections acc. to German V1.0 18.02.2008
1.0 Release after formal review 20.02.2008
libdoc_e.dot / V1.0

3S - Smart Software Solutions GmbH Page 6 of 6


SysFileAsync_V3x_E.doc

S-ar putea să vă placă și