dOPC Client Toolkit Help file
TdOPCEventServer Class
C++
public: class TdOPCEventServer : public TdOPCSvr;
C#
public class TdOPCEventServer : TdOPCSvr;
Visual Basic
Public Class TdOPCEventServer
Inherits TdOPCSvr

dOPCAE

class to connect to an OPC AE Server 

TdOPCEventServer is a component to control, browse, read and write data from an to any installed OPC Alarm and Event server.

The client has to create a TdOPCEventServer object first in order to get references to other objects. It contains the TdOPCEventFilters and TdOPCEvents collections and also provides a TdOPCEventAreaBrowser object. At first the client has to establish a connection to an OPC AE custom interface (see the TdOPCSvr.Connect method or the TdOPCSvr.Active property). The the TdOPCEventServer object can be used to obtain general information about an OPC server and to get event notfications automatically by using the TdOPCEventServer.OnEndUpdate event.

There are several examples in the directory DEMO/AE:

Example 
Description 
Simple 
simple alarm and event monitor 
A&E Client 
a complete alarm and event monitor program 
BrowserAE 
example how to use the TdOPCEventAreaBrowser class 
example how to change filter properties at runtime 
ConditionView 
example how to use the GetConditionState method 
Category 
example how to use the Categories and Conditions properties 
TdOPCSvr Events 
Description 
OnConnect is generated when a connection has been established with an OPC server. 
OnDeleteEvent is generated when an event is deleted from the Events collection. 
OnDisconnect is generated after a disconnect from an OPC server. 
OnError is generated if any error occurred on the OPC server. 
OnEvent is generated when the server receives a new event notification. 
OnEventAck is generated when the client acknowledges an event. 
Events
OnServerShutdown is generated when the OPC server plans to shut down. 
OnTimeout is generated when the connection to the OPC server has timed out.
The value of property KeepAlive must greater than zero 
TdOPCSvr Methods 
Description 
AcknowledgeAllEvents acknowledges all occurred events as the passed Who with the passed Comment. 
AcknowledgeEvents acknowledges the passed AckEvents as the passed Who with the passed Comment. 
AcknowledgeNotActiveEvents acknowledges all inactive events as the passed Who with the passed Comment. 
BeginUpdate should be called before making multiple changes to the events collection. 
BrowserSupport returns True if the server supports browsing, otherwise False
check if connected to server -> if not then raise an exception 
we get a new event from OPC server 
Connect establishes a connection to an OPC DA server. 
Disconnect disconnects from a connected OPC server. 
This is DoConnected, a member of class TdOPCEventServer. 
EndUpdate should be called after completing changes to the events collection that started with calling the BeginUpdate method. 
GetConditionState returns the TdOPCEventCondition from the passed Source for the passed ConditionName. 
get status information from OPC server (delphi types)
GetServerInfo provides global information about the server passed in the tServerStateRec parameter. 
Abstract method. 
GetState returns global information about the server. 
GetStatus retrieves the current status of the connection. 
LoadFromFile loads the TdOPCSrv component from the file passed by the FromFile parameter and fills all properties, groups and items. 
LoadFromStream loads the TdOPCSrv component from the stream passed by the Stream parameter and fills all properties, groups and items. 
QuerySourceConditions fills the Conditions parameter, presenting a list the list of available conditions of the passed Source. 
Refresh forces a refresh for all active conditions and inactive, unacknowledged conditions whose event notifications match the filter of the event subscription. 
Resort sorts the Events collection again (usually not necessary). 
SaveToFile saves the TdOPCSrv component to the file passed by the ToFile parameter (including all properties, groups and items). 
SaveToStream saves the TdOPCSrv component to the stream passed by the Stream parameter (including all properties, groups and items). 
SelectServer calls a modal dialog to select an OPC AE server and returns True if a server is selected, otherwise False
ServerTypeName returns the type of the OPC server as a string. 
Version2 returns True if the OPC server is OPC DA 2 server, otherwise False. 
Version3 returns True if the OPC server is OPC DA 3 server, otherwise False. 
TdHandleComponent Properties 
Description 
Active connects or disconnects from a OPC DA Server. 
AutoDelete is set to True if events should be automatically deleted after they have been handled, otherwise False
Browser contains the TdOPCEventAreaBrowser object with the ability to browse through items of a OPC AE Server. 
Buffertime (milliseconds) contains the server's event notification sending frequency. 
BuildNumber contains the build number of the OPC server. 
CanFilterByArea is True if the corresponding server can filter by areas, otherwise False
CanFilterByCategorie is True if the corresponding server can filter by categories, otherwise False
CanFilterByEvent is True if the corresponding server can filter by events, otherwise False
CanFilterBySeverity is True if the corresponding server can filter by severity, otherwise False
CanFilterBySource is True if the corresponding server can filter by source, otherwise False
Categories contains the TdOPCEventItems category of the server. 
ClientName contains a client name registered with TdOPCSrvs. 
ComputerName contains the name of the server to which the client is connected via the Connect method. 
Conditions contains the TdOPCEventItems condition of the server. 
This is ConnectDelay, a member of class TdOPCSvr. 
CurrentTime contains the current time from the server. 
EventlistSort contains the properties by which you can sort your events. 
Events contains the TdOPCEvents that occurred on the server. 
Filter contains the TdOPCEventFilters used by the server. 
Provides access to the window handle of the dOPC Server components (TdOPCServer and tdOPCEventServer). 
KeepAlive specify a value in milliseconds to check the OPC server accessibility 
LastUpdateTime contains the last update time from the server. 
LocaleId contains the locale id which may be used to localize strings returned from the server. 
MajorVersion contains the major part of the server version number (e.g. the "1" in version "1.32"). 
MaxSize contains the maximum number of events that will be sent from the server. 
MinorVersion contains the minor part of the server version number (e.g. the "32" in version "1.32"). 
OnBeginUpdate is generated before the server receives new event notifications. 
OnEndUpdate is generated when the server received new event notifications. 
Params contains additional parameters for XML communication. 
Protocol contains the communication protocol of the OPC DA server (coCOM or coXML). 
ServerCaption contains the name of the server. 
ServerClsId contains the class id of the OPC server if the Protocol is coCOM, otherwise an empty string. 
ServerName contains the name of the OPC DA server the client wants to connect with. 
ServerState contains the current server state. 
ServerStateStr contains the ServerState as a string. 
StartTime contains the the server startup time. 
VendorInfo contains the vendor information string for the server. 
Version contains the version of the dOPC component. 
This is WrongServertype, a member of class TdOPCSvr. 
What do you think about this topic? Send feedback!
Copyright © 2001-2014 Kassl GmbH (http://www.kassl.de). All rights reserved.