2/7/2021 12:04 AM | |
Joined: 2/6/2021 Last visit: 4/1/2024 Posts: 9 Rating:
|
Hi,
You might want to have a look at https://support.industry.siemens.com/cs/mdm/109773780?c=118289503627&lc=en-WW The description of the Screen property of the Windows object says: "The "Screen" property returns a different value than the "CurrentScreen" property when the referenced screen is not yet loaded completely or does not exist." You could start a timer with a callback and check if the screen name has been changed after e.g. 2 seconds. If it has not been successfully changed you could revert to the previous screen or a default screen. Instead of checking the name you could also check the property "CurrentScreen" of the ScreenWindow which would not be valid object when no screen is loaded. I'm not sure if the Panel and PC Runtimes behave the same in this aspect. For the timer you can use HMIRuntime.Timers.SetTimeout(CallbackFunction,DelayInMillisecs); Another approach might be to use the screen number instead of the screen name, but I don't know to what extend this has been implemented and how it behaves when the number does not have a screen assigned. The number was actually introduced for exactly the use case you have. The best way would be to check if the screen exists before opening the screen, but I don't know a supported way to get a list of all configured screen names. Michael |
Follow us on