ISaGRAF WinCE ViewPAC User Manual , V.1.6 , 1/2017 by ICP DAS
5-14
5.4.3.1 Post Boolean Value to The Controller
A.
To post by the image
…
function ON_OFF(form_obj, obj, current_boo_value)
{
if(current_boo_value==0)
{
flag = confirm("turn ON ?");
if(flag) obj.value=1;
}
else
{
flag = confirm("turn OFF ?");
if(flag) obj.value=0;
}
if(flag)
{
if(GetUserID(form_obj)==true) form_obj.submit();
}
}
function refresh_data()
{
B2.src = “img/cmd” + boolean_val*2+ + “.jpg” ;
}
…
<body onLoad="init()">
…
<div style="position: absolute; width:100px;height:100px; z-index: 5; left: 242px; top: 164px" >
<img style="
cursor:hand
" name="
B2
" onclick="
ON_OFF(form_B2, form_B2.B2, boolean_val[2])
"
src="img/cmd0.jpg">
<form name="
form_B2
" method="post" action="./main.dll">
<input name="BEGIN" type="hidden">
<input name="B2" type="hidden" value="0">
<input name="END" type="hidden">
</form>
</div>
…
</body>
ON_OFF function is used for posting Boolean value to the
controller by refer to the current Boolean value.
Demo example: vphmi_02 and vphmi_05
The 1
st
parameter is the name of the “form”.
The 2
nd
parameter is the “<input>” name inside the form.
The last parameter is the current Boolean value.
Display the current Boolean image. In this example,
0: display “img/cmd0.jpg”, 1:“img/cmd1.jpg”
The layout (or location) of the image object “B2” is defined here
by the “<div” and “</div>” tags.
Name of “<input>” inside the form. Here is “B2”. Because it is
inside “form_B2”, then we must use the name of “form_B2.B2”
to identify it.
Name of the
image object
The onclick will call ON_OFF( ) when the mouse click on it.
The 1
st
parameter is the name of the “form”. Here is “form_B2”
The 2
nd
parameter is the “<input>” name inside the form. Here is “form_B2.B2”
The last is the current boolean value. Here is boolean_val[2]
“cursor:hand” will display the mouse arrow as a hand when entering the image area
Name of the
form
Содержание ISaGRAF VP-23W7
Страница 44: ......
Страница 118: ......
Страница 134: ...ISaGRAF WinCE ViewPAC User Manual V 1 6 1 2017 by ICP DAS 9 2 On line help of ICP DAS add on functions function blocks ...
Страница 176: ...ISaGRAF WinCE ViewPAC User Manual V 1 6 1 2017 by ICP DAS Ap 16 Appendix C Hardware Interface Dimension ...
Страница 177: ...ISaGRAF WinCE ViewPAC User Manual V 1 6 1 2017 by ICP DAS Ap 17 VP 23W7 23W6 Unit mm ...
Страница 178: ...ISaGRAF WinCE ViewPAC User Manual V 1 6 1 2017 by ICP DAS Ap 18 VP 25W7 25W6 Unit mm ...
Страница 179: ...ISaGRAF WinCE ViewPAC User Manual V 1 6 1 2017 by ICP DAS Ap 19 ...
Страница 180: ...ISaGRAF WinCE ViewPAC User Manual V 1 6 1 2017 by ICP DAS Ap 20 VP 41x7 41x6 Unit mm ...
Страница 185: ...ISaGRAF WinCE ViewPAC User Manual V 1 6 1 2017 by ICP DAS Ap 25 ...