URL Handler (In-Process CGI routine) that modifies the values of specified Parameter Database entries in the controller and optionally returns a web page.
/wrtpdb
Prerequisites
None
Parameters
None
URL Query String Parameters
nPID
A required numeric integer value that specifies the number of Parameter Database entries to be modified.
PID1 to PIDn
nPID required PDB specifications sequentially named PID1, PID2, ... Each specification includes the PDB entry's DataID, unit, sub unit, and array index. For example, if the first value to be changed is the maximum soft limit for the second robot's third axis, PID1 should be set to '16077,2,0,3'. To change the values of all axes, PID1 should be set to '16077,2,0,0'.
As a special case, if the unit number is -1, the unit number is extracted from the "Default webserver structure index" (DataID 423) parameter. This permits the same URL specification to alter the data for different units (e.g. robots) depending upon the setting of DataID 423.
PVal1 to PValn
nPID required PDB values sequentially named PVal1, PVal2, ... PVal1 is the new value to be set for PID1. PVal2 corresponds to PID2, etc. The PVal_ can be a string, number or arrays of strings or numbers as required by the matching PDB specification. For example: '23.2'; '0, 41.2, 21.6'; '"abc","cba","not"'.
Redirect
A required string value that specifies the URL for the web page to be returned after all of the values have been modified. If no web page is to be returned, this value should be "".
Remarks
This URL handler (In-Process CGI routine) provides a general means for changing the values of Parameter Database entries on the controller. When this special URL address is received by the web server, rather than fetching a standard disk file, it sets the nPID pairs of PID_ PDB entries to their new values specified by the PVal_ values. After all of the values have been updated, a new web page defined by Redirect is return if specified.
The PID_ and PVal_ values are processed sequentially based upon their sequence number (from 1 to nPID) rather than based upon their order of appearance in the URL Query String. Symbolically, the following process is performed:
For ii = 1 To nPID
PDB(PIDii) = PValii
Next iiThis permits the PID_ and PVal_ values to be displayed on the web page in any desired sequence while still maintaining a strict order in which the values are updated.
In a non-embedded web server, the /wrtpdb operation would be performed by an independent task that was implemented using CGI (Common Gateway Interface) technology. In the controller's embedded web server, this task is performed by a special function built into the web server to minimize system overhead.
Examples
The following is a minimal HTML sample file that displays the value of the "GPL program variable " (DataID 1850) and permits its value to be modified. Save this sequence in a file as /flash/appweb/test.asp.
<html>
<body>
<p><form action="/wrtpdb" method="post">
<input name='nPID' type='hidden' value='1'>
<input name='PID1' type='hidden' value='1850,1,0,1'>
GPL program variable (1850):
<input name='PVal1' type='text' value='<% aspRDB(1850,1,0,1,-2); %>' size='20'>
<br><br>
<input name='Redirect' type='hidden' value='/flash/appweb/test.asp'>
<input type="submit" value="Set new value">
</form></p>
</body>
</html>Directly display test.asp by specifying its address in a browser. When it is displayed, enter a number such as 3.14159 and press the set button. When the page is retrieved, the number should be correct but the display will be truncated to 2 fractional digits.
See Also