to closed all PopUps add this script on the "cleared" event of the screen let ui = UI; let count = ui.PopupScreenWindows.Count; for (let i = 0; i < count; i++) { ui.PopupScreenWindows(0).Close(); }
I think this is also possible if in the OpenFaceplateInPopup system function, in the call input called Independent Window. Just put in False. Then the Popup automatically closes if the Parent is closed. So it works even in a screen change
Dear Hecht Thank you for sharing all these verry helpfull informations. This will help me to solve a lot of problems with multiple instances of faceplates.
Now that V18 is out, is there a smarter way to limit one popup per faceplate instance? Fetching the name of each faceplate using simulation and DevTools kind of defeats the purpose of using faceplate. It's a lot of manual work.
I am a complete amateur at script, this seems so complex, where is the best place to start learning? I can configure visualisation and plc code but javascript is making the common engineers life difficult. Any pointers in the right direction for education would be well received. Thankyou for your sharing your vast knowledge.
@DerHecht4.0 Thank you for your Video. I get started with Unified as well and try some things. I have the situation that I don't want when a Popup is open, the User can touch parts of the screen. Only the Faceplate in the Popup is able to edit. With opening the Faceplate in a Popup like you, I show as well on the Main screen on a higher Layer a gray Frame with the property visibility. That works well. But I can't make it reverse by closing the Popup. Do you have an idea how to handle with that?
hi, right now i have aprogram with 1 popup (parent) that can open some popups with extra info. how can i close all the child popups all togheter with the parent?
Amazing way to do that. I had reached a similar strategy but was not so useful. How did you find that method/property inside UI.PopupScreenWindows ->>?? This is like hidden it don't appear in auto-complete list and neither in Siemens documentation. Also you had to make a copy of the UI object in order to compile the solution...
Hi, I have find this info about the PopupScreenWindows in the Siemens Forum support.industry.siemens.com/forum/do/en/posts/wincc-unified-tip-s-for-faceplate/225140/?page=2&pageSize=10
I want to create an operating log file for the system. After a period of 10 minutes, the self-recorded data to the excel file is available (This file will also be updated automatically as daily), how many columns are recorded in the column, how many rows into the excel file I created. In this case I did on WinCC Professional using VBS code. Please help me with this problem, boss. Thank you very much !
@@dpibernat export function event_button_OnTapped(item, x, y, modifiers, trigger) { let ui = UI; //get the compiler to accept "UI." here //get the active screen dimensions (the screen where the event element is located) let SysHeight = ui.ActiveScreen.Height; let SysWidth = ui.ActiveScreen.Width; //other function(s) for the job: //let SysHeight = ui.GetClientInfo(UI.Enums.HmiClientInfoType.PrimaryDisplayWidth); //let SysWidth = ui.GetClientInfo(UI.Enums.HmiClientInfoType.PrimaryDisplayHeight); //RootDisplayHeight //calc center with the to-be-opened faceplate dimentions div. by 2 let Posleft = ((SysWidth / 2) - 405); let PosTop = ((SysHeight / 2) - 236); //open popup with disciption as popup window name and clac. position let Discription = Tags("UDT.ID").Read(); let po = Faceplate.OpenFaceplateInPopup("meas_trend_popup_V_0_0_01", Discription + " trend popup", true, false); po.Left = Posleft; //calc:ed center of the screen po.Top = PosTop; //calc:ed center of the screen po.Visible = true; } export function Button_open_trend_OnTapped(item, x, y, modifiers, trigger) { // Retrieve the motor ID from the HMI_motor_interface.status.ID tag. const id = Tags("HMI_motor_interface.status.ID").Read(); // Open the motor trend popup using the motor ID and set its visibility to true. const popup = Faceplate.OpenFaceplateInPopup("motor_trend_popup_V_0_0_4", id, false, { modal: false }); popup.Left = Faceplate.Width; popup.Top = -32; //popup top bar offset popup.Visible = true; }
Hello, little different topic.. But I cant figure It out. Access Object, property from local script is possible this way ......."Screen.Item("Recatngle_x").Visible = true;"..... question is how can I do similar thing but from global module script called for expample on different screen button event ?? is it different syntax, usage of FindItem, UI, or what ?? couse when I do so I get this error ......(,Module "Global module" referenced by the function list module contains an error: Script function "Function": Object member: UI not supported in current scope in line 17, at column 0 )..... Thank you very much....
Hey. You can use Screen.FindItem(). There is a very usefull page in Tia portal's Information system where it's explained very nicely. Search for this: "FindItem" method (UI.FindItem, ScreenInterface.FindItem, FaceplateInterface.FindItem)
to closed all PopUps add this script on the "cleared" event of the screen
let ui = UI;
let count = ui.PopupScreenWindows.Count;
for (let i = 0; i < count; i++) {
ui.PopupScreenWindows(0).Close();
}
I think this is also possible if in the OpenFaceplateInPopup system function, in the call input called Independent Window. Just put in False. Then the Popup automatically closes if the Parent is closed. So it works even in a screen change
Hello,
yes, that is possible. In my "real" UseCase the PopUps have to stay open after the screen change. I forgot to adjust it for the video
Dear Hecht
Thank you for sharing all these verry helpfull informations. This will help me to solve a lot of problems with multiple instances of faceplates.
Now that V18 is out, is there a smarter way to limit one popup per faceplate instance?
Fetching the name of each faceplate using simulation and DevTools kind of defeats the purpose of using faceplate. It's a lot of manual work.
Love it! Thank you 😊
I am a complete amateur at script, this seems so complex, where is the best place to start learning? I can configure visualisation and plc code but javascript is making the common engineers life difficult. Any pointers in the right direction for education would be well received. Thankyou for your sharing your vast knowledge.
and thanks, this script works great ;)
@DerHecht4.0 Thank you for your Video. I get started with Unified as well and try some things. I have the situation that I don't want when a Popup is open, the User can touch parts of the screen. Only the Faceplate in the Popup is able to edit. With opening the Faceplate in a Popup like you, I show as well on the Main screen on a higher Layer a gray Frame with the property visibility. That works well. But I can't make it reverse by closing the Popup. Do you have an idea how to handle with that?
hi, right now i have aprogram with 1 popup (parent) that can open some popups with extra info. how can i close all the child popups all togheter with the parent?
Amazing way to do that. I had reached a similar strategy but was not so useful. How did you find that method/property inside UI.PopupScreenWindows ->>?? This is like hidden it don't appear in auto-complete list and neither in Siemens documentation.
Also you had to make a copy of the UI object in order to compile the solution...
Hi,
I have find this info about the PopupScreenWindows in the Siemens Forum
support.industry.siemens.com/forum/do/en/posts/wincc-unified-tip-s-for-faceplate/225140/?page=2&pageSize=10
Your videos are great. Thanks!
Fan of Mr Fish !!! Thanks a lot... Is there a document somewhere that describes all the possibilities with the UI stuff ?
Hi Peter,
I don#t know a documentation of that UI stuff
I want to create an operating log file for the system.
After a period of 10 minutes, the self-recorded data to the excel file is available (This file will also be updated automatically as daily), how many columns are recorded in the column, how many rows into the excel file I created. In this case I did on WinCC Professional using VBS code. Please help me with this problem, boss. Thank you very much !
How to position the popup in the middle of the screen or check the popup is not outside of the screen?
Hello, did you solve this? I'm having the same problem
@@dpibernat
export function event_button_OnTapped(item, x, y, modifiers, trigger) {
let ui = UI; //get the compiler to accept "UI." here
//get the active screen dimensions (the screen where the event element is located)
let SysHeight = ui.ActiveScreen.Height;
let SysWidth = ui.ActiveScreen.Width;
//other function(s) for the job:
//let SysHeight = ui.GetClientInfo(UI.Enums.HmiClientInfoType.PrimaryDisplayWidth);
//let SysWidth = ui.GetClientInfo(UI.Enums.HmiClientInfoType.PrimaryDisplayHeight);
//RootDisplayHeight
//calc center with the to-be-opened faceplate dimentions div. by 2
let Posleft = ((SysWidth / 2) - 405);
let PosTop = ((SysHeight / 2) - 236);
//open popup with disciption as popup window name and clac. position
let Discription = Tags("UDT.ID").Read();
let po = Faceplate.OpenFaceplateInPopup("meas_trend_popup_V_0_0_01", Discription + " trend popup", true, false);
po.Left = Posleft; //calc:ed center of the screen
po.Top = PosTop; //calc:ed center of the screen
po.Visible = true;
}
export function Button_open_trend_OnTapped(item, x, y, modifiers, trigger) {
// Retrieve the motor ID from the HMI_motor_interface.status.ID tag.
const id = Tags("HMI_motor_interface.status.ID").Read();
// Open the motor trend popup using the motor ID and set its visibility to true.
const popup = Faceplate.OpenFaceplateInPopup("motor_trend_popup_V_0_0_4", id, false, { modal: false });
popup.Left = Faceplate.Width;
popup.Top = -32; //popup top bar offset
popup.Visible = true;
}
Nice, Danke!
Hello, little different topic.. But I cant figure It out.
Access Object, property from local script is possible this way ......."Screen.Item("Recatngle_x").Visible = true;".....
question is how can I do similar thing but from global module script called for expample on different screen button event ?? is it different syntax, usage of FindItem, UI, or what ??
couse when I do so I get this error ......(,Module "Global module" referenced by the function list module contains an error: Script function "Function": Object member: UI not supported in current scope in line 17, at column 0
).....
Thank you very much....
Hey. You can use Screen.FindItem(). There is a very usefull page in Tia portal's Information system where it's explained very nicely. Search for this: "FindItem" method (UI.FindItem, ScreenInterface.FindItem, FaceplateInterface.FindItem)
Hello Hecht, For I/O filed how to do it the display format Decimal with Decimal place 2 and Format pattern as 99999 in unified script ?
You can adapt the script from this video czcams.com/video/mBh61C7I0jE/video.html
@@DerHecht40 My case, tag format is Dint. so that how could I insert the "." decimal place in between ?
Hi, I don't see where you defind interface (tags and properties) before open popup....
Hi this is not needed, The Interface is handover from the Faceplate Instance when opening the PopUp
@@DerHecht40 Can I use only tags and properies from Faceplate instance or maybe is posible definde addtional tags and properties?
@@TadeuszZioo If you call a PopUp from a faceplate this is not possible
Doesn't appear to be working in V18...
Me neither...