Hi, I have created a project script in the following path:
Under Scripting->Project Library->project->customStartUp
Under project.customStartUp i have defined as follow:
def tagChecks():
if system.tag.read(“tag”).value == 1 :
system.nav.openWindow(‘screen1’)
else:
system.nav.openWindow(‘screen2’)
And then i go to Client Event Scripts->Startup script:
project.customStartUp.tagChecks()
However when i start a runtime, the script doesnt seem to be working as neither screen1 or screen 2 appear during the startup.
I looked into the diagnostic console and i saw:
11:48:12.916 [ProjectDownloader] ERROR Scripting.ScriptManager.Filling - Warning: collision at system.util.modifyTranslation
11:48:12.917 [ProjectDownloader] ERROR Scripting.ScriptManager.Filling - Warning: collision at system.util.translate
11:48:12.922 [ProjectDownloader] ERROR Scripting.ScriptManager.Filling - Warning: collision at system.util.initialize
However when i tried to run project.customStartUp.tagChecks() in designer’s Script Console, it was working, the correct screen was opened in the designer.
Those “collision” errors in the diagnostic console are a harmless IA bug. Was there no other error in the client? (Startup doesn’t run in the designer.)
In fact, i have also tried implementing directly on the startup script:
if system.tag.read("[Filling]FILLING_SYSTEM/dummy").value == 1 :
system.nav.openWindow(‘Filling System/screen1’)
system.nav.centerWindow(‘Filling System/screen1’)
I have ensured that the bit is 1 throughout. But during startup the popup screen is not showing.
By the way, I am using Ignition Edge 8.0.13
Scatter some print statements through your code to show the values you are getting at various points, and to show whether the logic gets to certain spots. Look for the output in the client’s diagnostic console.
On the diagnostic console:
11:37:25.472 [ProjectDownloader] ERROR Scripting.ScriptManager.Filling - Warning: collision at system.util.modifyTranslation
11:37:25.565 [ProjectDownloader] ERROR Scripting.ScriptManager.Filling - Warning: collision at system.util.translate
11:37:25.567 [ProjectDownloader] ERROR Scripting.ScriptManager.Filling - Warning: collision at system.util.initialize
11:37:26.647 [AWT-EventQueue-0] INFO vision.App - Starting Up… beginning of script open window tag write function end of script
On the tag browser, writetag has changed from 0 to 1. But it seems that it was not recorded on the diagnostic.
I have also opened up the menu and windows bar to check all the screens that are currently being opened, but ‘screen1’ is not there as well…
Im so sorry, it is due to my negligence.
The popup screen that i was trying to display, had a internalFrameDeactivated script action whereby it will close this screen when the window loses focus.
During normal operation, the popup screen would display, and only after i clicked somewhere else on the screen, the screen would then be closed automatically.
I assumed that it would behave the same during startup.
However I realised that the screen seems to be closed automatically during the startup, without appearing first and wait for a ‘lose focus’ instead.
It is just assuming that it has lost its focus during the startup?..
(The screen has the highest layer number and I did not click anywhere else during startup)