OPCDA.NET Reference Manual
OpcGroup Class Members
See Also  Properties  Methods  Events Send Feedback
OpcDaNetUA.Net4 Assembly > OPCDA.NET Namespace : OpcGroup Class


Glossary Item Box

The following tables list the members exposed by OpcGroup.

Public Properties

 NameDescription
Public PropertyActiveOpcGroup Active state property assignement.
A get is from the OpcGroup property. Use OpcGrp.GetStat() to refresh the properties if this may be necessary. On set the OPC server is updated.
On server call errors an exception is thrown if the property OpcServer.ErrorsAsExecptions is set.  
Public PropertyHandleClientOpcGroup Client Handle property assignement.
A get is from the OpcGroup property. Use OpcGrp.GetStat() to refresh the properties if this may be necessary. On set the OPC server is updated.  
Public PropertyHandleServerOpcGroup Server Handle property assignement.
A get is from the OpcGroup property. Use OpcGrp.GetStat() to refresh the properties if this may be necessary. Only get access is allowed.  
Public PropertyLocaleIDOpcGroup LocaleID property assignement.
A get is from the OpcGroup property. Use OpcGrp.GetStat() to refresh the properties if this may be necessary. On set the OPC server is updated.
On server call errors an exception is thrown if the property OpcServer.ErrorsAsExecptions is set.  
Public PropertyNameOpcGroup name property assignement.
A get is from the OpcGroup property. Use OpcGrp.GetStat() to refresh the properties if this may be necessary. On set the OPC server is updated.  
Public PropertyPercentDeadbandOpcGroup PercentDeadband property assignement.
A get is from the OpcGroup property. Use OpcGrp.GetStat() to refresh the properties if this may be necessary. On set the OPC server is updated.
On server call errors an exception is thrown if the property OpcServer.ErrorsAsExecptions is set.  
Public PropertyPublicOpcGroup name property assignement.
A get is from the OpcGroup property. Use OpcGrp.GetStat() to refresh the properties if this may be necessary. Only get is allowes with this property.  
Public PropertyTimeBiasOpcGroup TimeBias property assignement.
A get is from the OpcGroup property. Use OpcGrp.GetStat() to refresh the properties if this may be necessary. On set the OPC server is updated.
On server call errors an exception is thrown if the property OpcServer.ErrorsAsExecptions is set.  
Public PropertyUpdateRateOpcGroup UpdateRate property assignement.
A get is from the OpcGroup property. Use OpcGrp.GetStat() to refresh the properties if this may be necessary. On set the OPC server is updated.
On server call errors an exception is thrown if the property OpcServer.ErrorsAsExecptions is set.  
Top

Public Methods

 NameDescription
Public MethodAddItemsAdd a set of items to the group. ( IOPCItemMgt::AddItems ) It is acceptable to add the same item to the group more than once. This will generate a 2nd item with a unique ServerHandle. Any FAILED code in ppErrors indicates that the corresponding item was NOT added to the group and that the corresponding OPCITEMRESULT will not contain useful information. As an alternative to OPC_E_BADTPYE it is acceptable for the server to return any FAILED error returned by VariantChangeType or VariantChangeTypeEx. The server provided item handle will be unique within the group, but may not be unique across groups. The server is allowed to 'reuse' the handles of deleted items. Items cannot be added to public groups. The client needs to free all of the memory associated with the OPCITEMRESULTs including the BLOB. If the server supports the BLOB it will return an updated BLOB in the OPCITEMRESULTs. This BLOB may differ in both content and size from the one passed by the client in OPCITEMDEF.
Note that if an Advise is active, the client will begin receiving callbacks for active items. This can occur very quickly, perhaps even before the client has time to process the returned results. The client must be designed to deal with this. One simple solution is for the client to clear the Active state of the group while doing AddItems and to restore it after the AddItems is completed and the results are processed.  
Public MethodAdviseIOPCDataCallbackActivates the callback handling.
The server makes callbacks on data change, read complete, write complet and cancel complete. The user needs to install callback event handlers to actually getting notified.  
Public MethodCancel2 Request that the server cancel an outstanding transaction. ( IOPCAsyncIO2::Cancel2 )  
Public MethodClearItemDeadband Clears the individual item PercentDeadband, effectively reverting them back to the deadband value set in the group. ( Available in OPC DA V3 servers only ).  
Public MethodClearItemSamplingRateClears the sampling rate on individual items, which was previously set with SetItemSamplingRate. ( Available in OPC DA V3 servers only ).
The item will revert back to the update rate of the group.  
Public MethodCloneGroupClone a group.
There is rarely a good reason to use this method.  
Public MethodGetEnable Retrieves the last Callback Enable value set with SetEnable. ( IOPCAsyncIO2::GetEnable )  
Public MethodGetItemAttributes Get the attibutes of all items in the group.  
Public MethodGetItemBufferEnable Queries the current state of the servers buffering for requested items. ( Available in OPC DA V3 servers only ).  
Public MethodGetItemDeadband Gets the deadband values for each of the requested items. ( Available in OPC DA V3 servers only ).  
Public MethodGetItemSamplingRate Gets the sampling rate on individual items, which was previously set with GetItemSamplingRate ( Available in OPC DA V3 servers only ).  
Public MethodGetKeepAlive Returns the currently active keep-alive time for the group subscription. ( Available in OPC DA V3 servers only ).  
Public MethodGetStateOverloaded. Updates the member variables in the OpcGroup object with the current state of the OPC group by calling IOPCGroupStateMgt::GetState.
The status information can then be accessed using the OpcGroup property accessors.  
Public Methodstatic (Shared in Visual Basic)QualityToString Helper method to build a string for an OPC Quality code  
Public MethodReadOverloaded.  Read the value, quality and timestamp information for one or more items in a group. The function runs to completion before returning.( IOPCSyncIO::Read )  
Public MethodReadMaxAgeOverloaded.  Reads one or more values, qualities and timestamps for the items specified. This is functionally similar to the OPCSyncIO::Read method except it is asynchronous and no source is specified (DEVICE or CACHE). The server will make the determination as whether the information will be obtained from the device or cache. This decision will be based upon the MaxAge parameter. If the information in the cache is within the MaxAge, then the data will be obtained from the cache, otherwise the server must access the device for the requested information.  
Public MethodRefresh2 Force a callback to IOPCDataCallback::OnDataChange for all active items in the group (whether they have changed or not). Inactive items are not included in the callback. ( IOPCAsyncIO2::Refresh2 )  
Public MethodRefreshMaxAge Force a callback to IOPCDataCallback::OnDataChange for all active items in the group (whether they have changed or not). Inactive items are not included in the callback. The MaxAge value will determine where the data is obtained. There will be only one MaxAge value, which will determine the MaxAge for all active items in the group. This means some of the values may be obtained from cache while others could be obtained from the device depending on the “freshness” of the data in the cache.  
Public MethodRemoveRemove the associated OPC group and release all interfaces.
Existing callbacks are UnAdvised and then the server function IOPCServer::RemoveGroup is called.  
Public MethodRemoveItems Remove a set of items from the group. ( IOPCItemMgt::RemoveItems )  
Public MethodSetActiveState Sets one or more items in a group to active or inactive. This controls whether or not valid data can be obtained from Read CACHE for those items and whether or not they are included in the IAdvise subscription to the group. ( IOPCItemMgt::SetActiveState )  
Public MethodSetClientHandles Changes the client handle for one or more items in a group. IOPCItemMgt::SetClientHandles )  
Public MethodSetDatatypesOverloaded.  Changes the requested data type for one or more items in a group.  
Public MethodSetEnable Controls the operation of OnDataChange. Basically setting Enable to FALSE will disable any OnDataChange callbacks with a transaction ID of 0 (those which are not the result of a Refresh). ( IOPCAsyncIO2::SetEnable )  
Public MethodSetItemBufferEnable Requests that the server turns on or off, depending on the value of the enableState parameter, the buffering of data for the identified items, which are collected for items that have an update rate faster than the group update rate. ( Available in OPC DA V3 servers only ).  
Public MethodSetItemDeadband Overrides the deadband specified for the group for each item. ( Available in OPC DA V3 servers only ).  
Public MethodSetItemSamplingRateSets the sampling rate on individual items. ( Available in OPC DA V3 servers only ).
This overrides the update rate of the group as far as collection from the underlying device is concerned. The update rate associated with individual items does not effect the callback period.  
Public MethodSetKeepAliveSets the keep-alive time for the group subscription.
Only OPC DA V3 servers support the keep alive feature. The OPCDA.NET Professional Edition emulates the keep alive feature for servers that don't implement the OPC DA V3 IOPCGroupStateMgt2 interface. Some servers may implement the interface but not the method. In this case the OpcServer.DeclareV2 property has to be set to force the emulation to be used. The emulation has a client side thread that makes periodically GetStatus server calls and executes keepalive DataChange callbacks accourding the OPC DA V3 keep alive specification.
Clients can set the keep-alive time for a subscription to cause the server to provide client callbacks on the subscription when there are no new events to report. Clients can then be assured of the health of the server and subscription without resorting to pinging the server with calls to GetStatus(). Using this facility, a client can expect a callback (data or keep-alive) within the specified keep-alive time.
Servers shall reset their keep-alive timers when real data is sent (i.e. it is not acceptable to constantly send the keep-alive callback at a fixed period equal to the keep-alive time irrespective of data callbacks).  
Public MethodSetNameChange the name of the OPC group. ( IOPCGroupStateMgt::SetName )
The name must be unique. The name cannot be changed for public groups.  
Public MethodSetStateThe client can set various states of the group. The "defined" flag has to be set in the argument object for each state the client wants to change.
Group states can be changed by calling this method or alternatively individually by assigning the corresponding OpcGroup property.  
Public MethodValidateItemsvalidate a set of items. ( IOPCItemMgt::ValidateItems )
Determines if an item is valid (could it be added without error). Also returns information about the item such as canonical datatype. Does not affect the group in any way.  
Public MethodWriteOverloaded.  Writes values to one or more items in a group. The function runs to completion. The values are written to the DEVICE. That is, the function should not return until it verifies that the device has actually accepted (or rejected) the data. ( IOPCSyncIO::Write )  
Public MethodWriteVQTOverloaded. Writes one or more values, qualities and timestamps for the items specified. ( Available only in OPC DA V3 servers )
This method is functionally similar to the OpcGroup.Write except that Quality and Timestamp may be written. If a client attempts to write VQ, VT, or VQT it should expect that the server will write them all or none at all.  
Top

Protected Methods

 NameDescription
Protected MethodFinalize  
Top

Public Events

 NameDescription
Public EventCancelCompleted Is called from the server on cancel completed events. AdviseIOPCDataCallback needs to be called to activate the callback handling. The client can install handlers to handle notifications of completion of cancel requests.  
Public EventDataChanged Is called from the server on data change events. AdviseIOPCDataCallback needs to be called to activate the callback handling. The client can install handlers to handle notifications of data changes and Refreshes.  
Public EventReadCompleted Is called from the server on read completed events. AdviseIOPCDataCallback needs to be called to activate the callback handling. The client can install handlers to handle notifications of completion of read requests.  
Public EventWriteCompleted Is called from the server on write completed events. AdviseIOPCDataCallback needs to be called to activate the callback handling. The client can install handlers to handle notifications of completion of write requests.  
Top

See Also

Copyright © 2002-2018 Advosol Inc. All Rights Reserved.