OPC UA - BadResourceUnavailable Array Element

Hi,

I need your help. After starting the PLC, all variables are accessible.
After some time, some elements of the field are inaccessible - BadResourceUnavailable.
Only restarting the PLC, or OPC server by downloading the OPC UA map will help.

The field is of type LREAL, AR B4.63

Thank you

eus VPS SP MtAi

Hi,

for me that sounds a bit like corrupted memory.
The OPC UA server has it’s own allocated memory section, where all the opc ua tags are managed.
Memory can be overwritten accidently for example by array overflow, string operations with too small destination string size, misleaded pointers, and so on.
Under some circumstances, such a memory corruption cannot be detected by AR (if it’s detected, it normally leads to page faults)… and from your description, it could be at least possible, that some of the dynamic memory of the OPC UA server is affected.

Unfortunately I can’t give the direction where to search first, but I would propose to:

  • use IecCheck library to see if array index violations are detected
  • check the string operations in the code, especially the concat functions
  • if using dynamic variables, check if the pointers are referenced to the right target memory under all circumstances (especially when using ACCESS, check if pointers are assigned cyclic)
  • if you have a suspicion, try to disable the suspected task(s) and check if the behavior changes

Even if you’re not getting a page fault right now, you could have a look into the following post as the’re some more tipps and details inside how to proceed when suspecting a memory violation:

Best regards!

1 Like

Thanks for the advice. I use the access function often, there may be a problem.

Is it possible to restart the OPC server manually?

Hi,

no, (re)start of the OPC UA server is not possible manually, only by reboot.

Just FYI: a reboot can be triggered by software using the sys_lib library, function SYS_reset()

Best regards!

Hi @Jozef_Kapral have you found usable solution for you, can you update us?

Unfortunately, no. Restarting the OPC UA server helped, but I couldn't find
the cause of the problem.

Ok. so you have at least workaround for now. Please get in touch with local support team, provide them project and link to this B&R Community discussion. Please share with us findings if there are any. Thanks a lot and have a great Christmas time.