To establish communication between a functional module and Axxon PSIM, connect to the system core by using the following function:
BOOL Connect (LPCTSTR ip, LPCTSTR port, LPCTSTR id, void (_stdcall *func)(LPCTSTR msg)) |
Parameters of the connection function:
Parameter | Description | Example | |
LPCTSTR ip | The ID address of the computer that is running the system core |
| |
LPCTSTR port | TCP/IP connection port | ||
LPCTSTR id | A connection ID, for video | ||
_stdcall *func)(LPCTSTR msg)) | A callback function that accepts messages from Axxon PSIM |
The function returns TRUE if the connection is established, or FALSE if not.
All messages from the system core are accepted by a callback function.
A sample declaration of the callback function:
void _stdcall myfunc(LPCTSTR str) { printf("\r\nReceived:%s\r\n\r\n",str); } |
Void _stdcall myfunc is called in a separate stream (not in the application's main stream). |
The developer handles received messages as needed.