WinCC Unified: Open Faceplate PopUp only once

Sdílet
Vložit
  • čas přidán 27. 08. 2024

Komentáře • 32

  • @DerHecht40
    @DerHecht40  Před 2 lety +2

    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();
    }

    • @arnaucapellgracia1415
      @arnaucapellgracia1415 Před 2 lety

      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

    • @DerHecht40
      @DerHecht40  Před 2 lety

      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

  • @michaelbrand7570
    @michaelbrand7570 Před 2 lety +5

    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.

  • @reparee
    @reparee Před rokem +1

    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.

  • @J0SENone
    @J0SENone Před 2 lety +1

    Love it! Thank you 😊

  • @MrMuz12345
    @MrMuz12345 Před rokem

    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.

  • @wesleyhaast2302
    @wesleyhaast2302 Před 3 měsíci

    and thanks, this script works great ;)

  • @michaelporzell8112
    @michaelporzell8112 Před rokem

    @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?

  • @wesleyhaast2302
    @wesleyhaast2302 Před 3 měsíci

    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?

  • @arnaucapellgracia1415
    @arnaucapellgracia1415 Před 2 lety +1

    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...

    • @DerHecht40
      @DerHecht40  Před 2 lety

      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

  • @jonathanvelasco3490
    @jonathanvelasco3490 Před rokem

    Your videos are great. Thanks!

  • @petervranks2723
    @petervranks2723 Před rokem

    Fan of Mr Fish !!! Thanks a lot... Is there a document somewhere that describes all the possibilities with the UI stuff ?

    • @DerHecht40
      @DerHecht40  Před rokem +1

      Hi Peter,
      I don#t know a documentation of that UI stuff

  • @PhucLe-dv4vr
    @PhucLe-dv4vr Před 2 lety

    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 !

  • @UrkkiTheMan
    @UrkkiTheMan Před rokem +1

    How to position the popup in the middle of the screen or check the popup is not outside of the screen?

    • @dpibernat
      @dpibernat Před 9 měsíci

      Hello, did you solve this? I'm having the same problem

    • @UrkkiTheMan
      @UrkkiTheMan Před 9 měsíci

      @@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;
      }

  • @andrei4311
    @andrei4311 Před rokem

    Nice, Danke!

  • @radoslavklein662
    @radoslavklein662 Před 2 lety

    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....

    • @filipkavcic664
      @filipkavcic664 Před 2 lety

      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)

  • @naveenramalalingam9885

    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 ?

    • @DerHecht40
      @DerHecht40  Před 2 lety +1

      You can adapt the script from this video czcams.com/video/mBh61C7I0jE/video.html

    • @naveenramalalingam9885
      @naveenramalalingam9885 Před 2 lety

      @@DerHecht40 My case, tag format is Dint. so that how could I insert the "." decimal place in between ?

  • @TadeuszZioo
    @TadeuszZioo Před rokem

    Hi, I don't see where you defind interface (tags and properties) before open popup....

    • @DerHecht40
      @DerHecht40  Před rokem

      Hi this is not needed, The Interface is handover from the Faceplate Instance when opening the PopUp

    • @TadeuszZioo
      @TadeuszZioo Před rokem

      @@DerHecht40 Can I use only tags and properies from Faceplate instance or maybe is posible definde addtional tags and properties?

    • @DerHecht40
      @DerHecht40  Před rokem

      @@TadeuszZioo If you call a PopUp from a faceplate this is not possible

  • @HelicalAutomation
    @HelicalAutomation Před 8 měsíci

    Doesn't appear to be working in V18...