Please login or register.

Login with username, password and session length
Pages: [1] 2

Author Topic: queryplc command  (Read 52903 times)

dave s

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 2
queryplc command
« on: September 10, 2005, 11:59:06 AM »

Has anyone had any luck using
the 'queryplc' command that is part of the
SDK object? I can send commands to turn
modules on and off, however even if a
module is 'on' the 'queryplc' command does
not tell me this. Help!
Logged

skip

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 7
Re: queryplc command
« Reply #1 on: September 23, 2005, 02:59:43 PM »

Dave,

Queryplc has been broken for a while...it
stopped working with 3.18x

Skip
Logged

dave s

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 2
Re: queryplc command
« Reply #2 on: October 04, 2005, 07:27:58 PM »

Skip, thanks for your reply. Is there
anyone out there from X10 listening. What
good is a SDK if the functionality is
broken!!! My one experience with your tech
support has been a decent one, however I
cannot fathom why nobody from X10 will
respond to all the posts on this forum
where people need your help!!!
Logged

jim c

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 1
Re: queryplc command
« Reply #3 on: October 04, 2005, 10:17:00 PM »

I would assume you are trying to query one
of the Bi-Directional Pro Moduals, not the
Standard X-10 units,  It's been over a year
since I was last doing coding for my old
Unit, but that was the only one that would
respond to queries, and I got a message
back telling me that was correct,  unless
they have changed all the units (Would be
nice, but not very likely
Logged

skip

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 7
Re: queryplc command
« Reply #4 on: October 07, 2005, 02:57:17 PM »

Jim,

In 3.17x i could successfully do a queryplc
on the old x10 modules.  It worked fine, as
ahp kept track of the module status. I built
a system to control my garage door around it
and it worked like a charm.

After installing 3.18x queryplc started
returning 0 on all requests.

Skip
Logged

thermon

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 4
Re: queryplc command
« Reply #5 on: July 20, 2006, 03:31:10 AM »

I've just tried the latest SDK from C++, and queryplc works great.
Logged

SkipWill

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 17
Re: queryplc command
« Reply #6 on: August 28, 2006, 03:54:36 PM »

I've just tried the latest SDK from C++, and queryplc works great.

Thermon,

I would sure like to know how you did it :).  It stopped working for me after version 3.2x and whatever I do, queryplc returns 0 even with 2 way modules (it used to work with 1 way modules as well).

What version of AHP are you using?  Are you using the SDK as downloaded from X10?

Thanks

Sklip
Logged

EL34

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 278
    • My X-10 projects
Re: queryplc command
« Reply #7 on: February 26, 2007, 10:19:28 AM »

queryplc works ok for me so far using Perl, cm15A and AHP
The $Status variable below = 256 if module I1 is on and = 0 if I1 is off.
AHP also displays the correct status of the module after sending an on or off command via my Perl script

Perl Code:

### Set this to where ahcmd.exe is located ###
use constant AHCMD => "ahcmd";
my($housecode,$command,$tmp);

### Query, On = 256 , Off = 0 ###
$Status = system(AHCMD. " queryplc ". " I1 on");

### Turn on I1 only if it is off ###
if ($Status eq 0)
    {   
    system(AHCMD." sendplc "."I1"." "."on");
    }


Edit: OOOps, sorry forgot to set text as code
« Last Edit: February 26, 2007, 04:20:49 PM by EL34 »
Logged
W10 - CM15A - AHP 3.301 - i Witness - MyHouse online - Smart Macros - SDK using Visual Basic express 2008
My X10 page-> http://www.el34world.com/Misc/home/X10_0.htm

thermon

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 4
Re: queryplc command
« Reply #8 on: April 03, 2007, 11:56:33 AM »

I didn't do anything special to make it work.  I tested it under the C++ source code provided.
Logged

swatson

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 2
Re: queryplc command
« Reply #9 on: December 04, 2007, 06:54:31 AM »

Can someone convert the above example to PHP?
I have tried several things and I cannot get queryplc to return a value with PHP.
Also, why does the JavaScript example of the SDK work in IE only and only on my home PC?
Logged

-Bill- (of wgjohns.com)

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 81
  • Posts: 1340
  • He's just this guy. You know?
    • wgjohns.com
Re: queryplc command
« Reply #10 on: October 22, 2008, 01:58:06 AM »

I have emailed X10 about this problem.  There has been no response so far, but this might explain your problem:

The issue with the SDK is that the ahscript.dll file supplied in the SDK is version 3.0.0.183 while the version supplied with AHP is 3.0.0.200.  The most obvious problem with this is that software that uses the SDK version of the file gets erroneous results when attempting to use the “queryplc” command.  Many that have tried to develop software using the SDK have complained that the “queryplc” command always returns a result of 0.  Granted this is only an issue if the developer or end user doesn’t have AHP installed, or the developed software accesses a local copy of ahscript.dll instead of the one installed by AHP, but it does lead to a lot of frustration when trying to develop software and the “queryplc” command doesn’t appear to work.

Logged
-Bill- (of wgjohns.com)
bill@wgjohns.com

In the real world, the only constant is change.

When I'm online you can find me in the Home Automation Chat Room!

EL34

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 278
    • My X-10 projects
Re: queryplc command
« Reply #11 on: October 22, 2008, 10:35:54 AM »

I just did a test to see why query worked for me in my VB 2008 express app, the results are here in this post.
http://www.x10community.com/forums/index.php?topic=16677.msg91907
Logged
W10 - CM15A - AHP 3.301 - i Witness - MyHouse online - Smart Macros - SDK using Visual Basic express 2008
My X10 page-> http://www.el34world.com/Misc/home/X10_0.htm

inquisitr50@hotmail.com

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 1
Re: queryplc command
« Reply #12 on: April 30, 2009, 08:16:53 AM »

As someone said in this forum what good is an automation system if you can't know the status of a module .
If query plc is not working and you can only send command you are sending command as a blind .
X10 should stop sending me e-mail for selling me product and start sending me answer to my question .
When will we have a command that work both ways
thank  >*< B:( :'
Logged

dbemowsk

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 428
    • PHP Web Scripting
Re: queryplc command
« Reply #13 on: December 24, 2009, 01:09:32 PM »

Can someone convert the above example to PHP?
I have tried several things and I cannot get queryplc to return a value with PHP.
Also, why does the JavaScript example of the SDK work in IE only and only on my home PC?
I realize that this is an old post, but in the event that someone stumbles across this as I did in my search for the queryplc command for use in PHP, here are my findings:

First off, download and replace the ahscript.dll file (version 3.0.0.200) as described by x10diehard in this post http://www.automationvista.com/Board/ShowTopic.aspx?Topic=24.

Next, I created a \bin\ folder in my webroot folder which I put the ahcmd.exe file

Now for the meat.  I have written an x10 command function for PHP that works for me.  The function should be able to handle any x10 command.
Code: [Select]
<?php
/*
    execute an X-10 command
    types : sendplc, queryplc, sendrf, recvplc, recvrf

    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
?>


An example use of the above function is listed below.
Code: [Select]
<?php
//send our x10 command for module M2 and get the status
$status x10cmd("queryplc""m""2""on");
//print the status 
switch ($status[1]) {
    case -
1:
        echo 
"Unknown";
        break;
    case 
0:
        echo 
"OFF";
        break;
    case 
1:
        echo 
"ON";
        break;
}
?>


Hope this is useful to many...

Dan
« Last Edit: December 24, 2009, 01:11:38 PM by dbemowsk »
Logged
Dan Bemowski
Owner of PHP Web Scripting LLC
Programmer of RemoteWatch X10
User of any X10 products I can get my hands on.

AidinEslami

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 2
Re: queryplc command
« Reply #14 on: March 20, 2010, 10:34:43 PM »

hello
please mail the version 3.0.0.200 to my email : aidin.eslami[at]gmail.com

thank you so much.
Logged
Pages: [1] 2
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.