IVisuStreamReader.Read (METH)

METHOD Read : SysTypes.RTS_IEC_RESULT

This method can be implemented for reading data from a stream like object. The return value can either be:

  • ERR_OK: reading succeeded, udiNrBytes is > 0

  • ERR_PENDING: reading is temporarily not possible, udiNrBytes = 0

  • Any other error code: reading failed, reason see error code, udiNrBytes = 0

InOut:

Scope

Name

Type

Comment

Return

Read

SysTypes.RTS_IEC_RESULT

Input

pbyBuffer

POINTER TO BYTE

A buffer where the data should be written to by the callee. The callee must always write the this buffer starting at offset 0.

udiMaxNrBytes

UDINT

The maximal number of bytes that should be written to pbyBuffer by the callee.

Output

udiNrBytes

UDINT

The number of bytes that were read by the callee. A value of 0 signals that the end of the stream was reached or that an error happened. The according decision between error or end of stream is made by evaluating the return value.