SIMATIC 3964R protocol for Windows 9x/XP/7
Installation Manual, 01/2013, J31069-D0131-U001-A2-7218
13
Programming interface
4
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
ComOpen
(LPCSTR com_name,
int read_number,
int write_number,
HWND hwnd)
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
Interface name as string
Possible values "COM1 ... COM255"; a maximum of 4 COM ports can be
open at the same time
read_number
Size of the receive buffer in bytes
write_number
Size of the send buffer in bytes
hwnd
Windows handle as destination for the notification message
Return value
≥ 0
Handle for the opened interface
< 0
possible error message:
•
COM_ALREADY_OPEN
•
COM_DDFINI_ERROR
•
COM_NO_MEMORY
•
COM_NO_HANDLE
•
COM_REGISTRY
•
COM_NO_CONFIG