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.
Try with int1 arrays.
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
.
I have tried this and unfortunately HALCON still refused to write into the tag as an Integer Array.
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?
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?
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:
@pturmel has a Blob server driver that will give you better options for using the images.
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.
I will try this option ASAP!
Are you sure the TCP driver is currently receiving the entire image?
What's the expected message format?
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.
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?
HALCON is speaking to Ignition via a TCP socket using the following operator: send_data [HALCON Operator Reference / Version 21.05.0.0]
Does this help?
You'll have to share the format code used, but it looks like you really will need a full socket script.
Gotcha, do you know where I can find resources towards making something like that?
Some reading:
https://forum.inductiveautomation.com/search?q=long-lived%20threads%20getGlobals%20order%3Alatest
@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.
I'll try this ASAP. Hopefully today!