See attached project.BugReportPropertyValue (2017-09-20).proj (13.0 KB)
The project contains one main window and one popup window. When the main window loads it will automatically create an integer memory tag named ‘MemTag1’ in the project’s default tag provider with a value of 5. This happens only because the popup window needs a tag for a property binding. See below.
The popup window has a custom property of type integer named ‘prop1’ on the root container and it has a tag property binding to ‘MemTag1’. The root container of the Popup window has the following propertyChange event script defined:
if event.propertyName == 'prop1': print 'prop1 - old value: %s - new value: %s' % (event.oldValue, event.newValue) if event.propertyName == 'componentRunning': if event.newValue: print 'component running'
Basically, when the value of property ‘prop1’ changes it prints it’s old and new value to the output console and the componentRunning event prints to the console as well (just for timing reference).
Launch the project:
Main window opens on startup and creates the ‘MemTag1’ tag in the default tag provider if it does not already exist.
Click the ‘Open Popup’ button to open the Popup window. You will see the following on the output terminal:
23:35:52.558 [AWT-EventQueue-2] INFO ignition.TagManager.Gateway - Starting tag polling. prop1 - old value: 5 - new value: -1 component running prop1 - old value: -1 - new value: 5
Two propertyChange events have occurred but the value of the ‘prop1’ has never changed. It was initialized to a value of 5 when bound to the ‘MemTag1’ tag in the designer. It was saved in the designer with a value of 5. MemTag1 and ‘prop1’ have never had a value other than 5 either in the designer or in the runtime. Yet for some strange reason Ignition is setting the value of the ‘prop1’ property incorrectly and aribitraily to -1 and back again triggering two false propertyChange events.
So far I have found this only happens on properties with tag bindings and the toggling back and forth happens only when the client has to fetch the value of the tag from the gateway for the first time. For example. You will see this only the first time you open the popup window. If you close it and open it again you will only see:
23:41:22.647 [AWT-EventQueue-2] INFO ignition.TagManager.Gateway - Starting tag polling. component running
This time the property value does not toggle to -1 and back.
Edit: Actually the condition for this to occur is a little more specific. At least when using a memory tag. If the tag exists already when the project is launched I don’t see this behavior. But if it doesn’t exist and is created by the project when it is launched then I do. If I replace ‘MemTag1’ with an OPC tag (an integer from the simulator for example) then I see the behavior each time I launch the project and open the popup window for the first time whether or not the tag existed before.