Professional OPC
Development Tools

logos

Attributes for live mapping

More
23 Sep 2016 08:01 #4365 by support
Replied by support on topic Attributes for live mapping
Note: Discussion continues over email. Suggested to use type-less mapping, or procedural coding.

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

More
22 Sep 2016 16:03 #4362 by support
Replied by support on topic Attributes for live mapping
Sure - the forums are meant to be useful tool by making the cases public, but if you have anything that should remain confidential, just email us at support09 (at) opclabs.com.

I wanted to reply to your last post but got distracted by other work. Please bear with me...

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

More
22 Sep 2016 15:20 #4361 by bosko
Replied by bosko on topic Attributes for live mapping
I hate to bump a topic, but you guys don't have any other way to get in touch with someone at support... by the way is there any possibility to get some contact info so I don't have to give the entirety of my IP to the world? Thank you.

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

More
21 Sep 2016 21:00 #4357 by bosko
Replied by bosko on topic Attributes for live mapping
The answer to question 2 is yes. I want my EF entities connected to OPC, but I each of my entities only needs one OPC Item. I look forward to your suggestions.

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

More
21 Sep 2016 20:41 #4356 by bosko
Replied by bosko on topic Attributes for live mapping
1. Yes. A tag is a class with only one property named Value that needs to be tied to an OPC tag. I have another text property called OpcItem that I want to hold the path. That way when a user adds a tag and picks the path, the .Value of that tag is automatically notified of changes. This is the ideal pattern for my solution. If that's not possible I will likely need to create a service that has a foreach loop going through all of my "Tag" entities and updating them manually.

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

More
21 Sep 2016 09:20 #4351 by support
Replied by support on topic Attributes for live mapping
I think I still need more explanation.

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?

Thank you

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

More
20 Sep 2016 18:08 #4349 by bosko
Replied by bosko on topic Attributes for live mapping
Thank you for your answer. It is absolutely about the end user defining the OPC item name. I have an entity called tag in my solution, and I want the user to be able to do simple CRUD on "Tags" within the "Run time" solution and be able to choose which OPC item corresponds to the value property of the newly created tag. This is then stored in a database and retrieved when needed. Does that make more sense? Please let me know if this can be addressed using the deferred mapping option. This is a key feature for my solution.

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

More
20 Sep 2016 06:40 #4347 by support
Replied by support on topic Attributes for live mapping
I suppose your question

I would like the end user to be able to specify the item name for a tag. What options are there?

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.

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.

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

More
19 Sep 2016 21:10 #4344 by bosko
Replied by bosko on topic Attributes for live mapping
Edit. I set the DANode(Deffered = true). Now I need an example of how to accomplish the following:
From section 7.1.6.8

Set the DeferredMapNodeFunction of the DAClientMapper or UAClientMapper to a
function that returns the deferred mapping function (see above) for a given mapping
context.

I can't find an example of how to do this. Thank you!

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

More
19 Sep 2016 20:27 #4343 by bosko
Replied by bosko on topic Attributes for live mapping
Thank you for the guidance on which section to read. I think what I need is deferred mapping. Are there examples of using this feature?

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

Moderators: support
Time to create page: 0.214 seconds

      

 Recommend this on Google