Page 1 of 1

BadTypeMismatch

Posted: 04 Apr 2018, 10:52
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

Re: BadTypeMismatch

Posted: 01 Jun 2018, 17:11
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.