pCOWeb +030220966 – rel. 1.1 – 12.12.2017 70
“setres”: outcome of a write page
Returns a value that depends on the result of the last access request to the
pCO
supervisor variables in which var commands are used (see above).
SYNTAX
<%setres('UndefinedText', 'OkText', 'TimeOutText')%>
The three customisable fields are returned in the following cases:
• UndefinedText: the pCO has not been sent a request for the variation of the variables;
• OkText: pCOWeb has received all the echoes for the variations sent to the pCO;
• TimeOutText: pCOWeb not has received all the expected echoes.
IMPORTANT
The result of setres does NOT represent the correct writing or reading of a pCO supervisor variable; in fact, the following special cases exist:
• for the write request, the pCO returns an echo even when the variable is in read-only and the value sent to the pCO is different from the one in the
application; the echo returned sends the unchanged value contained in the pCO application;
• if the pCO receives the write request for a variable with a value that is the same as the current one, no echo will be generated for that variable.
For these reasons, this tag should only be used to check the operation of the HTML pages during their construction. For further information on communication
with the pCO, see APPENDIX C on page 62.
Example (Figure G.d on page 70)
Displaying the result of the write operation:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<!--tagparser="/pcotagfilt"-->
<head>
<meta content="text/html; charset=ISO-8859-15" http-equiv="content-type">
<title>pCOWeb Demo Page</title>
</head>
<body bgcolor='#ffffff'>
<h1 style="text-align: center">pCOWeb Demo Page</h1>
<br>
<form method="POST" action="example.html">
<input type="text" name="?script:var(0,3,9,-32768,32767)" value="<%var(0,3,9)%>">
<input type="submit" value="Submit">
</form>
Operation result: <%setres('Undefined','Ok','Timeout')%>
</body>
</html>
Figure G.d - The “setres” TAG: example
CAREL TAGS FOR HANDLING THE pCOWeb CONFIGURATION FILES
pCOWeb saves the user settings in a number of files (paragraph 9.1 on page 41), in the following format:
<parameter>=<value>
An example of these files (SNMP TRAP configuration, ‘snmptrap’ file) is as follows:
r1_enabled=1
r1_trigger=0
r1_dest1=1
r1_dest2=0
r1_dest3=0
r1_dest4=0
r1_trapoid=1.3.6.1.4.1.9839.2.1.1.0
r1_ack=0
r1_time=1
host1=10.0.0.131
community1=carel
enabled1=1
enabled2=0
enabled3=0
enabled4=0
pcoprotfail_enab=0
pcoprotfail_ack=0
pcoprotfail_time=1
r1_valoid1=1.3.6.1.2.1.1.5.0
The following tags are available for handling the configuration files:
• “getdb”: read a parameter from file;
• “setdb”: write a parameter to file;
• “checkdbsel”: search for a parameter in a file and check the value (useful for html “select” tools);
• “checkdbradio”: search for a parameter in a file and check the value (useful for html “radiobutton” tools).