ICP DAS USA ISaGRAF WinCE ViewPAC User Manual page 103

Table of Contents

Advertisement

B. To post by buttons
function ON_(form_obj, obj)
{
flag = confirm("turn ON ?");
if(flag)
{
obj.value=1;
if(GetUserID(form_obj)==true) form_obj.submit();
}
}
function OFF_(form_obj, obj)
{
flag = confirm("turn OFF ?");
if(flag)
{
obj.value=0;
if(GetUserID(form_obj)==true) form_obj.submit();
}
}
function refresh_data()
{
B2.src = "img/big_Tcircle_red" + boolean_val[2] + ".jpg" ;
}
...
<body onLoad="init()">
...
<div style="position: absolute; width: 56px; height:40px; z-index: 5; left: 82px; top: 69px" >
<img name="B2" src="img/big_Tcircle_red0.jpg">
</div>
<div style="position:absolute; left:85px; top:124px; width:42px; height:27px;">
<input type="button" value="ON" style="cursor:hand" onClick="ON_(form_B2, form_B2.B2)">
A button to call ON_( ). First parameter is the name of the form. Here is "form_B2"
The second is the name of the "<input>" inside the form. Here is "form_B2.B2"
<form name="form_B2" method="post" action="./main.dll">
<input name="BEGIN" type="hidden" value="">
<input name="B2"
<input name="END"
</form>
</div>
Name of "<input>" inside the form. Here is "B2". Because it is inside "form_B2",
then must use the name of "form_B2.B2" to identify it.
<div style="position:absolute; left:85px; top:166px; width:47px; height:31px">
<input type="button" value="OFF" style="cursor:hand" onClick="OFF_(form_B2, form_B2.B2)">
</div>
...
A button to call OFF_( ). First parameter is the name of the form. Here is "form_B2"
</body>
The second is the name of the "<input>" inside the form. Here is "form_B2.B2"
Demo example: vphmi_02 and vphmi_05
"ON_" function is used for posting Boolean value as
"True" to the controller .
"OFF_" function is used for posting Boolean value as
"False" to the controller .
The layout (or location) of the image object "B2" is
defined here by the "<div" and "</div>" tags.
type="hidden" value="1">
type="hidden" value="">
ISaGRAF WinCE ViewPAC User Manual , V.1.6 , 1/2017 by ICP DAS
Display the current boolean image.
In this example,
0: "img/big_Tcircle_red0.jpg" ,
1: "img/ big_Tcircle_red1.jpg"
5-15

Advertisement

Table of Contents
loading

This manual is also suitable for:

Vp-25w7Vp-23w7Vp-4137Vp-25w6Vp-23w6Vp-4136

Table of Contents