Is it possible to change the port number of the web server on the PCD?

FAQ #100759

On the PCD1.M2, PCD3 and PCD2.M5 CPU's it's possible to change the TCP port number of the S-Web server by the use of the PG5 2.0 Device Configurator.

 

The far easiest way to configure the TCP port of the S-WebServer of a PCD is using the Device Configurator of PG5 2.0 (SP1 or later, when using PCD firmware 1.14.23 or later), see FAQ 101464.

Changing the port without the Device Configurator (no longer recommended)
In case your PCD can not be updated to firmware 1.14.xx, it is possible to change different Web-Server settings with the use of a configuration file called "WebSocketConfig.txt".

This configuration file can be created and downloaded in the PCD to specially configure the WEB-Server of the PLC.

This configuration file shall be named "WEBSocketConfig.txt" (case insensitive) and it shall be located either in

  • INTFLASH:/Config (Internal FLASH device not available on all CPU's)
  • WEB:/WEBPAGES (Built-in file system created with files which are included in the Web-Builder)
  • M1_FLASH:/Config (FLASH device in M1 slot of the extension)
  • M2_FLASH:/Config (FLASH device in M2 slot of the extension)
  • SL0FLASH:/Config (FLASH device in slot #0 of IO Bus)
  • SL1FLASH:/Config (FLASH device in slot #1 of IO Bus)
  • SL2FLASH:/Config (FLASH device in slot #2 of IO Bus)
  • SL3FLASH:/Config (FLASH device in slot #3 of IO Bus)

It is searched at boot time only in one of these directories (in the order given above with Firmware 1.08.23 or higher) and if found, it is parsed.
With firmwares <=1.08.23 the search order was:

  • M2_FLASH:/Config (FLASH device in M2 slot of the extension)
  • WEB:/WEBPAGES (Built-in file system created with files which are included in the Web-Builder)
  • M1_FLASH:/Config (FLASH device in M1 slot of the extension)
  • SL0FLASH:/Config (FLASH device in slot #0 of IO Bus)
  • SL1FLASH:/Config (FLASH device in slot #1 of IO Bus)
  • SL2FLASH:/Config (FLASH device in slot #2 of IO Bus)
  • SL3FLASH:/Config (FLASH device in slot #3 of IO Bus)

For the xxxFLASH file system, the file is downloaded using the FTP-Server (and the currently used parameters), whereas in the WEB file system, it is loaded using DB / DBx as part of the PLC user program (valid for xx7 AND Classic PLC) by the use of the Web-Builder tool.
Downloaded parameters will be taken into account at next power OFF / ON sequence.

The configuration file overwrites the default preferences of the WEB-Server.
You will find a template of the WEBSocketConfig.txt file on the download section.

Direct = on
Timeout = 3000
Listener = 16
Port = 80
PrioPort = 90
KeepAlive = 8
KeepAliveTimeout = 10000
KeepAliveStrict = off
KeepAliveRequests = 2000
NoTimeWait = off
Figure 1 WEBSocketConfig.txt file example

The sign “=” in the configuration file can be suppressed, e.g. Direct on

Keyword
Arguments
Description
Direct
on / off
By defining the Direct directive you can deactivate Http Direct on the PCD (default:on).
Timeout
10 - 10000
The reception and send time out in ms. When reading or writing is not successful after this time, the connection is reset (default:1000).
Listener
4 - 24
The number of maximum waiting connections without processing them (default:12).
Example: 12 web browser opened simultaneously to the PCD. All will wait for a response but a 13th will be disconnected without waiting.
Port
1 - 65536
The tcp port the web server is listening on (default:80).
KeepAlive
0 - 16
The number of permanent connections (default:8). The client browser always uses the same connection when it supports the Http Keep Alive feature. Zero indicates that no permanent connections are made and strict mode is off.
KeepAliveTimeout
1000 - 60000
Last access time out in ms. If this time elapses without access, the connection is not kept alive anymore (default:2000).
KeepAliveStrict
on / off
In strict mode the number of permanent connections is absolute. No additional connection will be accepted. In normal mode the last connection is always toggling and every waiting request will be processed, sharing the resources available (default:on).
KeepAliveRequests
0-10000
The numbers of requests which can be executed on the same keep alive session. After this the connection is closed and reopened.
Zero indicates that the session is kept alive until a time out (default:0)..
NoTimeWait
on / off
This option disables the wait state of the TCP protocol. By default the wait state is enabled (default:off).
If a client is used which does one shot requests (closes all socket immediately ) – use this option to prevent web server to run out of sockets.
PrioPort
1-65536
Additionally to the default port configuration a priority socket port is activated on start-up. The request load is distributed 50:50 to each port.
This option allows to configure on which port the priority port is listening (default:81).

Categories

Tips for SBC internals / http-direct

Last update: 23.05.2015 19:50

First release: 14.09.2007 11:52

Views: 32493

The requested software / document is no longer marketed by Saia-Burgess Controls AG and without technical support. It is an older software version which can be operated only on certain now no longer commercially available products.

Download