I am using OpcNetApi.dll driver to connect Softing opc server and i am reading few tags from subscription read method every second in the windows service, Initially it reads the value fine for few hours like 10 or 15 hours but then i constantly getting this ReadMaxAge exception for each read, when i reboot the server it starts working correctly again for few hours. i tried searching to find what is causing but no luck.
Does anyone have idea about ReadMaxAge exception please help.
So, I did long term test (6 days!) of OPC client written using OpcNetApi, connected to MatrikonOPC server for simulation, with result No crash at all. I've also check code of OpcNetApi! Exception is thrown from underlying COM object (and the details are not provided of course). At the moment I suspect that it crashed because OPC server itself was not running. I've added additional logging to my "production" application to verify my suspicion.
edit: There has been no crash related to "ReadMaxAge" so far (service is running for a week now). I would recommend you to verify that OPC server that you are connecting to is ONLINE when the exception occurs.