# byteString OPC UA Tags In Ignition

**URL:** <https://forum.inductiveautomation.com/t/bytestring-opc-ua-tags-in-ignition/102262>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [February 12, 2025, 6:37pm UTC](https://forum.inductiveautomation.com/t/bytestring-opc-ua-tags-in-ignition/102262 "2025-02-12T18:37:54Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![brandon\_browning](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@brandon\_browning](https://forum.inductiveautomation.com/u/brandon_browning)\
**Post date:** [February 12, 2025, 6:37pm UTC](https://forum.inductiveautomation.com/t/bytestring-opc-ua-tags-in-ignition/102262/1 "2025-02-12T18:37:54Z")

</div>

Hello all,  
Does anyone have experience accepting byteStrings over OPC UA? I am trying to integrate MVTec HALCON into Ignition using OPC UA and it wants to send Ignition a byteString. However, I cannot get Ignition to make a tag of type byteString for HALCON to send the value to. I am open to ideas and suggestions.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 12, 2025, 6:41pm UTC](https://forum.inductiveautomation.com/t/bytestring-opc-ua-tags-in-ignition/102262/2 "2025-02-12T18:41:00Z")

</div>

Try with int1 arrays.

---

<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:** [February 12, 2025, 7:03pm UTC](https://forum.inductiveautomation.com/t/bytestring-opc-ua-tags-in-ignition/102262/3 "2025-02-12T19:03:34Z")

</div>

If Ignition is the Server in this scenario then I don't think there's anything you can do.

Ignition doesn't have an equivalent tag datatype for `ByteString`. An `Int1Array` is conceptually the closest but it's not going to be exposed on the OPC UA side using the `ByteString` datatype. I'm pretty sure `Int1Array` will get exposed as a 1-dimensional array of `SByte`.

---

<div class="post-metadata">

**Author:** ![brandon\_browning](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@brandon\_browning](https://forum.inductiveautomation.com/u/brandon_browning)\
**Post date:** [February 12, 2025, 8:15pm UTC](https://forum.inductiveautomation.com/t/bytestring-opc-ua-tags-in-ignition/102262/4 "2025-02-12T20:15:00Z")

</div>

I have tried this and unfortunately HALCON still refused to write into the tag as an Integer Array.

---

<div class="post-metadata">

**Author:** ![brandon\_browning](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@brandon\_browning](https://forum.inductiveautomation.com/u/brandon_browning)\
**Post date:** [February 12, 2025, 8:16pm UTC](https://forum.inductiveautomation.com/t/bytestring-opc-ua-tags-in-ignition/102262/5 "2025-02-12T20:16:13Z")

</div>

Thank you for the insight, did not know the extent of these implementations. I have gotten HALCON to send an image through a TCP socket as bytes. Do you know of a way to display an image coming through in this fashion?

---

<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:** [February 12, 2025, 8:17pm UTC](https://forum.inductiveautomation.com/t/bytestring-opc-ua-tags-in-ignition/102262/6 "2025-02-12T20:17:16Z")

</div>

It depends whether you're trying to visualize it in Perspective or Vision. It's probably possible with some scripting, which is presumably where you're already opening a socket and receiving the data?

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [February 12, 2025, 8:22pm UTC](https://forum.inductiveautomation.com/t/bytestring-opc-ua-tags-in-ignition/102262/7 "2025-02-12T20:22:34Z")

</div>

Can you trigger a script with `system.opc.readValue` and directly grab the bytestring from the device?  
I have grabbed images off a Datalogic Matrix Barcode reader over OPCUA as bytestring, but they came from a OPCUA method as a bytestring.  
Once you do that, I threw them into a db as base64 and used them in reports:

> [@Retrieving Base64 Images from SQL Databases](https://forum.inductiveautomation.com/t/retrieving-base64-images-from-sql-databases/80046):
>
> I have been struggling through making Base64 images work properly in various areas of a job, so seeing as there is no clear information on how to do this, I thought I would make a post to preserve the info I have accumulated. Encoding an image to save in a Database I am using a device that sends me Image data on OPC-UA, so my data will come from a different system than most people will use. When I get an image, I have a python script in my gateway that does the following: import base64 logg…

@pturmel has a Blob server driver that will give you better options for using the images.

---

<div class="post-metadata">

**Author:** ![brandon\_browning](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@brandon\_browning](https://forum.inductiveautomation.com/u/brandon_browning)\
**Post date:** [February 12, 2025, 8:25pm UTC](https://forum.inductiveautomation.com/t/bytestring-opc-ua-tags-in-ignition/102262/8 "2025-02-12T20:25:15Z")

</div>

I am making visualizations in Perspective. The value is coming in the form of the OPC tag MessageBytes from the TCP device. I have been trying to get this to display in an image component via webDev module. To no avail yet.

---

<div class="post-metadata">

**Author:** ![brandon\_browning](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@brandon\_browning](https://forum.inductiveautomation.com/u/brandon_browning)\
**Post date:** [February 12, 2025, 8:26pm UTC](https://forum.inductiveautomation.com/t/bytestring-opc-ua-tags-in-ignition/102262/9 "2025-02-12T20:26:28Z")

</div>

I will try this option ASAP!

---

<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:** [February 12, 2025, 8:36pm UTC](https://forum.inductiveautomation.com/t/bytestring-opc-ua-tags-in-ignition/102262/10 "2025-02-12T20:36:19Z")

</div>

Are you sure the TCP driver is currently receiving the entire image?

What's the expected message format?

---

<div class="post-metadata">

**Author:** ![brandon\_browning](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@brandon\_browning](https://forum.inductiveautomation.com/u/brandon_browning)\
**Post date:** [February 12, 2025, 8:38pm UTC](https://forum.inductiveautomation.com/t/bytestring-opc-ua-tags-in-ignition/102262/11 "2025-02-12T20:38:24Z")

</div>

That is where I do not exactly know. I wanted to see if I could quickly find somewhere to export the Ignition tag so I could reconstruct the image.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 12, 2025, 8:40pm UTC](https://forum.inductiveautomation.com/t/bytestring-opc-ua-tags-in-ignition/102262/12 "2025-02-12T20:40:30Z")

</div>

To receive byte streams over TCP you will almost certainly need to use a scripted java socket. Do you have any documentation for the protocol that device is using?

---

<div class="post-metadata">

**Author:** ![brandon\_browning](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@brandon\_browning](https://forum.inductiveautomation.com/u/brandon_browning)\
**Post date:** [February 12, 2025, 8:46pm UTC](https://forum.inductiveautomation.com/t/bytestring-opc-ua-tags-in-ignition/102262/13 "2025-02-12T20:46:28Z")

</div>

HALCON is speaking to Ignition via a TCP socket using the following operator: [send\_data [HALCON Operator Reference / Version 21.05.0.0]](https://www.mvtec.com/doc/halcon/2105/en/send_data.html)  
Does this help?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 12, 2025, 9:49pm UTC](https://forum.inductiveautomation.com/t/bytestring-opc-ua-tags-in-ignition/102262/14 "2025-02-12T21:49:29Z")

</div>

You'll have to share the format code used, but it looks like you really will need a full socket script.

---

<div class="post-metadata">

**Author:** ![brandon\_browning](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@brandon\_browning](https://forum.inductiveautomation.com/u/brandon_browning)\
**Post date:** [February 12, 2025, 10:03pm UTC](https://forum.inductiveautomation.com/t/bytestring-opc-ua-tags-in-ignition/102262/15 "2025-02-12T22:03:40Z")

</div>

Gotcha, do you know where I can find resources towards making something like that?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 12, 2025, 10:34pm UTC](https://forum.inductiveautomation.com/t/bytestring-opc-ua-tags-in-ignition/102262/16 "2025-02-12T22:34:21Z")

</div>

Some reading:

[https://forum.inductiveautomation.com/search?q=long-lived%20threads%20getGlobals%20order%3Alatest](https://forum.inductiveautomation.com/search?q=long-lived%20threads%20getGlobals%20order%3Alatest)

---

<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:** [February 13, 2025, 1:45pm UTC](https://forum.inductiveautomation.com/t/bytestring-opc-ua-tags-in-ignition/102262/17 "2025-02-13T13:45:44Z")

</div>

@brandon_browning another approach if you want to stick with OPC UA would be to use the SDK device example as a basis to create a driver that exposes a ByteString tag. This is practically the easiest driver you could make.

The client software would see the tag as a ByteString and be able to write to it.

You can pull the tag into Ignition and it will show up as a ShortArray (Int2Array). You'll be able to create an image from that with some scripting on a tag change script or something.

> **[ignition-sdk-examples/opc-ua-device at master ·...](https://github.com/inductiveautomation/ignition-sdk-examples/tree/master/opc-ua-device)**
>
> Ignition SDK Example Projects. Contribute to inductiveautomation/ignition-sdk-examples development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![brandon\_browning](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@brandon\_browning](https://forum.inductiveautomation.com/u/brandon_browning)\
**Post date:** [February 13, 2025, 2:03pm UTC](https://forum.inductiveautomation.com/t/bytestring-opc-ua-tags-in-ignition/102262/18 "2025-02-13T14:03:12Z")

</div>

I'll try this ASAP. Hopefully today!
