01.06.2013 Views

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3. dk40cgi.exe<br />

The CGI function of this program produces a HTML page which contains the current values of the DK40<br />

I/O pins.<br />

Example browser input:<br />

http://192.168.205.4/dk40<br />

4. dk40_set.exe<br />

Demonstrates set and reset control over the DK40 output pins via browser.<br />

Example browser input:<br />

http://192.168.205.4/dk40<br />

5. secure.exe<br />

This is an example of a protected page.<br />

The first browser input ...<br />

http://192.168.205.4/dk40_secure<br />

requires the input of a valid user name and password, e.g.:<br />

User name: user<br />

Password: password<br />

6. submit.exe<br />

The building of formulars is demonstrated here.<br />

7. submit2.exe<br />

The building of formulars with more than one item is demonstrated here.<br />

Important:<br />

1. The recommended memory model for DOS programs is "Large".<br />

2. CGI functions should be programmed as short as possible, without long or endless waits.<br />

3. CGI functions compiled with Borland C must be declared as "huge".<br />

4. CGI functions compiled with Microsoft C must be declared as " far _saveregs _loadds".<br />

5. Users of Microsoft Visual C must set the compiler option "struct member byte alignment" to "1 byte" or<br />

must use "#pragma pack(1)" in their source.<br />

6. The command cgistat at the <strong>IPC<strong>@CHIP</strong></strong> command prompt lists all CGI functions installed.<br />

7. URL names for CGI functions are case-sensitive.<br />

8. If you use Microsoft C-Compilers then increase the Web server's WEBSERVERSTACK stack size value<br />

in the chip.ini file. The default stack size of the Web server task is 2048 Bytes. Programmers of<br />

CGI functions who are using Microsoft C-Compilers with C-Library functions, e.g. sprintf, which<br />

requires a lot of stack space should increase this allocation to 6144 (6 Kbytes). More stack space for the<br />

Web server task is also required if your CGI function uses a large amount of stack for automatic data<br />

(local variables) declared inside the CGI function call.<br />

Building Turbo Pascal CGI procedures<br />

Since <strong>@CHIP</strong>-<strong>RTOS</strong> version 0.65, it is possible to write CGI procedures with Turbo Pascal<br />

This is a little bit different from writing a CGI function with the C compilers.<br />

A Turbo Pascal program which contain a CGI procedure uses the same data structures (records)<br />

as a C language CGI function.<br />

Declaration of Turbo Pascal CGI procedures<br />

A CGI procedure written with Turbo Pascal must be declared without any parameters and with the interrupt<br />

declaration, e.g.:<br />

procedure CgiMini_Proc;interrupt;<br />

Page 376 / 400

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!