The library kchWebServer provides a simple HTTP server for an external HTML Visu.
Data exchange is supported for files and CODESYS variables.
Syntax
PROGRAM KchWebServer
VAR_INPUT
wPort: WORD := 8100;
sUser : STRING;
sPassword : STRING;
xEnable : BOOL := TRUE;
END_VAR
Parameters
|
Parameter: |
Beschreibung: |
|
wPort |
HTTP Port |
|
sUser |
User Name for HTTP Authentication |
|
sPassword |
Password for HTTP authentication |
|
xEnable |
Switching the service on/off |
Example
KchWebServer(wPort := 8100, xEnable := TRUE, sUser := 'user', sPassword := 'pass');
Requirements
Remarks
-
CODESYS variables are released with the symbol configuration for the kchWebServer.
-
Global settings (GVL_KCHWEBSERVER):sDefaultFile: File used if none is specified in the URL (Default: index.html)sUploadDir: server directory (Default: CODESYS Visu directory)iDebugLevel: Debug level in the CODESYS Log (Default: LOG_TYPE.ERROR)
-
Supported HTTP calls:<ip>:<port>/vars, Listing of all symbol variables as XML content<ip>:<port>/cmd, Shell command, StdOut back as Text Content<ip>:<port>/readvar:<symbolvariable>, Returns variable value as text content<ip>:<port>/readvarlist:<var1;var2;>, Returns variable values as a list<ip>:<port>/writevar:<symbolvariable>=<value>, Writes new variable value, no content as return value.Files GET
-
the documentation and a example are on the ftp server.