SetWebConfig
- Last UpdatedOct 29, 2026
- 3 minute read
Configures the Web settings for the current project. The settings configured in the function are updated on the HTML files of the project.
|
Function |
Group |
Execution |
String Exp. |
Windows |
Windows Embedded |
IoT View |
Thin Clients |
Mobile Access |
|---|---|---|---|---|---|---|---|---|
|
SetWebConfig |
System Info |
Synchronous |
No |
Supported |
Supported |
Not supported |
Executed on Server |
Executed on Server |
Syntax
SetWebConfig( strServerIP, optStrBackupURL, optStrPathFile, optNumHostPort, optStrSecondaryServerIP, optNumProtocolFlag, optNumGtwPort, optStrGtwIP, optStrSecondaryGtwIP, optStrISSymbolURL )
strServerIP
Data Server IP Address. IP address (or hostname) of the computer where the project runtime server is running.
optStrBackupURL
Optional alternative URL for the project's Web pages. The Thin Client will look for the Web pages in this URL if it does not find them in the same URL written in the Address field of the Web browser.
optStrPathFile
Optional file path and name of the HTML file to be updated. If you specify only the file path without a file name, then all of the HTML files in the specified file path will be updated.
Note: You can specify an individual file (for example, you only want to update one file). This is especially useful for projects running on Windows Embedded target systems.
Note: Follow the conventions of the target platform for the file path and name, and separators. For example, a file path in Windows starts with a drive letter and uses backward slashes as separators (C:\path\to\file), while a file path in Linux starts at the root directory and uses forward slashes as separators (/path/to/file).
optNumHostPort
Optional TCP Port number that the Thin Client must use to exchange data with the project runtime server.
optStrSecondaryServerIP
Optional alternative data server IP address. The Thin Client will attempt to connect to the server at this IP Address if it is not able to connect to the server running in the IP Address specified in the strServerIP parameter.
optNumProtocolFlag
Optional When you use the Web Tunneling Gateway option, this parameter specifies whether the Thin Client will use either HTTP to exchange data with the Web Server or HTTPS (SSL – Secure Socket Layer). If this flag has the value 0, the Thin Client will use HTTP. If this flag has the value 1, the Thin Client will use HTTPS (SSL).
optNumGtwPort
Optional TCP Port number that the Thin Client must use to exchange data with the Web Server when using the Web Tunneling Gateway.
optStrGtwIP
Optional IP Address (or hostname) of the computer where the Web Tunneling Gateway is running.
optStrSecondaryGtwIP
Optional Alternative IP Address (or hostname) of the computer where the Web Tunneling Gateway is running. The Thin Client will attempt to connect to the Web Tunneling Gateway in this IP Address if it is not able to connect to the Web Tunneling Gateway running in the IP Address specified in the optStrGtwIP parameter.
optStrISSymbolURL
Optional URL from where the updated version of ISSymbol (ActiveX control) must be downloaded if it is not properly registered in the Thin Client station.
Return value
This function returns one of the following possible values:
|
Value |
Description |
|---|---|
|
0 |
No error |
|
1 |
Invalid number of parameters |
|
2 |
Invalid Server IP address 1 |
|
3 |
Invalid URL |
|
4 |
Invalid optional path |
|
5 |
No Web pages found |
Notes
You can use tags or expressions as arguments of this function. Therefore, you can use this function to configure the web settings automatically during runtime, according to the network settings of each project (IP address, Web Server URL, and so forth).
Only the first parameter of this function (strServerIP) is mandatory. All other parameters are optional. The parameters that are not configured in the function assume the default value configured in the Web tab of Project Settings.
The following parameters should be omitted unless you intend to use the Web Tunneling Gateway: optNumProtocolFlag, optNumGtwPort, optStrGtwIP, optStrSecondaryGtwIP, and optStrISSymbolURL.
Examples
SetWebConfig( "192.168.1.28" )
SetWebConfig( "192.168.1.28", "http://192.168.1.28/" )
SetWebConfig( GetComputerIP(), "http://" + GetComputerIP() + "/" )
SetWebConfig( "192.168.1.28", "http://192.168.1.28/", "C:\MyWebPages\" )
SetWebConfig( "192.168.1.28", "http://192.168.1.28/", "C:\MyWebPages\", 1234 )
SetWebConfig( "192.168.1.28", "http://200.0.0.10/", "C:\MyWebPages\", 1234, "192.168.1.29", 0, 80, "200.0.0.1", "200.0.0.10", "http://200.0.0.10/MyISSymbol/" )