Appendix a ethernet integration, A.1 introduction, A.2 cms5000api.h – INFICON CMS5000 Monitoring System User Manual
Page 253: Appendix a

A - 1
IP
N 07
4-
50
8-
P1
C
CMS5000 Operating Manual
Appendix A
Ethernet Integration
A.1 Introduction
The CMS5000 can be programmed to be integrated into the site’s water monitoring
system. The CMS5IPN 074-508-P1C000API is a simple C/C++ programming
interface that provides software programmers access to the CMS5000’s basic
control and status functions from within their applications. The CMS5000API is not
a stand-alone application; it is used by programmers to build their own applications.
CMS5000 API files:
CMS5000api.h . . . . . . . . . . . . . . (Header file)
CMS5000api.dll . . . . . . . . . . . . . (Windows Dynamic Link Library)
CMS5000api.lib . . . . . . . . . . . . . (Import library used to link to
CMS5000api.dll)
In addition to the CMS5000 API files, a sample application (CMS5000tester.exe) is
provided that will start a method, get status as the method runs, then display some
results when the method finishes. The source code for CMS5000tester.exe is
provided along with a Microsoft VC++ project that can be used to build it.
A.2 CMS5000API.H
//------------------------------------------------------------------------------------
// CMS5000api.h provides an API for accessing a CMS5000's basic control and status functions.
//
// The following four lines of code (error checking omitted) show the proper steps for
// connecting to a CMS5000, starting a method, and then disconnecting.
//
// CMS5000_HANDLE CMS5000_handle;
//
// CMS5000_Connect( &CMS5000_handle, _T("10.1.1.1") );
//
// CMS5000_Run_Method( CMS5000_handle, _T("/Method/MyMethod.mth") );
//
// CMS5000_Disconnect( CMS5000_handle );
//
//------------------------------------------------------------------------------------
// The following ifdef block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within the DLL are compiled with the CMS5000API_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses the DLL. This way any other project whose source files include this file see
// CMS5000API_API functions as being imported from a DLL, whereas the DLL sees symbols
// defined with this macro as being exported.