Tag write failed to OPC-UA TCP driver tag

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.

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.

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

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.

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.

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.

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.

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 :frowning:

1 Like

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.