Please login or register.

Login with username, password and session length

Author Topic: queryplc not working CM15  (Read 5656 times)

simone

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 1
queryplc not working CM15
« on: October 08, 2008, 02:51:07 PM »

Hi all!

controller = CM15

I'm write the code on perl:

#!/usr/bin/perl
use constant AHCMD => "ahcmd";
my ($housecode, $command, $tmp);

$Status = system (AHCMD. " queryplc ". " A1 on");

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

if lamp is ON, if lamp is OFF the controller return me 0... i.e. $Status == 0
Why? ???
Thank You.
Logged

EL34

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 278
    • My X-10 projects
Re: queryplc not working CM15
« Reply #1 on: October 19, 2008, 07:20:32 AM »

If I remember correctly, been a while since I used perl, $Status variable = 256 for on and 0 for off
ahcmd.exe has to be located in the same folder as you are running the perl command box from

Quote
system(AHCMD." sendplc "."A1"." "."on");

change your line of code above to this and try it again
there is a space character before and after A1
system(AHCMD. " sendyplc ". " A1 on");
« Last Edit: October 19, 2008, 07:40:13 AM 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

-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 not working CM15
« Reply #2 on: October 22, 2008, 01:37:11 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!
 

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