OPC UA Methods array error

I am calling a Siemens PLC OPC UA Method from Ignition Perspective using system.opcua.callMethod().

The method expects 2 inputs:

    1. Header — custom struct
    2. ParameterArray[0..1] of custom struct

When I sent one payload, I got:

java.lang.Exception: expected 2 inputs, got 1

After sending 2 inputs, Ignition gives:

java.lang.RuntimeException: unsupported array conversion: target=ExtensionObject, value=class org.python.core.PyList

After trying Java array conversion, it gives:

java.lang.RuntimeException: unsupported array conversion: target=ExtensionObject, value=class [Ljava.lang.Object;

It looks like Siemens struct arrays are exposed as OPC UA ExtensionObject[], and Ignition is not converting the array payload correctly.

Does Ignition support passing Siemens Array of Struct / ExtensionObject[] as OPC UA method inputs? Or should we avoid this and use writable OPC UA tags plus a simple method trigger?:thinking:

I think there might be a bit of a usability bug on our side, but try passing '[]' as the empty array parameter, e.g.

  header = '{...}'              
  params = '[]'
  system.opcua.callMethod(connection, objectId, methodId, [header, params])

note it's a string literal containing [], not a python empty list.