Promotic

AddServer - method of the PmgTrendViewer object

Description:
Registeration of the server to the viewer.
The local server (the viewer is in the same application as the server) needn't be located by calling this method, it is always located automatically by the viewer if it is accessible.
Syntax:
Empty AddServer(String sID, String sPurpose, String sTitle, String sAddress, [String sUser], [String sPassword])
Parameters:
sID(String) Must be empty string "" (reserved for the identifier of the trend server) must be entered obligatorily
sPurpose(String) One of the two possible values must be entred.
"pmtrendserver" - Registeration of the server into the server list in the viewer.
This list of accessible servers is then displayed if the user dynamically adds new trend to the viewer in runtime.
See methods for displaying the configuration of trends in the viewer: DlgTrends, tvTrend.DlgProperties.
"cfg" - Configuration server registration for this trend viewer.
When calling the LoadCfg method with the sCfg="input:xxx" parameter, the configuration groups transferred from this server are added into the group configuration window.
sTitle(String) User name of the server. This text is displayed to the user.
sAddress(String) Server address. The same text as the vServer parameter of the tvTrend.Connect method. For example "http://computer/syst/trend/local".
sUser[optional] (String) Authorized user. Enter only if the server requires the authentication of the permissions. See the "PmaTrendGroup > Permissions" tab.
sPassword[optional] (String) User password. Enter only if the server requires the authentication of the permissions.
Note:
This method is also functional in Web panels.
Example:
JavaScriptVBScriptSelect and copy to clipboard

var oTView = pMe.Items("../TrendView");
// Access needn't be authenticated
oTView.AddServer("", "pmtrendserver", "MySrv", "http://192.168.1.34/syst/trend/local");
// Access must be authenticated
oTView.AddServer("", "pmtrendserver", "MySrv", "http://192.168.1.34/syst/trend/local", "admin", "password");
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.