FILE.Read (FB; Prefix filrd)

 

This function block of the CAA_File.library reads the file, which was previously opened via FILE.Open. If less characters can be read than specified in ”szBuffer”, the function block returns an active ”xDone” and indicates the current number of characters in ”szSize”. The size of the target memory structure for the bytes to be read and the number of bytes to be read will not be checked.

If the stability of the pointer on the data structures and their contents cannot be guaranteed in case of an online change, an online change must be avoided with the help of functions from the ”CAA.Application library”.

Input:

xExecute

BOOL

see: CAA Guidelines

xAbort

BOOL

see: CAA Guidelines

udiTimeOut

UDINT

hFile

CAA.HANDLE

File handle

pBuffer

CAA.PVOID

Target address for the first byte to be read; can be retrieved via operator ADR

szBuffer

CAA.SIZE

Maximum number of bytes to be read; can be retrieved via operator sizeof

Output:

xDone

BOOL

see: Guidelines for CAA libs

xBusy

BOOL

see: Guidelines for CAA libs

xError

BOOL

see: Guidelines for CAA libs

xAborted

BOOL

see: Guidelines for CAA libs

eError

FILE.ERROR

Error ID

szSize

CAA.SIZE

Current number of successfully read bytes; this value is already valid before xDone has been set