Difference between revisions of "Internet Application Guide"

From Flowcode Help
Jump to navigationJump to search
Line 49: Line 49:
  
  
== Example 1: ==
+
== Example 1: Embedded web server with dynamic content ==
  
{{Fcfile|Apps_Internet_Ex1.fcfx| Example}}
+
{{Fcfile|Apps_Internet_Ex1_Webserver.fcfx| Embedded Web Server Example}}
  
Example 1
+
Example 1 demonstrates use of the Flowcode Webserver component. The server is initialised and then the program enters a infinite loop where the value of the switch E-Block is read into variable BOO1 and subsequently viewed in a browser. The CheckSocketActivity macro function must be called as part of the main program loop as this allows remote page requests to be detected and serviced.
 +
 
 +
The web server component properties will need to be adjusted for your network before the example is compiled and downloaded to the target embedded hardware.
 +
 
 +
[[File:TCPIP_Settings.png]]

Revision as of 08:18, 2 September 2014

Introduction

These examples demonstrate Internet technologies, including web servers, HTTP, TCPIP and other protocols, using E-blocks and Flowcode V6 components.

In particular they make use of the EB023 E-blocks Internet board, connected to an EB006 E-blocks PICmicro multiprogrammer fitted with a 16F1937 microprocessor.

However, the examples are easily changed in Flowcode to support other microprocessors and platforms.

The Matrix TSL EB566SI6 Easy Internet bundle has all the items required for these sample applications and is an ideal introduction to Internet protocols and technologies.


Setting up the project hardware

Connect the E-Blocks as indicated in the table below.

The Internet, LCD and Switch E-Blocks all need to be powered via wire connections to the +V on the EB006.

In addition, the EB023 Internet board requires the Vpwr terminal connecting to the Vpwr (or +14V) terminal of the EB006.

Connect an Ethernet cable from the EB023 to the RJ45 socket of your computer or router. In the case of connecting to a PC use an Ethernet cross-over cable.


Hardware Setup
EB006 PICmicro multiprogrammer
EB005 E-blocks LCD board Port A
EB004 E-blocks LED board Port B
EB023 E-blocks Internet board Port C
EB007 E-blocks push-to-make switch board Port D


Example 1: Embedded web server with dynamic content

FC6 Icon.png Embedded Web Server Example

Example 1 demonstrates use of the Flowcode Webserver component. The server is initialised and then the program enters a infinite loop where the value of the switch E-Block is read into variable BOO1 and subsequently viewed in a browser. The CheckSocketActivity macro function must be called as part of the main program loop as this allows remote page requests to be detected and serviced.

The web server component properties will need to be adjusted for your network before the example is compiled and downloaded to the target embedded hardware.

TCPIP Settings.png