BadTypeMismatch

Questions regarding installing, running and configuring UaGateway.

Moderator: uagateway

Post Reply
estelle
Jr. Member
Jr. Member
Posts: 1
Joined: 04 Apr 2018, 10:40

BadTypeMismatch

Post by estelle »

Hi,

I am using UaGateway, but I have troubles with a type a variable.

In OPC DA, I have variables with "Native Datatype : VARTYPE 0X0000000E", that are integers and that I can read with a "UI8" resquest Datatype in a OPC DA Client.

When I try to read this variable with a UA Client with UaGateway, I cannot read it. I get a BadTypeMismatch in the StatusCode, so the value is empty and the Datatype is "Null".

Is is posible to configure UaGateway to be able to read this type of variable ?

Thanks

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

Re: BadTypeMismatch

Post by Support Team »

Hi,

the mapping between different variant types as in classic COM DA does not apply to OPC UA types mapping. Except for the obvious types there are some tricky ones, like the vtDecimal, vtCY and the vtObject which have no direct representation in OPC UA. Hence, passing them through (like the UaGateway always tries to do) does not work.

Converting the vt_Decimal (16 bit fixed pointer value) to an UI8 will lead to data loss (or inaccuracy) as you lose the "decimals" which were probably the reason why someone used the vt_Decimal and not an Integer.

So the best approach will be to change the origin data type and make it UI8 (or other usefull type) right from the start.
Best regards
Unified Automation Support Team

Post Reply