ioPAC RTU Controllers
C/C++ Sample Code Programming Guide
|
HOWTO: Entry of CGI Samples More...
HOWTO: Entry of CGI Samples
Introduction: This is the introduction of HOWTO use the entry of CGI sample(cgi_entry.html).
Start Web server:
root@Moxa:/home# /etc/init.d/apache start Starting web server: apache.
Build and Run the sample:
root@PLATFORM:/# cd /usr/local/arm-linux/sample/RTU/Web root@PLATFORM:/usr/local/arm-linux/sample/RTU/Web# make root@PLATFORM:/usr/local/arm-linux/sample/RTU/Web# ls cgi-bin htdocs Makefile source
root@Moxa:/# cd /home/httpd/ root@Moxa:/home/httpd# chmod 755 cgi-bin/* root@Moxa:/home/httpd# chmod u+s cgi-bin/* root@Moxa:/home/httpd# chmod 755 htdocs/*
Source code: cgi_entry.html
<html> <head> <link href="iopac.css" rel="stylesheet" /> <title>Entry of CGI Samples</title> <style> td { width: 20%; text-align: center; } input { text-align: right; } </style> </head> <body> <h1>Entry of CGI Samples</h1> <h2> <ul> <li>To activate this sample, please follow the steps form the Web HOWTO in the programming guide.</li> <li>Using the below redirection to test the sample CGI.</li> </ul> </h2> <h2>Redirection:</h2> <table width="100%"> <tr> <td class="block_title">I/O Type</td> <td class="block_title">Slot</td> <td class="block_title">Channel Start</td> <td class="block_title">Channel Count</td> <td class="block_title"></td> </tr> <tr> <td class="column_title"> <select id="iotype"> <option value="di.cgi">DI</option> <option value="do.cgi">DO</option> <option value="relay.cgi">Relay</option> <option value="ai.cgi">AI</option> <option value="fast_ai.cgi">Fast AI</option> <option value="tc.cgi">TC</option> <option value="rtd.cgi">RTD</option> <option value="ao.cgi">AO</option> </select> </td> <td class="column_title"> <input type=text id="slot" size="8" value="1"> </td> <td class="column_title"> <input type=text id="chStart" size="8" value="0"> </td> <td class="column_title"> <input type=text id="chCount" size="8" value="1"> </td> <td class="column_title"> <button onclick="javascript:location.href='/cgi-bin/' +iotype.options[iotype.selectedIndex].value +'?slot='+document.getElementById('slot').value +'&chStart='+document.getElementById('chStart').value +'&chCount='+document.getElementById('chCount').value"> submit </button> </td> </tr> </table> </body> </html>