This function can only be called for Alarm, Report and Trend Servers and reloads the server specified by cluster and server name. If the server is not found an error is returned. ServerReload can be used in blocking or non-blocking modes using the bSync parameter. When used in non-blocking mode, the server status can be returned using the ServerGetProperty function.
For this function to be successful you need to set the [LAN]AllowRemoteReload parameter in the Citect.ini file to "1".
It is recommended that the ServerGetProperty cicode function be used with the LibRDBMemTime and LibRDBDiskTime properties to check if there is a change to the Cicode library before attempting a reload. Following a reload please check the corresponding server's syslog.dat file for any reload messages. The cicode changes will not be reloaded, therefore a restart may be more appropriate.
UNINTENDED EQUIPMENT OPERATION
Restart the server process if a "Cicode library timestamp differs" error is detected. A library mismatch is indicated on the server in either the hardware alarm or the server's syslog.dat file.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
Note: A message in the Syslog.dat file and hardware alarm of "Cicode library timestamp differs" (error code 454) will be raised if the Cicode library used by one or more server runtime databases is different from the one in memory. The timestamps will be different if the project has been fully recompiled (with or without Cicode modification), or if the project has been incrementally recompiled after any Cicode has been modified.
ServerReload(sServer [, sCluster] [, bSync] )
The name of the server to be reloaded in quotations marks "". Can be prefixed by the name of the host cluster, that is "ClusterName.ServerName".
The cluster of the server to be reloaded in quotation marks "". This parameter is optional. However, if the server name is not local or not specified in ClusterName.ServerName format, an error is returned.
Specifies whether the function operates in blocking or non-blocking mode. If bSync is set to 1, the function will not return until the server reload is complete. The reload is complete when all the records of all rdb files have been processed and updated. Blocking mode cannot be used from a foreground task (for example on graphic pages). When bSync is set to 0, the function operates in non-blocking mode. You can get the latest status of the reload using the ServerGetProperty function. Default value is 0.
0 (zero) if the function was successful. Returns an error if unsuccessful.Outline of errors:
418 - Server is not found or if the client is not allowed to visit the cluster described in “sCluster”.
281 - Server is sitting on a remote machine to the client and the connection towards the server is not available.
519 - Server connection was available but interrupted.
451 - Server is busy with previous load request.
ServerGetProperty, ServerInfo, ServerInfoEx, ServerIsOnline, ServerRestart
ServerReload("AlarmServer1", "Cluster1", 0);