1
General discussion forum / Re: WebSwitch 1216 - How to read relais status?
« on: 2010-07-09, 13:20:19 »
Hi, you can use PHP and parse html pages. I'm using this way to read Analog input for rotator position and calibration.
// file rotator.php
$kalibrace=-10; //calibration
$dom = new domDocument;
loadHTMLFile('http://10.20.0.202/adin.egi');
$tables=$dom->getElementsByTagName('table');
$rows = $tables->item(0)->getElementsByTagName('tr');
$i=0;
foreach ($rows as $row)
{
if($i==4){
$cols = $row->getElementsByTagName('td');
$poloha=$cols->item(1)->nodeValue;
}
$i++;
}
echo $poloha+$kalibrace; // print antenna position
This way you can get any info from webswitch.
73 Ondra OK1CDJ
// file rotator.php
$kalibrace=-10; //calibration
$dom = new domDocument;
loadHTMLFile('http://10.20.0.202/adin.egi');
$tables=$dom->getElementsByTagName('table');
$rows = $tables->item(0)->getElementsByTagName('tr');
$i=0;
foreach ($rows as $row)
{
if($i==4){
$cols = $row->getElementsByTagName('td');
$poloha=$cols->item(1)->nodeValue;
}
$i++;
}
echo $poloha+$kalibrace; // print antenna position
This way you can get any info from webswitch.
73 Ondra OK1CDJ