Documentation for Axxon PSIM 1.0.0-1.0.1.

Previous page IIDK Functions  SendMsg Next page


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:

Void _stdcall myfunc is called in a separate stream (not in the application's main stream).

The developer handles received messages as needed. 

  • No labels