Programming interface
4.1 Functions of the serial interface
SIMATIC 3964R protocol for Windows 9x/XP/7
14
Installation Manual, 01/2013, J31069-D0131-U001-A2-7218
Notes
● If "COM_OPEN_STD_PUF" is transferred as the buffer size, the buffer size from the
parameter assignment dialog is adopted.
● The returned handle must be transferred as a parameter with all further calls.
● Each buffer can hold several frames at the same time. The number is restricted only by
the total of the lengths of all buffered frames.
ComRead
comInt
ComRead
(int com_handle,
void *read_data,
int read_number,
long options)
This function is used for the blocking receipt of frames.
Parameter
com_handle
interface handle from
ComOpen
read_data
Pointer to the receive buffer of the caller
read_number
Length of the receive buffer
options
Not used
Return value
≥ 0
Number of bytes read (≙ frame length)
< 0
possible error message:
•
COM_HANDLE_FALSE
•
COM_2SMALL
•
COM_READ_ERROR
Notes
● The call blocks if no frame is present. No timeout parameter is intended.
● This call fetches incoming frames from an internal buffer. The actual receive routine is
asynchronous.