|
Please use our Code Center to obtain source-code and example projects/solutions:
http://codecenter.softwaretoolbox.com
|
|
|

|
|
|
|
|

|
|
 Web Based Applications using the OPC Web Client Web Service
Objective
The web-page we will create a basic web-page that will simply display the values of an Array-Tag.
This example assumes that you have the Software Toolbox TOPServer installed, and the default project ""simdemo.opf"
" is loaded within the TOPServer.
Source Code
JAVASCRIPT
<html> <head> <title>OPC Web Client running in IE, using OPC Web Client WEB SERVICE</title>
<SCRIPT LANGUAGE="JScript" src="ArgumentFormat.js"></SCRIPT> <script language="javascript">
function fnInit() {
provider.init(); }
function fnReadResult() { var value = event.error ? "*** " + event.errorMessage : event.outputs.Value;
document.getElementById(event.info).value = value; }
function fnRead() { provider.read({ServerClass: "SWToolbox.TOPServer", ItemID:
"Channel_1.Device_1.TagArray_1"}, "tagvalue"); }
</script> </head>
<body onload="fnInit();">
<DIV id="service" style="behavior:url(webservice.htc)"></DIV> <DIV id="provider" style="behavior:url(eagateway.htc)" webService="service"
onReadResult="fnReadResult()"></DIV> <p>OPC Server: SWToolbox.TOPServer - with modified "simdemo.opf" loaded<br> <b>Tag Values:</b>
<input type="text" name="tagvalue" value="" size="30"> <input type="button" name="b1" value="read" onClick="fnRead();"> </p>
</body>
</html>
|
|

|
|
|
|

|
|
|