Extron Electronics IPL T SFI244 User Manual

Page 56

Advertising
background image

Example 6

The example below (figure 51) shows how you can use JavaScript to parse the response
from an Extron matrix switcher and produce a formatted Web page.

<html>
<head><title>Example 6</title>
<script language="javascript">
xOut1 = "<!--#echo var="W01RS|V01%25"-->";
xOut2 = "<!--#echo var="W01RS|V02%25"-->";
xOut3 = "<!--#echo var="W01RS|V03%25"-->";
xOut4 = "<!--#echo var="W01RS|V04%25"-->";
</script>
</head>
<h2 b>HTML Example #6</h2 b>
<body>
This example requires an Extron Matrix Switcher connected to IPL T SFI244 serial port #1.
<p>
<b>Sample links that can be followed</b>
<br>
<a href="http://192.168.254.254/example#6.html?cmd=W01RS|5*1!">
http://192.168.254.254/example#6.html?cmd=W01RS|5*1!<a><i> -Creates tie from input 5 to output 1</i>
<br>
<a href="http://192.168.254.254/example#6.html?cmd=W01RS|1*2!">
http://192.168.254.254/example#6.html?cmd=W01RS|1*2!<a><i> -Creates tie from input 1 to output 2</i>
<br>
<b>Response to last URL encoded command: </b> <!--#echo var="WUB|"-->
<br><hr>
The following lines demonstrate reading the output status of the matrix switcher.
<br>
<p><b>____________Unformatted Response:</b>
<br>
Output 1 Setup: <!--#echo var="W01RS|V01%25"-->
<br>
Output 2 Setup: <!--#echo var="W01RS|V02%25"-->
<br>
Output 3 Setup: <!--#echo var="W01RS|V03%25"-->
<br>
Output 4 Setup: <!--#echo var="W01RS|V04%25"-->
<br><hr>
Here is an example of formatting the results using Javascript in your HTML.
<br>
<p><b>____________Formatted Response:</b><p>
<script>
<!--
var x1Split= xOut1.split(" ");
var In1Split= x1Split[1].split("n");
document.write("Output 01 tied to Input " + In1Split[1] + "<br>");
var x2Split= xOut2.split(" ");
var In2Split= x2Split[1].split("n");
document.write("Output 02 tied to Input " + In2Split[1] + "<br>");
var x3Split= xOut3.split(" ");
var In3Split= x3Split[1].split("n");
document.write("Output 03 tied to Input " + In3Split[1] + "<br>");
var x4Split= xOut4.split(" ");
var In4Split= x4Split[1].split("n");
document.write("Output 04 tied to Input " + In4Split[1] + "<br>");
// -->
</script>
<br>
</body>
</html>

Figure 51.

HTML Source Code Using JavaScript to Display Matrix Switcher

Responses

Figure 52.

Browser View

IPL T SFI244 • Communication and Control

50

Advertising