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.
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:
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.