I am having trouble with a text input field with the text bound to a string tag in my PLC. In certain cases the text that is entered is not accepted by the PLC logic, so in that case it over-writes the string value back to what it was. However, the text field on the Ignition screen is still showing the value that was input (it does not update to what is currently in the PLC). If I change the value again in the PLC it updates on the screen. When I test this in the designer it works perfectly, but when I save and launch the project it is not working correctly. I tried reducing the Fallback time value and I have tried increasing it. It does the same thing either way.
The problem is that the text input field writes the value to the PLC. The PLC rejects it and sets it back to the previous value before Ignition could see the change. So to Ignition the tag did not change and that is why the text input field had the wrong value. If you were to close the window and open it again you would see the correct value. You are going to have to put logic in to understand rejects so you can handle that case as well.
I figured it was something like that, but it worked perfectly when I ran the screen from inside the designer. Maybe I could store the old value and when a new string is written from Ignition and is not accepted I could over-write it with the old value after a time delay. That will probably work.
When I did this with a PanelView, I hid a string input button underneath a string display field. These two would be tied to two different values. Essentially I wrote to one string tag and read from another. This way if the string input was not accepted it was simply not copied over to the string that was read. I could not find a way to do this with Ignition. The ‘click’ always seems to apply to the object that is ‘on top’ and I could not find a way to define which component is ‘on top’. I tried to have two text field components, one with Editable true and one false so I can write to one tag and read from another. This works if they are not on top of each other, but I would rather have them stacked so they look like one button but I could not find a way to do that.
I did some more testing with this and I don’t think the immediate over-write by the PLC is the problem. I put in a time delay and did not over-write the value in the PLC until 5 seconds later (My scan class is set to 250ms) giving Ignition plenty of time to see the change of state. It would not work consistently. I found that if I edited the text input field and then clicked away from it to shift the focus, it would always update itself to the new value written by the PLC. I turned off the “Reject Updates During Edit” property and everything worked fine. I could even remove the time delay in the PLC. I could input a string, immediately over-write it in the PLC, and the text input field would always update to show the current value in the PLC. Of course, this only works since I am using the touch-screen input box to enter new text.
Thanks for bringing this to our attention. This should “just work” - this scenario is exactly what the “fall-back delay” is for. I think you nailed it - the fallback system may be at odds with the reject updates during edit feature. I’ve added a bug ticket for this issue.
I could only reproduce this in touchscreen mode. It has been fixed for 7.2.5.