<?php

echo "DRY CON1&nbsp;:";
$sonuc = shell_exec('/kirac/api/expantion_api 4 1'); 
if ($sonuc == 1) echo "0"; 
else echo "1";

echo "<br>DRY CON2&nbsp;:";
$sonuc = shell_exec('/kirac/api/expantion_api 4 2'); 
if ($sonuc == 1) echo "0"; 
else echo "1";

echo "<br><br>0/24 IN1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:";
$sonuc = shell_exec('/kirac/api/expantion_api 4 7'); 
if ($sonuc == 1) echo "0"; 
else echo "1";

echo "<br>0/24 IN2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:";
$sonuc = shell_exec('/kirac/api/expantion_api 4 8'); 
if ($sonuc == 1) echo "0"; 
else echo "1";

echo "<br>0/24 IN3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:";
$sonuc = shell_exec('/kirac/api/expantion_api 4 5'); 
if ($sonuc == 1) echo "0"; 
else echo "1";

echo "<br>0/24 IN4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:";
$sonuc = shell_exec('/kirac/api/expantion_api 4 6'); 
if ($sonuc == 1) echo "0"; 
else echo "1";

echo "<br>0/24 IN5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:";
$sonuc = shell_exec('/kirac/api/expantion_api 4 3'); 
if ($sonuc == 1) echo "0"; 
else echo "1";

echo "<br>0/24 IN6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:";
$sonuc = shell_exec('/kirac/api/expantion_api 4 4'); 
if ($sonuc == 1) echo "0"; 
else echo "1";

echo "<br><br>AN IN1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:";
$sonuc = shell_exec('/kirac/api/expantion_api 1'); 
$volt = (3.3 * $sonuc) / 4096;
echo number_format((float)$volt, 2, '.', '') . "V&nbsp;&nbsp;";
$mamp = ($volt/150.0)*1000;
echo number_format((float)$mamp, 2, '.', '') . "mA";

echo "<br>AN IN2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:";
$sonuc = shell_exec('/kirac/api/expantion_api 2'); 
$volt = (3.3 * $sonuc) / 4096;
echo number_format((float)$volt, 2, '.', '') . "V&nbsp;&nbsp;";
$mamp = ($volt/150.0)*1000;
echo number_format((float)$mamp, 2, '.', '') . "mA";

echo "<br>";
echo "<br>";

echo '<button onclick="TurnRelay(1,1)">Relay 1 ON</button>&nbsp;&nbsp;';
echo '<button onclick="TurnRelay(1,0)">Relay 1 OFF</button>';
echo "<br>";
echo "<br>";
echo '<button onclick="TurnRelay(2,1)">Relay 2 ON</button>&nbsp;&nbsp;';
echo '<button onclick="TurnRelay(2,0)">Relay 2 OFF</button>';

?>
