# Tag write failed to OPC-UA TCP driver tag

**URL:** <https://forum.inductiveautomation.com/t/tag-write-failed-to-opc-ua-tcp-driver-tag/98720>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [November 17, 2024, 9:44pm UTC](https://forum.inductiveautomation.com/t/tag-write-failed-to-opc-ua-tcp-driver-tag/98720 "2024-11-17T21:44:22Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![wpmccormick](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wpmccormick/32/13940_2.png) [@wpmccormick](https://forum.inductiveautomation.com/u/wpmccormick)\
**Post date:** [November 17, 2024, 9:44pm UTC](https://forum.inductiveautomation.com/t/tag-write-failed-to-opc-ua-tcp-driver-tag/98720/1 "2024-11-17T21:44:22Z")

</div>

I'm try to figure out how to write to devices through the TCP driver. ( **8.1.44** )

I have netcat server listening on port 8182, and an OPC-UA device (TCP driver) named _netcat_ connected to it (shows 1/1 Connected). From OPC Quick Client, I try to write to [netcat]8182/Message and get this error:

`* Write failed: Bad("Bad_NotWritable: The access level does not allow writing to the Node.")`

I get the same error when trying to write to it through a tag, which is the eventual goal. I'm pretty sure this is a security type setting somewhere, but hours of fiddling hasn't found it.

As a side note, the end goal is to be able to simulate message exchanges with devices over just tcp/udp sockets, and maybe netcat isn't the best tool for this since it could be challenging to simulate server responses. So if there is a better lightweight, containerizable tool I'd like to hear about that.

---

<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:** [November 17, 2024, 10:08pm UTC](https://forum.inductiveautomation.com/t/tag-write-failed-to-opc-ua-tcp-driver-tag/98720/2 "2024-11-17T22:08:26Z")

</div>

The `Message` tag isn't writable.

You can go into the advanced configuration for that device and set `Writeback Enabled` to `true`.

Then there will be new `Writable` and `WritableBytes` tags, that you can write a String or ByteString to, respectively.

---

<div class="post-metadata">

**Author:** ![wpmccormick](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wpmccormick/32/13940_2.png) [@wpmccormick](https://forum.inductiveautomation.com/u/wpmccormick)\
**Post date:** [November 18, 2024, 12:13am UTC](https://forum.inductiveautomation.com/t/tag-write-failed-to-opc-ua-tcp-driver-tag/98720/3 "2024-11-18T00:13:36Z")

</div>

Is there where I'd expect to see what the device returns?

---

<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:** [November 18, 2024, 12:15am UTC](https://forum.inductiveautomation.com/t/tag-write-failed-to-opc-ua-tcp-driver-tag/98720/4 "2024-11-18T00:15:22Z")

</div>

`Message` contains anything the device sends, assuming you have your framing/delimiter set up correctly.

`Writable` tags are for you to write to only, they don't contain anything the device might have sent back.

---

<div class="post-metadata">

**Author:** ![wpmccormick](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wpmccormick/32/13940_2.png) [@wpmccormick](https://forum.inductiveautomation.com/u/wpmccormick)\
**Post date:** [November 18, 2024, 7:59pm UTC](https://forum.inductiveautomation.com/t/tag-write-failed-to-opc-ua-tcp-driver-tag/98720/5 "2024-11-18T19:59:34Z")

</div>

Is there some way I can see what, if anything the server is replying with? Just so I can see exactly what it looks like? Internal to Ignition; anything short of Wireshark?

Edit: Just occurred to me to inspect MessageBytes.

---

<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:** [November 18, 2024, 8:07pm UTC](https://forum.inductiveautomation.com/t/tag-write-failed-to-opc-ua-tcp-driver-tag/98720/6 "2024-11-18T20:07:47Z")

</div>

How about actual Wireshark?

You can also search for loggers related to "TCPDriver" or "TCPConnection" and set them to DEBUG or TRACE.

You haven't shared what your delimiter settings are or what data you're trying to send either.

---

<div class="post-metadata">

**Author:** ![wpmccormick](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wpmccormick/32/13940_2.png) [@wpmccormick](https://forum.inductiveautomation.com/u/wpmccormick)\
**Post date:** [November 18, 2024, 8:17pm UTC](https://forum.inductiveautomation.com/t/tag-write-failed-to-opc-ua-tcp-driver-tag/98720/7 "2024-11-18T20:17:13Z")

</div>

Yes whatever the previous guy had in there for delimiter settings where just wrong. I switched to Packetbased and cleared everything else out and now I'm seeing a reply; both in Message and MessageBytes.

---

<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:** [November 18, 2024, 8:19pm UTC](https://forum.inductiveautomation.com/t/tag-write-failed-to-opc-ua-tcp-driver-tag/98720/8 "2024-11-18T20:19:15Z")

</div>

Packet based is a bad choice for the TCP Driver. It will look like it works, but then one time it won't work, because packet based is a nonsense option for TCP. What it ends up doing is just dumping the contents of a socket read into the message tags, which just means whatever was in the buffers, which really depends on the OS and what you're receiving.

That it was ever even a configuration choice is because it shares too much code with the UDP Driver ☹

---

<div class="post-metadata">

**Author:** ![wpmccormick](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wpmccormick/32/13940_2.png) [@wpmccormick](https://forum.inductiveautomation.com/u/wpmccormick)\
**Post date:** [November 18, 2024, 9:11pm UTC](https://forum.inductiveautomation.com/t/tag-write-failed-to-opc-ua-tcp-driver-tag/98720/9 "2024-11-18T21:11:28Z")

</div>

Well I did love this and now I don't. When I did see something there, it was enough to determine that 24 of the 32 chars represented a hex number that exactly corresponded to what I wanted. Sort of; I was expecting something by the way of a delimiter somewhere, but there was none in the 16 bytes that where in the buffer. The last 4 bytes where all zero.

At some point it stopped working, but I didn't notice until I made a change in what I sent that should have caused a change in those 12 bytes. Now no matter what I make _Message Delimiter Type_ nothing works. I tried FixedSize and set Message Delimiter to various sizes but didn't get lucky.

I'm having a hard time finding any docs on this thing (ZT411) to describe any sort of protocol and/or formatting. I guess Wireshark, which I have to spend hours trying remember how the damn thing works.

EDIT:Setting the logs for the driver to _Trace_, sometime I'll see Handling payload: 6CDBEE80, where that hex number is some portion of what I'd expect.

EDIT: Ran WS on the GW and was able to see, but not make any sense of what the damn thing is sending back.
