In this video I will show how you can limit the PopUp numbers to once by saving the PopUp names in a Map () object. By default, you can open unlimited PopUps
00:00 Intro
00:12 Problem
00:36 Limit to one PopUp per Screen
01:29 Limit to one PopUp per Faceplate instance
05:04 Limit to one multiple PopUp per Faceplate instance
07:15 Limit multiple PopUp per Faceplate instance
solution from Ignat (I have modified it a little for this video)
https://support.industry.siemens.com/...
to store the PopUP names I use the Map() object
https://www.w3schools.com/js/js_objec...
//global definition
const FaceplateInstanceName = new Map();
function createPopUp (OpenPopUpCall, Objectname){
let ui = UI;//workaround to adress UI objects
let count = ui.PopupScreenWindows.Count;//count all open Popup in the screen
let fpExisits = false;
for (let i=0; i ""smaller-than sign" count; i++){
let name = ui.PopupScreenWindows(i).Name;
if(FaceplateInstanceName.get (name) ==Objectname){
FaceplateInstanceName.delete(name);
ui.PopupScreenWindows(i).Close();
fpExisits = true;
break;
}
}
if (!fpExisits){
let po = OpenPopUpCall();
po.Left = Faceplate.Parent.Left +200;
po.Top = Faceplate.Parent.Top;
po.Visible = true;
FaceplateInstanceName.set (po.Name, Objectname)
}
}
//function call
createPopUp (()="Greater-than sign" Faceplate.OpenFaceplateInPopup("YourFaceplatePopUp", Faceplate.Parent.Name, true, false),Faceplate.Parent.Name+item.Name);
Music from Unicorn Heads- Drifting at 432 Hz • Unicorn Heads - Drifting at 432 Hz
#DerHecht #WinCC #Unified #TIAPortal