
LAN (4)
http://IP/status.xml
<response>
<relay0>0</relay0>
<relay1>0</relay1>
<relay2>0</relay2>
<relay3>0</relay3>
<relay4>0</relay4>
<relay5>0</relay5>
<relay6>0</relay6>
<relay7>1</relay7>
<relay8>1</relay8>
</response>
NOTE: <relay0>0</relay0> Reserved for other function (do not use in user program)
Packet Sender
The Free Network Test Utility
Packet Sender is an open source utility to allow sending and receiving TCP and UDP packets. It is available free (no ads / no bundleware) for Windows, Mac, and Linux.
PHP examples
-----------------------------------------------------
PHP code for STATUS Read UDP Relay board connected to
IP: 192.168.1.199
PORT:12345
UDP COMMAND: FF0000
<?php
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
$msg = "FF0000";
$len = strlen($msg);
socket_sendto($sock, $msg, $len, 0 ,'192.168.1.199', 12345);
socket_recvfrom($sock, $buf, 12, 0, $from, $port);
echo $buf;
socket_close($sock);
?>
-----------------------------------------------------
PHP code to turn ON first relay UDP Relay board connected to
IP: 192.168.1.199
PORT:12345
UDP COMMAND: FF0101
<?php
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
$msg = "FF0101";
$len = strlen($msg);
socket_sendto($sock, $msg, $len, 0 ,'192.168.1.199', 12345);
socket_close($sock);
echo "Relay 1 is ON";
?>
-----------------------------------------------------
PHP code to turn OFF first relay UDP Relay board connected to
IP: 192.168.1.199
PORT:12345
UDP COMMAND: FF0100
<?php
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
$msg = "FF0100";
$len = strlen($msg);
socket_sendto($sock, $msg, $len, 0 ,'192.168.1.199', 12345);
socket_close($sock);
echo "Relay 1 is OFF";
?>
-----------------------------------------------------
Macro Express contains hundreds of commands to automate practically any function on your computer.
Just press a key and let the macro do all the repetitive work for you.
Download from:
http://www.macros.com/download.htm
Download KMTronic "UDP_Relay.exe" from:
http://www.info.kmtronic.com/software/UDP_Relays/KMTronic_UDP_Relay_Control.zip
Unzip in example in "D:\KMTronic_UDP_Control" folder
Connect UDP Relay
Run Macro Express and set:
This command will activate first channel UDP relay board connected to
IP:192.168.1.199 PORT:12345
UDP_Relay.exe commands:
UDP_Relay.exe <IP:PORT> <COMMAND>
Example:
UDP_Relay.exe 192.168.1.199:12345 FF0101 (this will turn ON relay channel 1)
UDP_Relay.exe 192.168.1.199:12345 FF0100 (this will turn OFF relay channel 1)