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.
Attributes for live mapping
I wanted to reply to your last post but got distracted by other work. Please bear with me...
1. What you call "Tag" in your solution, does it correspond to a single OPC item, or does it correspond to a whole set of OPC items, organized in some kind of a sub-tree in the address space of the OPC server?
If we are talking about single OPC items, I think that the Live Mapping would be a true overkill here, and only bring extra complexity.
2. Are you trying to create some kind of double-mapping, where the same objects would be mapped both to OPC data, and also (using some ORM) to the database? That would be quite smart, but can be a challenge.
The deferred mapping function is not precisely for the purpose you mentioned. Its aim is not to dynamically change the mapping attributes (the OPC side of things), but rather to dynamically provide the object to be mapped (the .NET side of things). That object, however, needs again to be mapped (inside the deferred mapping function) using the Map function on the mapper, and as such is expected to contain "static" attributes (on its members) that will define the OPC item IDs/browse names, or their format. In this way, it does not directly allow to dynamically change them either.
Now when I think about it deeper, there is one thing that the deferred mapping function can do, and that is to modify the mapping context for the object it maps. That is, the mapping for that object can "start" at a different place in the OPC address space, and that indeed should be possible to influence in the code of the deferred mapping function.
I will need some more concrete example of what are you trying to achieve, in order to determine whether this would be the right approach (or suggest a different one). Can you provide it?
is not about how the end user can actually select the tag (for that, we have browsing dialogs and browsing controls), but is rather about how the developer can specify an OPC item name ("tag") in Live Mapping, besides typing it in directly in the "DANode" attribute.
I would like the end user to be able to specify the item name for a tag. What options are there?
The answer is that there are not so many options in Live Mapping for it. The node ID needs to be either specified in full on the member. Or, it can be constructed using a format string based on the node ID of its parent. Alternatively, it is possible to use browse paths instead of node IDs. This usually plays better with structures in the address space that look like sub-trees that are repeated at multiple places. The browse path allow you to specify only the "short name" of the node, which takes it from the parent to the actual node (whereas the full ItemIDs are "just strings" and may not have any syntax that would allow to encode/decode the hierarchical structure in them).
It is always possible to "start" the mapping at certain place in the OPC address space. That is, the developer can specify a starting node Id/browse path, and an object that should be mapped to it. This is done in the code, and we have/can give examples for that. But from that point onwards (deeper), the mapping goes by its own rules, and the node Ids/browse names (or their format) need to be specified using attributes, statically.
I will answer your question about deferred mapping function separately later.
From section 220.127.116.11
Set the DeferredMapNodeFunction of the DAClientMapper or UAClientMapper to a
function that returns the deferred mapping function (see above) for a given mapping
I can't find an example of how to do this. Thank you!