⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wtopcsvrapi.h

📁 OPC SERVER的开发DLL工具,已经注册
💻 H
📖 第 1 页 / 共 2 页
字号:
_declspec(dllexport) BOOL WINAPI EnableDisconnectNotification (DISCONNECTPROC lpCallback);

_declspec(dllexport) BOOL WINAPI EnableEventMsgs (EVENTMSGPROC lpCallback);

_declspec(dllexport) BOOL WINAPI EnableRateNotification (RATECHANGEPROC lpCallback);

_declspec(dllexport) BOOL WINAPI EnableDeviceRead (DEVICEREADPROC lpCallback);

_declspec(dllexport) BOOL WINAPI EnableErrorNotification (ERRORPROCAPI lpCallback);

/////////////////////////////////////////////////////////////////////////////////////////////
//
// Support for Alarms & Events
// (March 2000)
//
/////////////////////////////////////////////////////////////////////////////////////////////
_declspec(dllexport) BOOL WINAPI UserAEMessage (LPCSTR Msg, DWORD Severity);

_declspec(dllexport) BOOL WINAPI UserAEMessageEx (ONEVENTSTRUCT Msg);

_declspec(dllexport) BOOL WINAPI UserAEMessageEx2 (DWORD hEventSubscription, ONEVENTSTRUCT Msg, BOOL bRefresh, BOOL bLastRefresh);

//
// Literal Definitions for LevelID
//
#define	ID_LOLO_LIMIT	1
#define ID_LO_LIMIT		2
#define ID_HI_LIMIT		3
#define ID_HIHI_LIMIT	4

_declspec(dllexport) BOOL WINAPI SetItemLevelAlarm (HANDLE TagHandle, int LevelID, float Limit, DWORD Severity, BOOL Enabled);

_declspec(dllexport) BOOL WINAPI GetItemLevelAlarm (HANDLE TagHandle, int LevelID, float *pLimit, DWORD *pSeverity, BOOL *pEnabled);




/////////////				Undocumented Functions						  ////////////////
//																						//
//				Undocumented function to Disable Demo Timer								//
//																						//
//////////////////////////////////////////////////////////////////////////////////////////


_declspec(dllexport) BOOL WINAPI Deactivate30MinTimer (LPCSTR Authorization);


/////////////////////////////////////////////////////////////////////////////////////////////
//
// Expanded Support for A&E callbacks
// (March 2001)
//
// The application can use the CWtAExCallback object definition below
// to generate overloaded functions to change the default behavior of the 
// WtOPCsvr.dll with regard to Alarms & Events.
//
// Basic support for Alarms & Events is supplied by the dll in the form of
// High & Low level alarms surrounding each defined OPC Item.  As the data values
// change, these level limits are compared and event messages generated as appropriate.
// The default behavior of the WtOPCsvr.dll does not provide for acknowledgements
// from an OPC Client or any filtering to be applied to the event subscription.
//
// By basing a C++ object on the CWtAExCallback object and overloading any of
// the virtual functions the application can expand upon or replace the basic
// A&E functionality of the dll as required.
/////////////////////////////////////////////////////////////////////////////////////////////

#ifdef _WTOPCSVRDLL
class __declspec(dllexport) CWtAExCallback
#else
class __declspec(dllimport) CWtAExCallback
#endif
{
public:
	// This is the object definition for the A&E callback object
   CWtAExCallback();
   virtual ~CWtAExCallback();

   // CIOPCEventServer::GetStatus(...)
   // The dll supplies the Last Update Time parameter to match the requesting subscriber.
   // The default implementation of this function returns valid parameters to the client.
   // Only overload this function if you have specific infprmation to add to the status structure
   virtual HRESULT GetStatus(OPCEVENTSERVERSTATUS** ppEventServerStatus, FILETIME LastUpdateTime);

   // CIOPCEventServer::QueryAvailableFilters(...)
   // The default implementation of this function returns zero for the FilterMask
   // ans S_OK, (i.e. Filters not supported!)
   virtual HRESULT QueryAvailableFilters (DWORD *pdwFilterMask);

   // CIOPCEventServer::QueryEventCategories (...)
   // The default implementation of this function supports two categories
   //		OPC_SIMPLE_EVENT	--  OPC_MSG_CAT:System Message
   //		OPC_CONDITION_EVENT	--	OPC_LEVEL_CAT:Level
   //							--	OPC_DISCRETE_CAT:Discrete
   virtual HRESULT QueryEventCategories( 
								DWORD		dwEventType,
								DWORD		*pdwCount,
								DWORD		**ppdwEventCategories,
								LPWSTR		**ppszEventCategoryDescs);

   // CIOPCEventServer::QueryConditionNames (...)
   // The default implementation of this function returns the following condition names
   //	OPC_MSG_CAT			--	"Informational Text"
   //	OPC_LEVEL_CAT		--	"Level Alarm"
   //	OPC_DISCRETE_CAT	--	"Discrete Alarm"
   virtual HRESULT QueryConditionNames( 
								DWORD		dwEventCategory,
								DWORD		*pdwCount,
								LPWSTR		**ppszConditionNames);

   // CIOPCEventServer::QuerySubConditionNames(...)
   // The default implementation of this function returns 
   // four subCondition Names for the "Level Alarm" condition:
   //		"Lo"
   //		"Lo Lo"
   //		"Hi"
   //		"Hi Hi"
   virtual HRESULT QuerySubConditionNames( 
								LPWSTR		szConditionName,
								DWORD		*pdwCount,
								LPWSTR		**ppszSubConditionNames);

   // CIOPCEventServer::QuerySourceConditions(...)
   // The default implementation of this function returns E_NOTIMPL
   virtual HRESULT QuerySourceConditions( 
								LPWSTR		szSource,
								DWORD		*pdwCount,
								LPWSTR		**ppszConditionNames);

  // CIOPCEventServer::QueryEventAttributes(...)
  // The default implementation of this function returns E_NOTIMPL
  virtual HRESULT QueryEventAttributes( 
								DWORD		dwEventCategory,
								DWORD		*pdwCount,
								DWORD		**ppdwAttrIDs,
								LPWSTR		**ppszAttrDescs,
								VARTYPE		**ppvtAttrTypes);

  // CIOPCEventServer::TranslateToItemIDs(...)
  // The default implementation of this function returns E_NOTIMPL
   virtual HRESULT TranslateToItemIDs( 
								LPWSTR		szSource,
								DWORD		dwEventCategory,
								LPWSTR		szConditionName,
								LPWSTR		szSubconditionName,
								DWORD		dwCount,
								DWORD		*pdwAssocAttrIDs,
								LPWSTR		**ppszAttrItemIDs,
								LPWSTR		**ppszNodeNames,
								CLSID		**ppCLSIDs);

  // CIOPCEventServer::GetConditionState(...)
  // The default implementation of this function returns E_NOTIMPL
   virtual HRESULT GetConditionState( 
								LPWSTR		szSource,
								LPWSTR		szConditionName,
								DWORD		dwNumEventAttrs,
								DWORD		*pdwAttributeIDs,
								OPCCONDITIONSTATE	**ppConditionState);

  // CIOPCEventServer::EnableConditionByArea(...)
  // The default implementation of this function returns E_NOTIMPL
   virtual HRESULT EnableConditionByArea( 
								DWORD			dwNumAreas,
								LPWSTR			*pszAreas);

  // CIOPCEventServer::EnableConditionBySource(...)
  // The default implementation of this function returns E_NOTIMPL
   virtual HRESULT EnableConditionBySource( 
								DWORD		dwNumSources,
								LPWSTR		*pszSources);

  // CIOPCEventServer::DisableConditionByArea(...)
  // The default implementation of this function returns E_NOTIMPL
   virtual HRESULT DisableConditionByArea( 
								DWORD		dwNumAreas,
								LPWSTR		*pszAreas);

  // CIOPCEventServer::DisableConditionBySource(...)
  // The default implementation of this function returns E_NOTIMPL
   virtual HRESULT DisableConditionBySource( 
								DWORD		dwNumSources,
								LPWSTR		*pszSources);

  // CIOPCEventServer::AckCondition(...)
  // The default implementation of this function returns S_FALSE
   virtual HRESULT AckCondition( 
								DWORD		dwCount,
								LPWSTR		szAcknowledgerID,
								LPWSTR		szComment,
								LPWSTR		*pszSource,
								LPWSTR		*pszConditionName,
								FILETIME	*pftActiveTime,
								DWORD		*pdwCookie,
								HRESULT		**ppErrors);

  // CIOPCEventServer::CreateAreaBrowser(...)
  // The default implementation of this function returns E_NOTIMPL
   virtual HRESULT CreateAreaBrowser( 
								REFIID		riid,
								LPUNKNOWN	*ppUnk);


  // CreateEventSubscription (DWORD hEventSubscription)
  // RemoveEventSubscription (DWORD hEventSubscription)
  // WtOPCsvr.dll will execute these funtions in the application callback
  // object whenevr a client subcribes and unsubscribes to the event server.
  // This allows the application to implement filters on an individual
  // subscription basis by calling UserAEMessageEx2.
   virtual HRESULT CreateEventSubscription (DWORD hEventSubscription, DWORD dwBufferTime, DWORD dwMaxSize, OPCHANDLE hClientSubscription); 
   virtual HRESULT RemoveEventSubscription (DWORD hEventSubscription); 

  // CIOPCEventSubscriptionMgt::SetFilter (...)
  // The default implementation of this function returns E_NOTIMPL
   virtual HRESULT SetEventSubscriptionFilter( 
							DWORD		hEventSubscription,
							DWORD		dwEventType,
							DWORD		dwNumCategories,
							DWORD		*pdwEventCategories,
							DWORD		dwLowSeverity,
							DWORD		dwHighSeverity,
							DWORD		dwNumAreas,
							LPWSTR		*pszAreaList,
							DWORD		dwNumSources,
							LPWSTR		*pszSourceList);

  // CIOPCEventSubscriptionMgt::GetFilter (...)
  // The default implementation of this function returns E_NOTIMPL
   virtual HRESULT GetEventSubscriptionFilter( 
							DWORD			hEventSubscription,
							DWORD			*pdwEventType,
							DWORD			*pdwNumCategories,
							DWORD			**ppdwEventCategories,
							DWORD			*pdwLowSeverity,
							DWORD			*pdwHighSeverity,
							DWORD			*pdwNumAreas,
							LPWSTR			**ppszAreaList,
							DWORD			*pdwNumSources,
							LPWSTR			**ppszSourceList);

  // CIOPCEventSubscriptionMgt::SelectReturnedAttributes (...)
  // The default implementation of this function returns E_NOTIMPL
   virtual HRESULT SelectEventSubscriptionReturnedAttributes( 
										DWORD		hEventSubscription,
										DWORD		dwEventCategory,
										DWORD		dwCount,
										DWORD		*dwAttributeIDs);
        
  // CIOPCEventSubscriptionMgt::GetReturnedAttributes (...)
  // The default implementation of this function returns E_NOTIMPL
   virtual HRESULT GetEventSubscriptionReturnedAttributes( 
										DWORD		hEventSubscription,
										DWORD		dwEventCategory,
										DWORD		*pdwCount,
										DWORD		**ppdwAttributeIDs);

  // CIOPCEventSubscriptionMgt::Refresh (...)
  // The default implementation of this function returns E_NOTIMPL
   virtual HRESULT RefreshEventSubscription(
							DWORD		hEventSubscription,
							DWORD		dwConnection);
        
  // CIOPCEventSubscriptionMgt::CancelRefresh (...)
  // The default implementation of this function returns E_NOTIMPL
   virtual HRESULT CancelEventSubscriptionRefresh(
							DWORD		hEventSubscription,
							DWORD		dwConnection);
        
  // CIOPCEventSubscriptionMgt::GetState (...)
  // The default implementation of this function returns E_NOTIMPL
   virtual HRESULT GetEventSubscriptionState( 
							DWORD			hEventSubscription,
							BOOL			*pbActive,
							DWORD			*pdwBufferTime,
							DWORD			*pdwMaxSize,
							OPCHANDLE		*phClientSubscription);
        
  // CIOPCEventSubscriptionMgt::SetState (...)
  // The default implementation of this function returns E_NOTIMPL
   virtual HRESULT SetEventSubscriptionState( 
							DWORD			hEventSubscription,
							BOOL			*pbActive,
							DWORD			*pdwBufferTime,
							DWORD			*pdwMaxSize,
							OPCHANDLE		hClientSubscription,
							DWORD			*pdwRevisedBufferTime,
							DWORD			*pdwRevisedMaxSize);


};

//
// Exported function to override the default CWtAExCallback object with one
// specific to the application.  Overload the functions you wish to process
// within your app.  If the application chooses to implement its own set
// of Alarms & Event categories, it should disable the internal limit checking
// for item values.
//
_declspec(dllexport) BOOL WINAPI SetAEServerCallback (BOOL DisableInternalItemLimits, CWtAExCallback *pCallback); 


#ifdef __cplusplus
}
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -