Help whit SKD queryplc command

Started by kesyni, May 02, 2008, 11:24:46 AM

Previous topic - Next topic

wizztjh

mine also 183 version , can anyone send me the latest one?

dbemowsk

#16
Quote from: -Bill- (of wgjohns.com) on August 17, 2008, 04:21:13 AM
I just don't understand what the problem is.

I have used:
result = SendAction( "queryplc", "a1 on" )
in my scripting code and it works perfectly.

For X10 modules that don't support two-way, it returns the last module state known by the X10 service.

This means that:
If the computer was not running at the time the module was last switched, it will return the last known state stored in the CM15A, if and only if the module's house code is the same as the CM15A's "monitored house code" as set in AHP.

If the computer was running at the time the module was last switched, it will return the last known state for all 256 possible module addresses.

Either way, the "last known state" will be based on the last signal for that module that passed through the CM15A. It will not reflect the status of wall switches that were manually switched unless the wall switch sends a X10 signal out when it is manually switched (most X10 wall switches to-date don't do that).

I hope this helps.

If not, maybe we need to examine the file-dates of the X10 support files and such.

Again, I just don't get why I'm the only one who can seem to get it working!   >*<

>!


Bill,

Just so you don't feel alone in a corner, I too have used the queryplc command with much success.  I use it with my software RemoteWatch X10.  When I started using the queryplc command I was using it through the ahcmd.exe script, and it worked.  I had then heard of the problems with ahcmd hanging up on occasion and coded my own version of it in VB in which I use a SendAction command.  Using the new script named x10cmd.exe I can pass a queryplc command and get the proper result.

Here is the code that I used to create the x10cmd.exe file.

Module x10cmd
   Dim ActiveHomeObj
   Dim arrArgs
() As String = Command.Split(" ")

   
Sub Main()
       
Dim intOutput As Integer
       ActiveHomeObj
= CreateObject("X10.ActiveHome")

       
intOutput = -2

       
If (arrArgs.Count < 3) Then
           Console
.Write("Incorrect number of arguments passed")
       Else
           
intOutput = ActiveHomeObj.SendAction(arrArgs(0), arrArgs(1) & " " & arrArgs(2))

           While
intOutput = -2
           End
While

           
Console.WriteLine(intOutput)
       
End If
   
End Sub
End Module

All the program does is pass the command line arguments to a SendAction command and returns -1, 0, or 1.  In my situation, I have my HA computer running 24/7 so that I can monitor all 256 H/U codes.  I have been using this for quite some time now without any issues.

The ahscript.dll that I have in "C:\Program Files\Common Files\X10\Common" is version 3.0.0.200.  I have posted a copy of this version of the file on my website.  Click here to download it.  I have not tried the 3.0.0.183 version, so I cannot comment on that version.

>! Hope this post helps some of you out there.  >!

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

SMF spam blocked by CleanTalk