Go to documentation repository
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 | CString port = "900"; CString ip = "127.0.0.1"; CString id = "2"; BOOL IsConnect = Connect(ip, port, id, myfunc); if (!IsConnect) { // connection failed AfxMessageBox("Error"); } |
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); }
Note:
The developer handles received messages as needed.