Hello,
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 = file.read()
digit=len(byte)
file.close()
result = system.opcua.callMethod(
“M028783”,
“ns=2;i=399860”,
“ns=2;i=399790”,
[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
Andrea