Recalling Last Association in Plant SCADA 2023 R2

hi, i have a page that has four buttons that associates different tags in the same page, and this page have a main button in the footer that opens it, but i want the page to recall the last association when i press on the main footer button, can anyone help with this?

Parents
  • If you're just associating a different tag with the current page, you have to re-display the page with the PageDisplay() function for the new associations to take effect. Here's a clip from the help:

    Ass(hWin, nArg, sTag, nMode [, sClusterName] )

    hWin:

    The association will be created for the next Super Genie to display in the window specified here; enter the window number or:

    -3 - for the current window when the page is changed. The page can be changed by using the Page Cicode functions like PageDisplay, PageGoto, etc.

  • For my understanding, all buttons will do tag association with the current window. So, you may consider using

    • PageSetInt 
    • PageSetStr
    • PageGetInt
    • PageGetStr

    to cache these nArg, sTag, nMode and sCluster parameters. You need to have 2 sets of page variables to cache data, Previous and Current. When any of 4 buttons is clicked, you compare those parameters with Current and swap the cache data before Association. Here is logic 

    IF New <> Current THEN
        Previous = Current
        Current = New
    END

    The main button will do Association with the Previous set of parameters. Hope this would help.

Reply
  • For my understanding, all buttons will do tag association with the current window. So, you may consider using

    • PageSetInt 
    • PageSetStr
    • PageGetInt
    • PageGetStr

    to cache these nArg, sTag, nMode and sCluster parameters. You need to have 2 sets of page variables to cache data, Previous and Current. When any of 4 buttons is clicked, you compare those parameters with Current and swap the cache data before Association. Here is logic 

    IF New <> Current THEN
        Previous = Current
        Current = New
    END

    The main button will do Association with the Previous set of parameters. Hope this would help.

Children