SysComWrite (FUN)

FUNCTION SysComWrite : UDINT

<description><p>Writes the number of bytes to the send buffer of the specified device.</p> <p>IMPLEMENTATION NOTE: If the timeout elapsed until the requested number of bytes are sent,

the function returns the number of bytes already sent! This must be considered in the caller and the implementation!</p></description>

<result><p>RESULT: Number of actual written bytes</p></result>

InOut:

Scope

Name

Type

Comment

Return

SysComWrite

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 sent data</param>

ulSize

UDINT

<param name=”uiSize” type=”IN”>Requested number of bytes to sent. Must be less or equal the size

of the sent buffer!</param>

ulTimeout

SYS_COM_TIMEOUT

<param name=”ulTimeout” type=”IN”>Timeout in milliseconds to sent data to the device. [0]=Immediate return.

If the timeout elapsed, the function returns with the still sent 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>