QuickOPC User's Guide and Reference
ServerAttribute Class
Members 



OpcLabs.EasyOpcClassic Assembly > OpcLabs.EasyOpc.LiveMapping Namespace : ServerAttribute Class
Gives information about an OPC server, such as the server's ProgID.
Syntax
'Declaration
 
<AttributeUsageAttribute(AttributeTargets.Event Or  _
    AttributeTargets.Field Or  _
    AttributeTargets.Method Or  _
    AttributeTargets.Property)>
<ComVisibleAttribute(False)>
Public NotInheritable Class ServerAttribute 
   Inherits System.Attribute
   Implements System.Runtime.InteropServices._Attribute 
'Usage
 
Dim instance As ServerAttribute
[AttributeUsage(AttributeTargets.Event | 
    AttributeTargets.Field | 
    AttributeTargets.Method | 
    AttributeTargets.Property)]
[ComVisible(false)]
public sealed class ServerAttribute : System.Attribute, System.Runtime.InteropServices._Attribute  
[AttributeUsage(AttributeTargets.Event | 
    AttributeTargets.Field | 
    AttributeTargets.Method | 
    AttributeTargets.Property)]
[ComVisible(false)]
public ref class ServerAttribute sealed : public System.Attribute, System.Runtime.InteropServices._Attribute  
Remarks

 

By annotating your types and members by attributes, you provide information to the live mapping system about the correspondences between the source OPC system and the target .NET objects.

For example, using the combination of DANode and DAItem attributes on a property of your object, you denote that the property corresponds to a node in OPC-DA address space, specify the name of that node (if different from property name), and mark the node as OPC item, i.e. capable of reading, writing or subscriptions. Using other attributes, you can also specify parameters for these mapping operations (such as the requested update rate). In OPC-UA, you would use a similar combination of UANode and UAData attributes.

Attributes in .NET are classes that, by convention, are named so that they end in the word “Attribute”. Some languages, such as C#, allow you to omit the final Attribute word, when the attribute is specified. For example, in C#, you can write [DAItem] instead of [DAItemAttribute]. In this document, we will mostly use the “shortened” named of attribute classes. Remember that in some languages, you may have to use the full name of the attribute class, and therefore append the word “Attribute” to the attribute name listed here.

The following table shows the Live Mapping attributes common for OPC Classic and OPC-UA, and the type of elements they can be applied to.

Attribute Purpose on Class or Struct on Property, Method, or Field on Event
MappingTag Member mapping  
MetaMember Member mapping    

The following table shows the attributes available for OPC Classic, and the type of elements they can be applied to.

Attribute Purpose on Class or Struct on Property, Method, or Field on Event
DAItem Member mapping  
DAItemIdTemplate Propagated parameter    
DAMember Member mapping    
DANode Member mapping  
DAProperty Member mapping    
DARead Propagated parameter
DASubscription Propagated parameter
DAType Type mapping    
Server Propagated parameter  

The following table shows the attributes available for OPC Unified Architecture, and the type of elements they can be applied to.

Attribute Purpose on Class or Struct on Property, Method, or Field on Event
UAData Member mapping  
UADataChangeFilter Propagated parameter
UAEndpoint Propagated parameter  
UAMember Member mapping    
UAMonitoring Propagated parameter
UANamespace Propagated parameter    
UANode Member mapping  
UANodeIdTemplate Propagated parameter    
UARead Propagated parameter
UASubscription Propagated parameter
UAType Type mapping    

The meaning of these attributes will be explained in subsequent chapters, and can be found in the reference documentation as well.

 

Inheritance Hierarchy

System.Object
   System.Attribute
      OpcLabs.EasyOpc.LiveMapping.ServerAttribute

Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2012, Windows Server 2016; .NET Core, .NET 5, .NET 6: Linux, macOS, Microsoft Windows

See Also

Reference

ServerAttribute Members
OpcLabs.EasyOpc.LiveMapping Namespace