Documentation for Axxon PSIM 1.0.0-1.0.1.

Previous page Creating MDL files  Creating and configuring integrated objects (modules) in Axxon PSIM Next page


Devices are managed by exchanging messages (commands) between RUN files and the system core. For implementing this interaction between software modules and the core, use the Axxon PSIM Integration Developer Kit (IIDK), which is covered in detail in Section Axxon PSIM Integration Developer Kit (IIDK). Other information is provided by the source files of the demonstration module; the files may be found in an appendix to this documentation.  

Below is an example of how the IIDK is used in the DEMO module.

CString port = "1100";

CString ip = "127.0.0.1";

CString id = "";

BOOL IsConnect = Connect (ip, port, id, myfunc);

if (!IsConnect)

{

// connection failed

AfxMessageBox("Error");

Return;

}

SendMsg(id,"CAM|1|REC"); // turn on recording for camera 1

SendMsg(id, "DEMO|1|RESTORE"); // restore the connection with the DEMO object

//turn on the DEMO_DEVICE with address 1

SendMsg(id,"DEMO_DEVICE|1|ON|params<1>,param0_name<address>,param0_val<1>");

Disconnect(id);

Attention!

 If an MDL file exists, connecting to Axxon PSIM's core does not require creating an IIDK Interface object in the system. The connection ID passed is an empty string (in other words, the ID is "").

When a module is unloaded, it receives the WM_EXIT event:

#define WM_EXIT (WM_USER+2000)

Use a WinAPI function, PostThreadMessage, to catch this message and ensure that the module is unloaded properly. In VC++ and MFC, the WM_EXIT event is caught in a subclass of CWinApp; in Delphi and CBuilder, it is caught in a subclass of TApplication.

  • No labels