- Posts: 69
- Thank you received: 0
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.
Data Type Compliance
- Captain_Dash
- Topic Author
- Offline
- Platinum Member
When this could be fixed in a future version it would be great.
Best regards
Please Log in or Create an account to join the conversation.
A short explanation, if at all possible, is like this: Use of UAAttribute<TValue> requires you (if we are talking about the Value attribute of UA node) to specify its type using ValueType property in the [UAData] mapping attribute. For reading, this type needs to match what you obtain through read - already passed through our conversion to CLS compliant types. Unfortunately, that also means that we will be converting to THAT type while writing. This is a conflict - we will need to untangle these two somehow.
Best regards
Please Log in or Create an account to join the conversation.
- Captain_Dash
- Topic Author
- Offline
- Platinum Member
- Posts: 69
- Thank you received: 0
Basically we have 3 options here:
1. Use a smaller type on UA and client site (UINT16, int32)
2. Use signed type (Int32, long)
3. Use non generic UAAttributeData and need to cast later at runtime.
When you say
...when there is this difference between the data type needed inside UA (UInt32), and the type we are using on API surface (Int64/long), you cannot currently do it with generic UAAttributeData<TValue>;...
Does this include all use cases where the type on the UA server is unsigned and not CLS Compliant? Because this would eliminate option 1. I think we already used this option on a other code part. Maybe I misunderstood something.
Best Regards
Please Log in or Create an account to join the conversation.
I am sad to report that when there is this difference between the data type needed inside UA (UInt32), and the type we are using on API surface (Int64/long), you cannot currently do it with generic UAAttributeData<TValue>; you need to use simple UAAttributeData instead (leading to 'object'-typed values).
I will make a note and check to see whether we can improve it in future version.
Best regards
Please Log in or Create an account to join the conversation.
- Captain_Dash
- Topic Author
- Offline
- Platinum Member
- Posts: 69
- Thank you received: 0
[UANode(BrowsePath = ".Mode")]
[UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.AttributeData)]
[UAMonitoring(SamplingInterval = 250)]
[UASubscription(PublishingInterval = 500)]
public UAAttributeData<long> Mode
{
get { return mode; }
set
{
this.SetUaAttritbuteDataProperty(ref mode, value);
}
}
Depending on the generic type in type UAAttributeData, we can either read or write, but not both at the same time.
Are there any other details you need to know?
Please Log in or Create an account to join the conversation.
please be more specific about how you use that variable. You wrote "when we map" - does that mean that you are using the Live Mapping feature of QuickOPC? Or are these just Reads and Writes on the EasyUAClient object?
Regards
Please Log in or Create an account to join the conversation.
- Captain_Dash
- Topic Author
- Offline
- Platinum Member
- Posts: 69
- Thank you received: 0
we run into a problem with a reading and writing of a variable. On server side (Codesys) the data type is UDINT
Data Type Lower Limit Upper Limit Memory
UDINT 0 4294967295 32 bit
So basically should this be the UINT32 type from the table on this page:
QuickOPC CLS Compliant Types
When we map this type on client side as long we have the problem, that we can read the variable, but are not able to write any value to the server.
When we map this type on client side as uint are we able to write values to the server but are unable to read values from the server.
Is there a way to do both reading and writing?
Please Log in or Create an account to join the conversation.