Clusters in Menu

Maybe I'm just having a brain cramp here.

Ran into a situation where I need different pages on the menu depending which cluster I am in.

I put an "IF" statement in the menu command line, which works fine as long as I don't change clusters.

With an unclustered reference, the tag value remains with the first cluster after the project has been started up.

How do I get the tag to follow the current cluster?


A little further information - page changes between software revisions - I am trying to avoid having to load a new project every time the project revision changes.  A tag in the PLC contains the revision number.

Parents
  • Hi Mike,

    I tried this out and also found that tags with no cluster prefix in menu commands do not use the cluster context of the current page. TaskCluster() didn't return anything when called from a menu command. However, PageInfo(26) did correctly return the cluster.

    I used PageDisplay("pagename","clustername") to switch the cluster context on the page to a different cluster and PageInfo() still worked in the menu command.

    So, I tried TagRead("tagname", 0, PageInfo(26)) from a menu command and it correctly read the tag. Could you use a command like PageDisplay("pagename_" + TagRead("VerNo", 0, PageInfo(26)):#)

    If that's not what you're trying to do, could you give us more information?

    What version of Citect is it? I tested in 2018R2, but I would expect the same operation in v7 and v8.

    How are you changing clusters? Are you specifying the cluster in the PageDisplay() command, in the page properties (Cluster Context), inheriting from the previous page, or another method?

    Can you share an example of your menu command? I wasn't clear if you were using the page, hidden, or cluster fields or just the Level and Command fields.
Reply
  • Hi Mike,

    I tried this out and also found that tags with no cluster prefix in menu commands do not use the cluster context of the current page. TaskCluster() didn't return anything when called from a menu command. However, PageInfo(26) did correctly return the cluster.

    I used PageDisplay("pagename","clustername") to switch the cluster context on the page to a different cluster and PageInfo() still worked in the menu command.

    So, I tried TagRead("tagname", 0, PageInfo(26)) from a menu command and it correctly read the tag. Could you use a command like PageDisplay("pagename_" + TagRead("VerNo", 0, PageInfo(26)):#)

    If that's not what you're trying to do, could you give us more information?

    What version of Citect is it? I tested in 2018R2, but I would expect the same operation in v7 and v8.

    How are you changing clusters? Are you specifying the cluster in the PageDisplay() command, in the page properties (Cluster Context), inheriting from the previous page, or another method?

    Can you share an example of your menu command? I wasn't clear if you were using the page, hidden, or cluster fields or just the Level and Command fields.
Children
No Data