Please login or register.

Login with username, password and session length

Author Topic: OnRecvAction does not work when running queryplc  (Read 10535 times)

ufans

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 7
OnRecvAction does not work when running queryplc
« on: October 28, 2007, 10:01:05 AM »

I can successfully get the results via the OnRecvAction function after running a sendplc command, but I get nothing after running a queryplc command.

ANYONE?

The script below works great...but if I change the last line to send a queryplc command I don't get anything back.


<SCRIPT LANGUAGE="JavaScript">

function DoRecvAction( Action, Parm1, Parm2, Parm3, Parm4, Parm5, Reserved ) {

    myForm.text4.value = "Command received /new";
    myForm.text5.value = Action;
    myForm.text6.value = Parm1;
    myForm.text7.value = Parm2;
    myForm.text8.value = Parm3;
    myForm.text9.value = Parm4;
    myForm.text10.value = Parm5;
    myForm.text11.value = Reserved;

}

var x10;

function loader(){

    myForm.text2.value = "Form loaded";

    x10 = new ActiveXObject( "X10.ActiveHome" );
    x10.OnRecvAction = DoRecvAction;
}

function DoCommand( Command ) {
   
    x10.SendAction( "sendplc", "a2 on" );

Logged

ufans

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 7
Re: OnRecvAction does not work when running queryplc
« Reply #1 on: October 28, 2007, 10:03:52 AM »

I also tested the value of

result = x10.SendAction( "queryplc", "a2 on" );

and I get '0' which indicates that the command did not result in an error.  But, I still don't get anything set via the x10.OnRecvAction command.
Logged

ufans

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 7
Re: OnRecvAction does not work when running queryplc
« Reply #2 on: October 28, 2007, 10:16:03 AM »

The SDK is not really clear about the queryplc comamnd....The result = x10.SendAction( "queryplc", "a2 on" ); might return the 0 or 1 based on the binary result or return -1 if unknown. 

So.. I tried this...


myForm.text6.value = "p9ON = " + x10.SendAction( "queryplc", "p9 on" );
myForm.text7.value = "p9OFF = " + x10.SendAction( "queryplc", "p9 off" );   


The first returned "0" and the second returned "-1"  ... not sure what to make of that.  '-1' should be unknown according to the SDK, but if it doesn't know whether p9 is on or off, then I should also get the same result when running queryplc p9 on as queryplc p9 off
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: OnRecvAction does not work when running queryplc
« Reply #3 on: October 22, 2008, 01:59:34 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: OnRecvAction does not work when running queryplc
« Reply #4 on: October 22, 2008, 10:35:32 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
 

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