I've written a batch file to switch inputs on the AN-WL100. It uses telnet to connect to a remote computer that should be hooked via the service port to the LG. I of course offer no warranty with this, but works for me (tested on two units). Error handling doesn't work well within the batch file (if the command fails to send, the batch file may just hang).
I would make sure that you can successfully send commands via a serial port to the LG before using this. It has a couple requirements:
- You must have a serial port connection to the LG (of course).
- It uses telnet to remotely connect to the serial port of the computer connected to the LG. I use this program to make the com port so I can telnet to it. The reason I used telnet is so I can use a laptop or other computer to switch the input without being on the actual computer hooked to the LG.
http://www.elifulkerson.com/projects/telnet-serial-bridge.php
I downloaded the 2nd file (.zip server with the .exe)
To get this working: download the .zip file and extract it. Next create a shortcut to the program with the correct flags (-p selects which com port to use, -l selects the port to use and -r is the baud rate).
What I use:
C:\tsb-multi\tsb-multi.exe -p 2 -l 23003 -r 9600
- Next this program needs to be in the same directory as the batch file. The batch file uses this as a telnet client to send the commands. It doesn't really have an installer, just make sure it's in the same directory as the batch file.
http://support.moonpoint.com/downloads/windows/network/Telnet/tst10.php
Again, this program will telnet to the computer connected to the LG. Therefore, on startup it asks for the ip address and port of the host computer to connect to.
Tip:
If you edit the following two lines of the batch file with the correct IP/port it won't ask on startup again:
set ipaddress=ENTER_IP_HERE
set port=ENTER_PORT_NUMBER_HERE
If you have any questions, feedback or suggestions, let me know.
Here is the batch file, just copy paste the text to a file with a .bat or .cmd extension:
Code:
::This batch script comes with no warranty. If you break it, it's not my fault.
@echo off
::This script will telnet to the specified IP address and port.
::If you put in your IP and port below, the batch file won't ask you for it again.
set ipaddress=ENTER_IP_HERE
set port=ENTER_PORT_NUMBER_HERE
:chooseip
if '%ipaddress%'=='ENTER_IP_HERE' goto askforip
goto chooseport
:askforip
set /p ipaddress="What is the computer's IP address? "
echo %ipaddress%
goto chooseport
:chooseport
if '%port%'=='ENTER_PORT_NUMBER_HERE' goto askforport
goto chooseinput
:askforport
set /p port="What port do you want to use? "
echo %port%
goto chooseinput
:chooseinput
ECHO OFF
cls
ECHO.
echo Which input would you like to switch to?
echo.
ECHO 1. HDMI 1
ECHO 2. HDMI 2
ECHO 3. HDMI 3
ECHO 4. HDMI 4
ECHO 5. AV 1
ECHO 6. AV 2
ECHO 7. Component 1
ECHO 8. Component 2
ECHO 9. VGA
ECHO.
ECHO 0. Choose new IP Address and Port Number
ECHO.
ECHO q. Quit
echo.
set /p inputchoice=Choose an option.
if not '%inputchoice%'=='' set inputchoice=%inputchoice:~0,1%
if '%inputchoice%'=='1' goto sethdmi1
if '%inputchoice%'=='2' goto sethdmi2
if '%inputchoice%'=='3' goto sethdmi3
if '%inputchoice%'=='4' goto sethdmi4
if '%inputchoice%'=='5' goto setav1
if '%inputchoice%'=='6' goto setav2
if '%inputchoice%'=='7' goto setcomponent1
if '%inputchoice%'=='8' goto setcomponent2
if '%inputchoice%'=='9' goto setvga
if '%inputchoice%'=='0' goto newipandport
if '%inputchoice%'=='q' goto DONE
ECHO "%inputchoice%" is not valid please try again
ECHO.
goto chooseinput
:setav1
set inputlabel=AV 1
set input=20
goto sendinput
:setav2
set inputlabel=AV 2
set input=21
goto sendinput
:setcomponent1
set inputlabel=Component 1
set input=40
goto sendinput
:setcomponent2
set inputlabel=Component 2
set input=41
goto sendinput
:setvga
set inputlabel=VGA
set input=60
goto sendinput
:sethdmi1
set inputlabel=HDMI 1
set input=70
goto sendinput
:sethdmi2
set inputlabel=HDMI 2
set input=71
goto sendinput
:sethdmi3
set inputlabel=HDMI 3
set input=72
goto sendinput
:sethdmi4
set inputlabel=HDMI 4
set input=73
goto sendinput
:newipandport
set ipaddress=ENTER_IP_HERE
set port=ENTER_PORT_NUMBER_HERE
cls
goto chooseip
:sendinput
cls
del /q script.txt
del /q output.txt
cls
echo %input%
echo %inputlabel%
echo %ipaddress% %port%>script.txt
echo WAIT "You are now connected to COM">>script.txt
echo SEND "xb 00 %input%\m">>script.txt
echo WAIT "b 01 OK%input%x">>script.txt
TST10.exe /r:script.txt /o:output.txt /m
del /q script.txt
del /q output.txt
if %errorlevel% GTR 0 goto FAIL
cls
echo.
echo The input has been changed to: %inputlabel%.
echo.
pause
goto chooseinput
:FAIL
del /q script.txt
del /q output.txt
verify >nul
cls
ECHO.
echo ............An Error Occured............
echo.
echo m. Go back to main menu
ECHO q. Quit
set /p choicefail=Choose an option.
if not '%choicefail%'=='' set choicefail=%choicefail:~0,1%
if '%choicefail%'=='m' goto chooseinput
if '%choicefail%'=='q' goto DONE
ECHO "%choicefail%" is not valid please try again
ECHO.
goto FAIL
:DONE
del /q script.txt
del /q output.txt
cls
echo exit