SysComRead
(FUN)
FUNCTION SysComRead : UDINT
<description>Reads the number of bytes from the receive buffer of the specified device. <p>IMPLEMENTATION NOTE: If the timeout elapsed until the requested number of bytes are received,
the function returns the number of bytes already received! This must be considered in the caller and the implementation!</p></description>
<result><p>RESULT: Number of actual read bytes</p></result>
- InOut:
Scope
Name
Type
Comment
Return
SysComRead
UDINT
Input
hCom
RTS_IEC_HANDLE
<param name=”hCom” type=”IN”>Handle to com port</param>
pbyBuffer
POINTER TO BYTE
<param name=”pbyBuffer” type=”IN”>Pointer to data buffer for received data</param>
ulSize
UDINT
- <param name=”uiSize” type=”IN”>Requested number of bytes to read. Must be less or equal the size
of the receive buffer!</param>
ulTimeout
<param name=”ulTimeout” type=”IN”>Timeout in milliseconds to read data from the device. [0]=Immediate return.
If the timeout elapsed, the function returns with the still received data (could be less then the requested number of bytes!)</param>
pResult
POINTER TO RTS_IEC_RESULT
<param name=”pResult” type=”OUT”>Pointer to return the runtime system error code (see CmpErrors.library).</param>