Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

Is there any way to retrive ItemId (full BrowsePath) for DAItem?

More
16 Feb 2015 06:43 #2777 by support
There are two obstacles here, but both can be resolved.

First, you cannot directly obtain the ItemId. As you have already figured out, you can obtain the NodeDescriptor. But, ItemId is contained in the NodeDescriptor. That should be enough (is there any reason why you specifically need ItemId as a separate member?). You can therefore use you first example, and access it as <ExampleClassInstance>.NodeDescriptor.ItemId from the code.

Second, the MetaMember mapping provides information that elates to the node being mapped, and not to any specific node (inside it) you specify. For example, if an instances of ExampleClass is mapped to a node "Channel1.Device1", then if you are interested in an item "Channel1.Device1.Tag1", you cannot do it right on the ExampleClass with [MetaMember("NodeDescriptor")]: You need to set up an object mapping for Tag1, and THEN use [MetaMember("NodeDescriptor")] on that object.

Just out of curiousity, can you please describe you scenario, i.e. why you specifically need this, and what are you trying to achieve?

Please Log in or Create an account to join the conversation.

  • miron
  • Topic Author
  • Visitor
  • Visitor
15 Feb 2015 22:39 - 15 Feb 2015 22:41 #2774 by miron
Maybe like this:
 
    [DANode(BrowsePath = "SomeValue")]
    [DAItem(Kind = DAItemMappingKind.ItemId)]
    public string SomeValueItemId 
    {
        get
        {
            ...
        }
        set
        {
            ...
        }
    }

But (if I good remember) there is no "ItemId" value in enumeration type.
Last edit: 15 Feb 2015 22:41 by miron.

Please Log in or Create an account to join the conversation.

  • miron
  • Topic Author
  • Visitor
  • Visitor
15 Feb 2015 22:35 - 15 Feb 2015 22:37 #2773 by miron
QuickOPC.NET provides attribute: MetaMember.
This attribute allow to retrive some information by mapping.

Is there any way to retrive ItemId (full BrowsePath) for DAItem?

Below example of idea:

   public class ExampleClass
 {
   [MetaMember("NodeDescriptor")]
    public DANodeDescriptor NodeDescriptor { get; set; }
 
   [DANode()] 
   [DAItem()]
   public int  SomeValue {get;set;}
 
   //=====
 
   [Some attribute]
   public string  SomeValueItemId {get;set;} 
   //In this place I would like to get ItemId of mapping SomeVale
 
   //=====
 }

Next 'SomeValueItemId' I could use e.g. in EasyOPC.NET.
Last edit: 15 Feb 2015 22:37 by miron.

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.062 seconds