Integer type converted to Variant type

Questions regarding installing, running and configuring UaGateway.

Moderator: uagateway

Post Reply
Pier
Jr. Member
Jr. Member
Posts: 1
Joined: 01 Oct 2015, 13:15

Integer type converted to Variant type

Post by Pier »

I noticed that the Integer type from an OPC UA server is converted to a Variant type in the UA-Gateway.
Other types that we use like Double, Float, String ... are converted OK in the UA-Gateway.
You can see this using the OPC COM client Matrikon OPC explorer and connect to the UA-Gateway.
Writing a value to this Variant type will result in a type conversion error.
Question: why doesn't UA-Gateway support the Integer type?

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: Integer type converted to Variant type

Post by Support Team »

Hi,

Integer is an abstract data type and cannot be transferred on the wire. In addition, COM OPC DA data types do not have a concept of abstract data types
Therefore the data type attribute is mapped to Variant in the COM data type property and for the value in Read or DataChange, the provided concrete value in the UaVariant is converted to the concrete Windows Variant type.

Best Regards,
Unified Automation Support Team

ghallibu
Jr. Member
Jr. Member
Posts: 3
Joined: 23 Nov 2015, 22:14

Re: Integer type converted to Variant type

Post by ghallibu »

I have much the same problem using the UAGateway with Intouch FSGateway (a DA client). Data types get converted in UAGateway which means you can read OK but not write data. This makes UAGateway unusable.

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: Integer type converted to Variant type

Post by Support Team »

Hi,

Like described above, COM OPC DA and COM Variants do not have the concept of abstract types and this is one of the restrictions of OPC COM DA that causes problems when mapping OPC UA to COM OPC DA.

In addition, COM OPC DA allows automatic conversions of data types in the server. This caused a lot of problems for language specific conversion between string and floating point values / date time values. Therefore OPC UA requires that a client writes the right data type and UaGateway must do the right conversion before forwarding the write value to the OPC UA server.

This conversion fails for abstract types. Therefore the write fails at the moment.

We have changed the behavior in UaGateway to skip the conversion for abstract types. The next version 1.4 that is currently in testing will provide this change.

But this requires that the client writes a value with a data type that is accepted by the OPC UA Server. We cannot solve this limitation of COM OPC DA completely in UaGateway. But the client has now a chance to write the right data type and to get the write working.

Best Regards,
Unified Automation Support Team

Post Reply