1
Support Questions / Re: How To Determine If Last PLC Tag Read Was Not Successful
« on: September 04, 2017, 04:30:05 PM »
Hi, Archie,
I have determined through testing that when a BasicLabel loses connection to a PLC that its displayed text alternates between the last value it was able to read and an error messages such as "Unable to connect to xxx". I never implemented the textchanged event, I just watched the basiclabel displayed text switch back and forth in my program. So, if what is visually changing on the screen is truly just a "display" and not the underlying value in the text property then comparing value to text would work.
The PLC programmer is going to design an incrementing counter for me to check. If I read the counter and see that it isn't incrementing then I'll know that the PLC is offline or having issues. I've also built a timer to ping the PLC every 30 seconds. If the code can ping the plc, the timer sets DisableSubscriptions to False. If not, it sets DisableSubscriptions to true.
My two cents are that I feel like the BasicLabel "knows" when it can't read data and ought to be able to set a property indicating no value was read last time, but I'm not complaining because AHMI already does so much and is so awesome.
Any and all advice is very much appreciated.
Ken Sumrall
I have determined through testing that when a BasicLabel loses connection to a PLC that its displayed text alternates between the last value it was able to read and an error messages such as "Unable to connect to xxx". I never implemented the textchanged event, I just watched the basiclabel displayed text switch back and forth in my program. So, if what is visually changing on the screen is truly just a "display" and not the underlying value in the text property then comparing value to text would work.
The PLC programmer is going to design an incrementing counter for me to check. If I read the counter and see that it isn't incrementing then I'll know that the PLC is offline or having issues. I've also built a timer to ping the PLC every 30 seconds. If the code can ping the plc, the timer sets DisableSubscriptions to False. If not, it sets DisableSubscriptions to true.
My two cents are that I feel like the BasicLabel "knows" when it can't read data and ought to be able to set a property indicating no value was read last time, but I'm not complaining because AHMI already does so much and is so awesome.
Any and all advice is very much appreciated.
Ken Sumrall