Cicode Programming Reference > Cicode Function Categories > Cluster Functions Introduction > ClusterSetName

ClusterSetName

ClusterSetName is deprecated in this version of CitectSCADA.

Syntax

ClusterSetName(sPrimary, sStandby, nMode)

sPrimary:

The name of the cluster's primary server (Reports Server, Alarms Server etc.), as defined using the Computer Setup Wizard. When the ClusterSetName() function is used, CitectSCADA will attempt to connect to this server.

sStandby:

The name of the cluster's standby server (Reports Server, Alarms Server etc.), as defined using the Computer Setup Wizard. If the sPrimary server is unavailable when the ClusterSetName() function is used, CitectSCADA will attempt to connect to this server.

If there is no standby server, enter an empty string for sStandby.

nMode:

The mode of the connection:

0 - If you select this mode, CitectSCADA will renew the last connection. If it was connected to the sPrimary server, when this function was last used, it will attempt to connect to it again. If it was last connected to the sStandby server, it will attempt to connect to it again.

This mode is useful when a server is known to be unavailable, as it facilitates faster cluster switching.

1 - CitectSCADA will attempt to connect to the sPrimary server first, each time this function is used. If the sPrimary server is unavailable, CitectSCADA will try the sStandby server.

Return Value

0 (zero) if successful, otherwise an error is returned.

Related Functions

ClusterActivate, ClusterDeactivate, ClusterFirst, ClusterGetName, ClusterIsActive, ClusterNext, ClusterServerTypes, ClusterStatus, ClusterSwapActive, TaskCluster

Example

// Connect to Cluster A, with server CITECTA1 as primary server, 
and CITECTA2 as standby.//
ClusterSetName("CITECTA1", "CITECTA2", 0);
// Display the menu page for Cluster A Project.//
PageDisplay("MenuA");

See Also

Cluster Functions

About cluster context