Using the Web Server block in a diagram

A sample diagram — WebTest05 — with a Web Server block is included under Examples > Embedded > CortexM3 > Webserver.

The Web Server block is treated like any other block in the Embed diagram. It takes input values and supplies output values. The Web Server block operates asynchronously: it posts its input data to the page but does not wait for a response. The output data it provides on the output connector pins is the contents of the local buffer from the last asynchronous data received from the page.

In the sample diagram above, connectors are color coded to data type:

Green: integer

Purple: string

Red: floating point

The diagram generates some simple data merely to exercise the control on the web page.

M3 web inputs and outputs are:

      Mode: a string that updates dynamically.

      in: an edit display that shows the integer numeric value of the square wave input.

      Speed (meter): identical to Speed (plot) and is a sin squared to produce a value varying between 0 and 1 scaled by the Speed Cmd slider output and a gain of two.

      LED: a check box with value 0 or 1. This is connected to GPIO PC6 which is wired to an LED on the CortexM3 Control card. This lets you turn the LED on and off from the web page.

      out: represents the floating-point value entered into the Out control on the web page. It is not used in this sample diagram.

When you compile the diagram, the web page below is automatically generated. Using the web page, you can observe and control your application on the target board.