Extron Electronics IPL T SFI244 User Manual
Page 54

Example 4
The flex I/O can also be configured as an input. In this example, two inputs are connected
to a matrix switcher. Using JavaScript, the status of the digital inputs can be checked and
the appropriate message displayed for the user.
<html>
<head><title>Example 4</title></head>
<h2><b>HTML Example #4</b></h2>
<body>
<p>
<script>
var ioState1 = "<!--#echo var="1]"-->"
var ioState2 = "<!--#echo var="2]"-->"
if ((ioState1 == 1) && (ioState2 == 0)) {
document.write('Input #1 Selected')
}
else if ((ioState1 == 0) && (ioState2 == 1)) {
document.write('Input #2 Selected')
}
else {
document.write('No Input Selected')
}
</script>
</p>
<p>
<a href="index.html?cmd=3*25*3]">Select Input #1</a>
<br>
<a href="index.html?cmd=4*25*3]">Select Input #2</a>
</p>
</body>
</html>
Figure 47.
HTML Source Code Showing Server Side Includes
Using the SSI to assign the state of input 1 and input 2 allows the JavaScript code to
determine which switcher input is selected. This example also demonstrates using a URL
query string in conjunction with the pulse I/O command to allow the user to switch the
matrix switcher with a 250-millisecond closer.
Figure 48.
Browser View
IPL T SFI244 • Communication and Control
48