For the optimization of the DB don't use PLC block, and the safety of the CPU Settings to allow access from the outside,
This setting is like that, I side with S7.net library,
https://www.ad.siemens.com.cn/club/bbs/post_like.aspx? A_id=1476016 & amp; B_id=50
Examples of good method, I tried this BBS also tried to write data is always beyond the array index error,
I look at the S7.net code, here is beyond index error, but this package a good library, many of them use this online, should is not the problem of library, doubt is what's missing configuration,