Using CitectSCADA > Implementing Clustering > Assigning tags to a cluster at Runtime

Assigning tags to a cluster at Runtime

CitectSCADA includes functionality that allows you to assign the tags on a page to a specific cluster during Runtime.

If the tags on a page exist within a number of different clusters, you can use Cicode to pass a cluster name to the page as it opens. Any tags that do not have a cluster explicitly defined will then be assigned to the specified cluster as the page is launched.

This provides a practical solution for a replicated system, where your project controls a number or identical sites or production lines. As the sites contain the same equipment, the tags representing the hardware architecture will potentially be the same for each. The ability to pass a cluster name to a page at runtime means just a single mimic page is necessary to represent multiple sites, reducing configuration time and simplifying project deployment.

For example, a menu page could be created to launch the mimic page for three identical production lines, each based on the same page called "ProductionLine".

To achieve this, you would use the PageDisplay function to configure the following buttons on your menu page:

Button one

Text

Production Line A

Command

PageDisplay("ProductionLine","Cluster_A")

Comment

Display the mimic page in the context of production line A

Button two

Text

Production Line B

Command

PageDisplay("ProductionLine","Cluster_B")

Comment

Display the mimic page in the context of production line B

Button three

Text

Production Line C

Command

PageDisplay("ProductionLine","Cluster_C")

Comment

Display the mimic page in the context of production line C

In each case, PageDisplay would pass the name of the host cluster to the page, depending on which button is selected. As each production line shares a common architecture, any tags that do not have a cluster explicitly defined will be assigned to the specified cluster as the page is opened.

This functionality is supported by the following Cicode functions:

You can also use the PageInfo function to determine the cluster context that has been set for a page.

This functionality extends to any Cicode that may be called from a graphics page. You can write Cicode that only specifies variable tag names, allowing the cluster to be defined by the current context of the page from which it is launched.

If the Cicode is executed by the function TaskNew, you have the option to specify a cluster by setting the ClusterName parameter.

Note: The cluster context for Cicode cannot be changed once the code is running.