Example
8.
Implementing
Manual Triggers
Parameters,
unlike variables, are set by the user.
Moreover, parameters are saved in non-volatile memory. This means, their values are preserved
even if the controller loses power.
Parameters are useful in implementing a high-level control to set the
values of the outputs. Consider
the following script.
title "example 8. manual trigger "
output oFan1, oHeat;
par pOut;
if(pOut==0)
{
oFan1 = 0;
oHeat = 0;
}
if(pOut==1)
{
oFan1 = 1;
oHeat = 0;
}
if(pOut==2)
{
oFan1 = 0;
oHeat = 1;
}
In the
example given above, there are two outputs, one for a cooling fan, and another
for a heater. The user to may
change the output values by setting the value of the parameter. If the parameter value is 0, then both
outputs are off. If the parameter
value is 1, then the cooling fan is turned on and the heater is turned
off. If the parameter value is 3,
then the heater is turned on and the cooling fan is turned off. The user may set the parameter value
either through the iNetGrow software or through a web page. The latter allows high-level control
through the Internet or an intranet using any device that supports a web
browser, for example, a web-enabled cell phone.
Also
see : Programming, Program
Examples, Script Syntax, Automated Tasks
© Rigel Corporation iNetGrow 2003-2006. All rights reserved.