# Error OPC UA , Bad\_TypeMismatch

**URL:** <https://forum.inductiveautomation.com/t/error-opc-ua-bad-typemismatch/6046>\
**Category:** Ignition\
**Created:** [March 18, 2013, 9:06am UTC](https://forum.inductiveautomation.com/t/error-opc-ua-bad-typemismatch/6046 "2013-03-18T09:06:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ypfister](https://avatars.discourse-cdn.com/v4/letter/y/f6c823/32.png) [@ypfister](https://forum.inductiveautomation.com/u/ypfister)\
**Post date:** [March 18, 2013, 9:06am UTC](https://forum.inductiveautomation.com/t/error-opc-ua-bad-typemismatch/6046/1 "2013-03-18T09:06:18Z")

</div>

Hello,  
I have a question regarding error code of Ignition OPC UA Client module:

I must read a temperature setpoint in a Beckhoff PLC.  
In the PLC, the format is an integer in 1/10 °C (example: 213 for 21.3 °C).  
In Ignition, I create a tag with the format “Float4” with scale mode :  
Linear, Raw Lo=-32’760.0, Raw Hi=32’760.0, Scaled Lo=-3’276.0, Scaled Hi=3’276.0.

The reading of the value is good, The value is displayed 21.3.  
But if I write another setpoint (eg 21.5 or 22), I get an error “Bad\_TypeMismatch”, 0x80740000. 😢

Any suggestions on how to go about this? ![:scratch:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/76d1620bec252bfac07050c889ff5a91dc8a9c25.gif ":scratch:")

PS : In the Ignition Quick Client, I have the same problem.  
But with the option “Auto-detect type”, the writing is good.

Version :  
Ignition 7.2.11  
Beckhoff OPC UA 1.6.93  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/ef4c9bbb64865671aeec64f9045aa7fc063baa45.png)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [March 18, 2013, 3:08pm UTC](https://forum.inductiveautomation.com/t/error-opc-ua-bad-typemismatch/6046/2 "2013-03-18T15:08:24Z")

</div>

What’s going on is the OPC-UA server is rejecting the write request because the data type of the value doesn’t match the data type of the node in the server.

Unfortunately, by using a float SQLTag, you’re now writing a float data type value to the server.

In later versions of Ignition the OPC-UA client will read/cache the data type for nodes and attempt to cast it for you before doing the write, but in 7.2.x the other OPC-UA SDKs/Servers out there hadn’t gotten strict about the data types coming through on writes so this functionality doesn’t exist.

So… your options:

1. Change the SQLTag to an Int2, Int4, or Int8 (whichever the actual data type ends up being).
2. Upgrade to a newer version of Ignition.

---

<div class="post-metadata">

**Author:** ![ypfister](https://avatars.discourse-cdn.com/v4/letter/y/f6c823/32.png) [@ypfister](https://forum.inductiveautomation.com/u/ypfister)\
**Post date:** [March 20, 2013, 7:48am UTC](https://forum.inductiveautomation.com/t/error-opc-ua-bad-typemismatch/6046/3 "2013-03-20T07:48:12Z")

</div>

I upgrade to a newer version of Ignition.

Thank You
