I experienced the same problem: using __VARINFO is working only in PRG context, while it crashes if used inside Function Blocks. I would really appreciate if they would fix this issue