Calling method on OPC UA server for file sending to a press


I am trying to send the recipe file to an Arburg press. The connection is OPCUA and we have a method to call.
It needs some flags and a file as a ByteString.


I tried with UA expert and I am able to call the method and send the file.
With Ignition I create a script that at the end calls
file = open(filePath+fileName, “rb”)
byte =

result = system.opcua.callMethod(
[1, 1, 0, 0,byte]

In this case I get an error like this one:

I am assuming that the file I am passing is in the wrong format, but since is the same file I used with UA Expert, I think that I am reading the file in the wrong way.

Any idea on how to read the file in order to have a ByteString?

Many thanks

What version of Ignition are you using? What is the type of the bytes argument you are passing to callMethod? I think just ints should work…

Try using system.file.readFileAsBytes instead of opening the file in Jython, which just gives you a String value.

You need to be on a least Ignition 8.1.1 for this to work I think.

At the moment we have 8.0.12, but in case we can try a test with an installation on a laptop and give it a try.