Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

ServerInfoEx

  • Last UpdatedFeb 02, 2024
  • 6 minute read

Gets status information on clients and servers from a specified component in a multiprocess runtime environment.

This function is a blocking function. It blocks the calling Cicode task until the operation is complete.

When this function is called, the system redirects the call to the process that contains the specified component. If the specified component is in the calling process, the call is not redirected. If the specified component is not one of the servers listed in the sComponent argument description (see below), of if the system cannot find the component from the connected local processes, a hardware alarm is raised.

Syntax

STRING ServerInfoEx(STRING Name, INT Type, STRING Component [, STRING ClusterName] [, STRING ServerName] )

Name:

The name of the client or server, either "Client", "Server", "Alarm", "Trend", or "Report".

You can also pass a number instead of the name (but it still needs to be enclosed in quotes). The number represents the target client. For example, if there are 12 clients, passing "3" will get information on the 4th client.

If this server is an Alarm, Trend, Report, and I/O server then each client will be attached 4 times. So 12 clients would mean there are 3 Plant SCADA computers using this server - one of which is itself.

Type:

The type of information required (depends on the Name you specify):

When Name is set to "Alarm", "Trend", or "Report":

0 - Active flag (returns 1 if this is the active server, 0 if an inactive server).

When an alarm server is active, it writes entries to the alarm log device(s). However, this alarm server may not be the 'Main' alarm server. The 'Main' alarm server stores data in the primary archive used for displaying the 'Sequence of Events' and 'Summary' pages. Currently an alarm server may be 'active' for the log devices, but 'standby' for the primary archive.

Trend server redundancy does not have the concept of "active". For trend servers, Type=0 will return 1 if the process is running on the computer defined as "Primary", and zero (0) if the process is running on the machine defined as "Secondary".

1 - Number of clients attached to this server.

2 - If this client is attached to the primary or standby server for the specified server name. If Name is "Alarm" and if this client is attached to the primary alarm server, the return value is 0. If this client is attached to the standby, the return value is 1.

If the Component is "IOServer" and the Name is "Client", Types 1 and 2 return an empty string, as the concept of primary and standby servers does not apply to I/O servers.

3 - The status of the client connection to the specified server name. If Name is "Report" and the client is talking to a report server (either primary or standby), the return value is 1. If not, the return value is 0.

Since v7.30, the Client connection to the alarm server is not permanently maintained, and is reopened for each new user. The client connection to the trend servers is permanent, and is not affected by the new user login process.

4 - Alarm DB Status for the alarm server. Returns 1 if initializing, 2 if main, 3 if standby and 4 if invalid.

If Name is set to "Client"

0 - The computer name, as specified by [LAN]Node.

1 - The primary server name, as specified in the server configuration settings.

2 - The secondary server name, as specified , as specified in the server configuration settings.

3 - The name of the INI file being used, for example, Citect.INI.

If Name is set to "Server":

0 - The server name, as specified in the server configuration settings.

1 - The number of clients attached to this server. This is the total number of Alarm, Trend Report, and I/O server clients.

If Name uses an ordinal option "<number>":

0 - The name of the server this client is talking to. For example, "Alarm", "Trend", "Report", or "IOServer".

1 - The login name of the client. This may be an empty string if the client has not logged in.

2 - The Plant SCADA computer name of the client computer.

3 - The time the client logged in.

4 - The number of messages received from this client.

5 - The number of messages sent to this client.

6 - Determines the licensing relationship between the target client (specified by "<number>") and the server (specified by Component). '0' indicates there is no licensing relationship, '1' indicates the server has provided the target client with a license, '2' indicates the server received a license from the target client (acting as the license server). If the server is running in multi-process mode, you will need to iterate through all the server processes on the computer using mode 6 to detect if a license is being issued from that computer.

7 - The type of the licence; full licence (0), View-only Client (1), or Control Client (2). If the client has not obtained a license from the listed server component (i.e. ServerInfoEx mode 6 has returned 0), then this will not be defined and always return 0.

8 - If the client is remote (1) or local (0). "Remote" means the client is not in the same process as the server. For example, the client could be in another process on the same computer as the server, or even on another computer. "Local" means the client is in the same process as the server.

Be aware that ServerInfoEx has been enhanced so that when using the ordinal option (Name is "<number>") the number representing Type can be supplied in a 100-based format so that all connections between server and client will be considered in evaluating that type. Not using 100-based format may mean only a subset of connections will be evaluated.

For example, using Type 106 will search all connections to determine whether the client has a licence from the server, whereas using 6 will ignore some connections.

Please note the enhanced 100-based format should be used with v8.30 or above to avoid missing connections. Do not mix the enhanced 100-based mode with the normal mode. For example, if your Cicode uses mode 106 rather than 6 to query whether the client has a licence from the server, then it should use 107 rather than 7 to enquire about the type of licence.

Component:

Specifies the component name from which to retrieve the status information:

" "- An empty string causes the function to run on the calling process.

• "Alarm" - Redirects the function to the alarm server process.

• "Trend" - Redirects the function to the trend server process.

• "Report" - Redirects the function to the report server process.

• "IOServer" - Redirects the function to the I/O server process.

If Name is "Client", the function will not be redirected to the component specified by Component. Instead, the function gets information of type Type from the current client connection to the component specified by Component.

ClusterName:

The name of the cluster that the server belongs to. This is only relevant if:

The Name is "alarm", "report", or "trend"; AND

The type of information required, nType, is 2 or 3.

ServerName:

Specifies the name of the the I/O Server. This parameter is only required if you are running more than one I/O server process from the same cluster on the same computer and need to instruct the system which process to redirect to. The argument is enclosed in quotation marks "".

Return Value

Status information specified by nType.

ServerGetProperty, ServerInfo, ServerIsOnline, ServerReload, ServerRestart

Example

This example gets the server information from the report process.

sSrvInfo=ServerInfoEx("Report",0, "Report");

IF sSrvInfo THEN

! This is a primary report server.

ELSE

! This is a stand-by report server.

END

/* Get and store the names of clients attached to the report server */

iCount = 1;

iClients = ServerInfoEx("Server", 1, "Report");

WHILE iCount <= iClients DO

sName[iCount] = ServerInfoEx(IntToStr(iCount), 2, "Report");

iCount = iCount + 1;

END

See Also

Server Functions

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in