uaPLUS Reference
AddItem Method
See Also  Send Feedback
NSPlugin Namespace > GenericServer Class : AddItem Method

AppItemHandle
Handle defined int the adaptation assembly to reference the item.
This handle is passed as an item identifier in calls between the generic server and the customization plugin. It should be chosen so that it allows fast access to the item data.
ItemId
Fully qualified item name. The OPC clients use this name to access the item.
This is a fully qualified item identifier such as "device1.channel5.heater3". The generic server part builds an appropriate hierarchical address space.
Note that the separator character ( . in the above sample identifier ) must match the separator character specified in the GetServerParameters method!
AccessRights
Access rights as defined in the OPC specification: OPC.READABLE , OPC.WRITEABLE , OPC.READWRITEABLE
InitValue
Object with initial value and the item's canonical data type.
A value must always be specified for the canonical data type to be defined.
quality
Initial quality of the item. This is a short value ( Int16) with the value of the OPCQuality enumerator.
timestamp
Initial timestamp
scanRate
Scan rate for this item in ms. A value of -1 indicates and undefined value.
This argument is used only be the generic server Professional Edition to optimize the item refresh.

Glossary Item Box

Generic server callback method.

Add an item in the generic server cache.
This method is typically called during the execution of the CreateServerItems or ValidateItems methods, but it can be called anytime an item needs to be added to the generic server cache.

Item that are added to the generic server cache can be accessed from the OPC clients.

Syntax

Visual Basic (Declaration) 
Public Shared Function AddItem( _
   ByVal AppItemHandle As Integer, _
   ByVal ItemId As String, _
   ByVal AccessRights As Integer, _
   ByVal InitValue As Object, _
   ByVal quality As Short, _
   ByVal timestamp As Date, _
   ByVal scanRate As Integer _
) As Integer
C# 
public static int AddItem( 
   int AppItemHandle,
   string ItemId,
   int AccessRights,
   object InitValue,
   short quality,
   DateTime timestamp,
   int scanRate
)

Parameters

AppItemHandle
Handle defined int the adaptation assembly to reference the item.
This handle is passed as an item identifier in calls between the generic server and the customization plugin. It should be chosen so that it allows fast access to the item data.
ItemId
Fully qualified item name. The OPC clients use this name to access the item.
This is a fully qualified item identifier such as "device1.channel5.heater3". The generic server part builds an appropriate hierarchical address space.
Note that the separator character ( . in the above sample identifier ) must match the separator character specified in the GetServerParameters method!
AccessRights
Access rights as defined in the OPC specification: OPC.READABLE , OPC.WRITEABLE , OPC.READWRITEABLE
InitValue
Object with initial value and the item's canonical data type.
A value must always be specified for the canonical data type to be defined.
quality
Initial quality of the item. This is a short value ( Int16) with the value of the OPCQuality enumerator.
timestamp
Initial timestamp
scanRate
Scan rate for this item in ms. A value of -1 indicates and undefined value.
This argument is used only be the generic server Professional Edition to optimize the item refresh.

Return Value

Returns S_OK if the item was successfully added to the cache.

Requirements

Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows 7, Windows Server 2008 family

See Also

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