Component: Webserver (GENERIC ROM FAT) (Comms: Networking)

From Flowcode Help
Revision as of 09:28, 16 October 2020 by BenR (talk | contribs) (→‎Webserver Dynamic Files)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


Author Matrix Ltd.
Version 1.4 (Release)
Category Comms: Networking


Image Webserver (GENERIC _ ROM FAT) component

Webserver component designed to work with Network Comms abstraction layer. Provides a very simple interface to allow webpages to be hosted from hardware or simulation. Webpages can be embedded into ROM or can be pulled directly from an SD card using the FAT component.

Examples

Webserver Embedded Files

A simple example demonstrating how to host a website with fixed HTTP content including dynamic sections that can be passed in and out of Flowcode SCADA.

For example a dynamic section could be used to display a variable value on a webpage such as a temperature or used to control Flowcode e.g. turn on an output.

FC6 Icon.png Webserver Embedded


Webserver Dynamic Files

Flowcode Embedded

A simple example demonstrating how to host a website with dynamic content based on external files including dynamic sections that can be passed in and out of an embedded system using an SD card and an ESP8266 module.

For example a dynamic section could be used to display a variable value on a webpage such as a temperature or used to control Flowcode e.g. turn on an output.

FC6 Icon.png ESP8266 Webserver FileSystem

ZIP Icon.png Webserver Files


Flowcode SCADA

A simple example demonstrating how to host a website with dynamic content based on external files including dynamic sections that can be passed in and out of Flowcode SCADA.

For example a dynamic section could be used to display a variable value on a webpage such as a temperature or used to control Flowcode e.g. turn on an output.

FC6 Icon.png Webserver FileSystem

ZIP Icon.png Webserver Files

Downloadable macro reference

SetOutValue

Set the value of an outbound substitution string

Parameters

BYTE index
<- STRING value
This parameter may be returned back to the caller


Return value

This call does not return a value


GetInValue

Returns the string value of a Request parameter

Parameters

BYTE index


Return value

STRING


CreateServerSocket

Creates a listening socket on the selected port ready to accept incoming web page requests.

Returns: 1 = OK / 0 = Listen Err / 255 = Socket Open Err

Parameters

UINT Port
Default HTTP port = 80


Return value

BYTE


CheckSocketActivity

Checks for activity on the server socket and serves out the webpages to any requesting parties.

Parameters

This macro has no parameters


Return value

BYTE


Initialise

Resets and initialises the Web Server component.

Parameters

This macro has no parameters


Return value

This call does not return a value


Simulation macro reference

This component does not contain any simulation macros


Property reference

Label

This property is of type Line of text and can be referenced with the variable name label.

Label used to help identify the component on the panel.

RX Buffer Size

This property is of type Unsigned integer and can be referenced with the variable name RXBuffSize.

No additional information


Network Comms Component

This property is of type Panel object and can be referenced with the variable name Component.

Redirects communications via the selected component allowing different TCP/IP modules with different macros to work.

HTML Source

This property is of type Fixed list of ints and can be referenced with the variable name html_source.

Sets the method for streaming data, we can either host it loacally using a property or refer to external files.

Max Pages

This property is of type Signed integer and can be referenced with the variable name max_pages.

Maximum number of pages we can serve using the embedded page type webserver.

Currently limited to 4 pages.

Name Page 1

This property is of type Line of text and can be referenced with the variable name name1.

Name of HTML page 1 - index.htm is the default page that will be presented.

HTML Page 1

This property is of type Multiple lines of text and can be referenced with the variable name html1.

Embedded HTML code used for page 1

Name Page 2

This property is of type Line of text and can be referenced with the variable name name2.

Name of HTML page 2

HTML Page 2

This property is of type Multiple lines of text and can be referenced with the variable name html2.

Embedded HTML code used for page 2

Count

This property is of type Fixed list of ints and can be referenced with the variable name Outgoing_Count.

Maximum number of outbound string substitutions

Length 0

This property is of type Unsigned integer and can be referenced with the variable name Out_Len_0.

Number of bytes to reserve for data string.

Count

This property is of type Fixed list of ints and can be referenced with the variable name Incoming_Count.

Maximum number of inbound string substitutions

Length 0

This property is of type Unsigned integer and can be referenced with the variable name In_Len_0.

Number of bytes to reserve for data string.

.BMP

This property is of type True or false and can be referenced with the variable name BMP.

Decides if the specified file type is supported by the server

.GIF

This property is of type True or false and can be referenced with the variable name GIF.

Decides if the specified file type is supported by the server

.JPG

This property is of type True or false and can be referenced with the variable name JPG.

Decides if the specified file type is supported by the server

.PNG

This property is of type True or false and can be referenced with the variable name PNG.

Decides if the specified file type is supported by the server

.ICO

This property is of type True or false and can be referenced with the variable name ICO.

Decides if the specified file type is supported by the server

.CSS

This property is of type True or false and can be referenced with the variable name CSS.

Decides if the specified file type is supported by the server

.CSV

This property is of type True or false and can be referenced with the variable name CSV.

Decides if the specified file type is supported by the server

.TXT

This property is of type True or false and can be referenced with the variable name TXT.

Decides if the specified file type is supported by the server

.JS

This property is of type True or false and can be referenced with the variable name JS.

Decides if the specified file type is supported by the server

.JAR

This property is of type True or false and can be referenced with the variable name JAR.

Decides if the specified file type is supported by the server

.JSON

This property is of type True or false and can be referenced with the variable name JSON.

Decides if the specified file type is supported by the server

.PDF

This property is of type True or false and can be referenced with the variable name PDF.

Decides if the specified file type is supported by the server

.XML

This property is of type True or false and can be referenced with the variable name XML.

Decides if the specified file type is supported by the server

.RAR

This property is of type True or false and can be referenced with the variable name RAR.

Decides if the specified file type is supported by the server

.ZIP

This property is of type True or false and can be referenced with the variable name ZIP.

Decides if the specified file type is supported by the server

.TTF

This property is of type True or false and can be referenced with the variable name TTF.

Decides if the specified file type is supported by the server