Go to documentation repository
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!
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.