Query plc does work, but.................

Started by EL34, October 22, 2008, 10:30:30 AM

Previous topic - Next topic

abreup


I'm also trying to change from .exe to the .dll on a VB .NET code. Is there any new API compliant whith the .NET platform?

Thank you,

From Brasil:

Abreup

dbemowsk

I was doing a little playing with the SDK today with some PHP.  I wanted to test the sample PHP script just to see what it looked like.  I copied the PHP folder from the SDK under program files over to my web folder, which by the way contained a copy of ahcmd.exe.  When I tried it, it did not work for me.  With some looking, I noticed that the ahcmd.exe file that was in the PHP folder was 9.00Kb in size and was version 3.0.0.159.  The version that was in the c:/.../AHSDK/bin folder was 60.0Kb in size and was version 3.0.0.183.  When I copied that over to my web folder, it worked like a charm.

I have written a little PHP/MySQL script that uses the queryplc command to show me a map of my house with any lights/appliances that are on.  The ahcmd.exe file is what does all the work.  I could be wrong, but I don't think the ahscript.dll file has any interaction with the ahcmd file.  I have seen posts on here that people have changed their ahscript.dll file to version 3.0.0.200 and got things working.  I have tried different versions of the .dll file and have had no change in function with my PHP script.

I did notice though that the highest version of the ahscript.dll that I have is 3.0.0.234, but the highest version of the ahcmd.exe file is 3.0.0.183.  Is there an updated ahcmd file out there somewhere?  Not that it matters that much because this one is working, but if there is one with more features, I am all for new features.

Dan
Dan Bemowski
Owner of PHP Web Scripting LLC
Programmer of RemoteWatch X10
User of any X10 products I can get my hands on.

Martyn

.. not for me Dan...

I too have both versions of ahcmd.exe, but neither of them return anything when I command <ahcmd queryplc "a2 on">

However, i only have the older version of ahscript.dll (3.0.0.183) and can't find 3.0.0.200 or greater anywhere. If anyone has this please can you send it to me?

Still floggin' that dead donkey i'm afraid....     >*<

dbemowsk

martyn,

I am guessing that you are using PHP.  Here is the little code function that I am using that works well.

/*
execute an X-10 command
types : sendplc, queryplc, sendrf

For queryplc command, return[1] will be either -1 (unknown), 0 (off), or 1 (on)
when sending "on" to the $action parameter
*/
function x10cmd($type, $hcode, $ucode, $action, $time="") {
$cmd = $type." ".$hcode.$ucode." ".$action." ".$time;
exec(".\bin\ahcmd ".$cmd, $return[0], $return[1]);
return $return;
}
//End function x10cmd


To use this with queryplc on module A1, use:

$status
= x10cmd("queryplc", "A", "1", "on");

From there you would check $status[1] for either -1 (unknown), 0 (off), or 1 (on)

Make sure that you point the exec line to the folder that you have ahcmd.exe in.  In my example, I have the file in a folder called bin relative to where the script is executed from.  Also, remember to check that you have version 3.0.0.183 of the ahcmd.exe and that the file size is 60.0kb.

If you need any more assistance with this let me know.

Dan B.
Dan Bemowski
Owner of PHP Web Scripting LLC
Programmer of RemoteWatch X10
User of any X10 products I can get my hands on.

AidinEslami

hi
please mail me version 3.0.0.200
aidin.eslami[at]gmail.com

thank you soooooo much

SMF spam blocked by CleanTalk