Last Updated on Friday, 10 September 2010 03:10This step-by-step article describes how easy it is to integrate SecsToHost.Net SDK into your Native Visual C++ code. To do this, we will create a simple MFC Dialog based application for demontration.
The following list outlines the recommended softwares that you need in order to follow this tutorial:
Before you start importing all the necessary libraries from SecsToHost.Net, first you must register them in the windows registry. To do so, please run the RegisterCOM.exe utility located in your [INSTALLATIONFOLDER]/SecsToHost.Net 2.0 SDK.
Note: Administrator right is required in order to register the entries successfully to windows registry.
In this article, we are going to create a simple HMI application which utilizes all the SECS/GEM capabilities provided by SecsToHost.Net. For simplicity (at least on the GUI side), we will create a MFC dialog based application to show you how to integrate SecsToHost.Net interface into your native Visual C++ application.
The Visual C++ project wizard will generate "COMGEMStationVCDlg.h" and "COMGEMStationVCDlg.cpp" file.
In your [INSTALLATIONFOLDER] you should have the following typed libraries:
And these core .h, .dll and .lib:
Copy all the libraries mentioned above to your project folder (one level up from Debug or Release folder). Next, import the CGEMController.h and CGEMController.lib by drag and drop into your project Header Files and Resource Files respectively. If you have successfully drag the files, it would be shown like this:
Add the following code to the COMGEMStationVCDlg.h
Add the following codes to the COMGEMStationVCDlg.h to
Next, we will need to implement the InitializeSecsToHost() method in COMGEMStationVCDlg.cpp to get the COMGEMController reference and hook up all the callback:
The codes above first instantiate and get the iCOMGEMControllerPtr reference for m_GEMController variable with the CGEMController class. The next line of code calling the m_GEMController->Initialize method which takes two parameters:
The last part of the codes sync the callback events raised by COMGEMController class. Now we have hooked up all the codes necessary to start your specific equipment SECS/GEM application.