Programming interface
4.1
Functions of the serial interface
Note
You will find all the error messages listed in this section in the section "Error and status
messages (Page 23)".
ComOpen
comInt
This function is used to open an interface and to prepare for data transfer. It must be called
before all other functions.
Parameter
com_name
read_number
write_number
hwnd
Return value
≥ 0
< 0
SIMATIC 3964R protocol for Windows 9x/XP/7
Installation Manual, 01/2013, J31069-D0131-U001-A2-7218
(LPCSTR com_name,
ComOpen
int read_number,
int write_number,
HWND hwnd)
Interface name as string
Possible values "COM1 ... COM255"; a maximum of 4 COM ports can be
open at the same time
Size of the receive buffer in bytes
Size of the send buffer in bytes
Windows handle as destination for the notification message
Handle for the opened interface
possible error message:
COM_ALREADY_OPEN
•
COM_DDFINI_ERROR
•
COM_NO_MEMORY
•
COM_NO_HANDLE
•
COM_REGISTRY
•
COM_NO_CONFIG
•
4
13