Reading array of structs/UDTs from B&R PLC OPC-UA server

I think this topic has the same issue, but just in case it isn’t, I didn’t want to hijack it.

I’m trying to read a tag from a B&R PC PLC’s OPC-UA server. The tag address is:

Which I can partially get to from the OPC Browser:

I’ve tried dragging on just the Group tag, which creates a StringArray tag with Unknown quality.
I have no idea how to use jsonGet to pull out the rest of the tag? (solution from other topic)

If you just need this one tag then you can bring Group in as an OPC tag and then also make an expression tag with an expression like jsonGet({path/to/group}, "[0].Cmd.EnableLabelling").

I just tried this, but the error on the expression tag is “Evaluation Error”. Not sure where to find more detailed info in the logs.


Try changing the Group tag to String or Document instead of StringArray. It needs to have a valid value before this will work.

This is 7.9.14, I don’t see the Document data type :frowning: I tried string, same thing: Group is Unknown quality

Can you pull in any of the UDTs, array or scalar, from the controller as a String tag and get a good value?

I just tried a bunch, and nope doesn’t look like it

Okay, so either the datatype dictionary isn’t being read properly or the server isn’t exposing one at all.

Can you turn DataTypeDictionaryReader to DEBUG and then edit/save the UA connection and send the logs to me?

I have the logs, but can I just export the filtered results? otherwise it’s 250meg.
Nvm it’s only 35 lines, i’ll copy paste to notepad

B_R_OPCUA_DataTypeDictionaryReader_DEBUG.log (6.9 KB)

From the Quick Client I see “The requested operation is not supported” when trying to read that Group struct:

Seems like something wrong with the server :confused:

There’s only two small dictionaries in the logs you sent me and they don’t seem to contain any custom (user defined) structs.

Hmm, sounds like I’ll have to go back to B&R. Thanks for the help! I’ll update once I get a response and/or solution from them. Cheers

The Bad_NotSupported is especially strange to me. Can you read them with UaExpert?

I sort of expected the problem here to be that the server was only supporting the UA 1.04 way of defining custom types but that doesn’t seem to be the issue.

I just tried in UA Expert and nope, can’t read it, same error BadNotSupported :confused:

Well that’s good news for me at least :slight_smile:

1 Like

We ended up getting this working. There was an option within the B&R OPC-UA config where array elements needed to be enabled. I can now browse into the structs and read tags from within the structs directly.

There are also some integer array tags that weren’t working and now are, but I’d like to create individual tags for these. I’ve tried using the jsonGet (didn’t expect that to work), and using a derived tag with the expression {source}[0,0] but I get evaluation errors.

If I create a derived tag Group Derived Tag set the source tag to the integer array and leave the read expression default (e.g. {source}), then create an expression tag with the expression: {[.]Group Derived Tag}[0,0]. This works, I correctly read the first array element.
However, I can’t create a second derived tag and use the expression: {source}[0,0].

I haven’t used derived tags at all before…

Is it a 2d array?

The integer array isn’t 2D. I tried {source}[0] as well, should have said that as well

Try an expression tag with {[~]Int32Array[0]}, {[~]Int32Array[1]}, etc… This works for me on Ignition 8, anyway.

{[~]Int32Array}[0] , {[~]Int32Array}[1] should work too, but there seems to be a problem with any index beyond 0, so we’ll look into that.

What if I need to be able to write back to the tag though? Don’t I need to use a derived tag? (in this instance I’m only reading, but thinking in the future)