X10 Community Forum

🖥️ActiveHome Pro => SDK => Topic started by: kesyni on May 02, 2008, 11:24:46 AM

Title: Help whit SKD queryplc command
Post by: kesyni on May 02, 2008, 11:24:46 AM
Hello,

I traing to use the querryplc comand in my personal program, i´m using delphi to do it,
but the porblem is: i can use other comand like sendplc to turn on and off modules, but i cant check the data base of cm15a whit the comand querryplc.

here is a part of mi code in delphi, in this part i use the querrylplc

  resp:=ahObj.SendAction('queryplc',HouseCode+DeviceCode+' on');
   ShowMessage('queryplc '+HouseCode+DeviceCode+' on');
   edtEdo.Text:=resp;
   ShowMessage(resp);
   resp:=ahObj.SendAction('queryplc',HouseCode+DeviceCode+' off');
   ShowMessage('queryplc '+HouseCode+DeviceCode+' off');
   edtEdo.Text:=resp;
   ShowMessage(resp)

I need help

Title: Re: Help whit SKD queryplc command
Post by: -Bill- (of wgjohns.com) on May 02, 2008, 10:19:08 PM
Hello,

I traing to use the querryplc comand in my personal program, i´m using delphi to do it,
but the porblem is: i can use other comand like sendplc to turn on and off modules, but i cant check the data base of cm15a whit the comand querryplc.

here is a part of mi code in delphi, in this part i use the querrylplc

  resp:=ahObj.SendAction('queryplc',HouseCode+DeviceCode+' on');
   ShowMessage('queryplc '+HouseCode+DeviceCode+' on');
   edtEdo.Text:=resp;
   ShowMessage(resp);
   resp:=ahObj.SendAction('queryplc',HouseCode+DeviceCode+' off');
   ShowMessage('queryplc '+HouseCode+DeviceCode+' off');
   edtEdo.Text:=resp;
   ShowMessage(resp)

I need help



Don't know Delphi, but over all, it looks right.  Should return a string of "0", "1", or "-1".  Doesn't it?
Title: Re: Help whit SKD queryplc command
Post by: Tuicemen on May 11, 2008, 06:39:19 PM
The SDK will only supply an accurate query for 2 way devices!
Title: Re: Help whit SKD queryplc command
Post by: kesyni on May 17, 2008, 04:21:47 PM
no,

 the program only return "0" or "-1" but never "1", he return "-1" when i use the program and don't connect the CM15A, and  that's OK because the status of the device A1 is unknown.  When i connect the CM15A, and check status of A1 the program return "0", that's OK too because the device A1 is off, but when i send comand to turn on device A1, the program return "0", the divice A1 is ON,  but the program return "0". please help   ???.
Title: Re: Help whit SKD queryplc command
Post by: -Bill- (of wgjohns.com) on May 18, 2008, 11:53:16 PM
kesyni,

What are you using to turn A1 on and off?  A RF remote, the AHP program, a SDK SendAction() command?
Title: Re: Help whit SKD queryplc command
Post by: kesyni on May 19, 2008, 05:26:06 PM
I use the sdk comand SendAction(), but i try too whit AHP program  to turn on/off A1.  And then ask to my program about the status of A1 whit queryplc command. but the answers are the same   ???
Title: Re: Help whit SKD queryplc command
Post by: mauritouch on August 15, 2008, 09:35:33 AM
Hello,

Has anyone found the solution to get QueryPlc work with the latest SDK?

I heard that we need a two module, but AHP software can do it without...

I've use: SendAction("queryplc", "a2 on")
Also tried: SendAction("sendplc", "a2 statuson")

But the system always returns 0

Any help?

M
Title: Re: Help whit SKD queryplc command
Post by: -Bill- (of wgjohns.com) on August 17, 2008, 04:21:13 AM
I just don't understand what the problem is.

I have used:
Code: [Select]
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!   >*<

 >!
Title: Re: Help whit SKD queryplc command
Post by: mauritouch on August 17, 2008, 07:28:21 AM
Hi Bill and thank you for your help !

The monitored housecode on AHP is set to A (Interface is updated as well). With the CM15 Pro I'm able to send X10 orders to my X10 plugs without any problem (On, Off, Dim...). However, in order for me to receive the status of the plugs when the computer is on (Everything is managed by the software I'm doing based on a French coding software called Windev) the "queryplc" always return the value 0.

With both software opened (Mine and AHP) on 2 different screens, when I switch a plug on with my software, AHP automatically detects the status of the plug on updates the switch picture in the room display. Is it because AHP is simply monitoring the last order that went through the CM15? Because it also get all the proper status on system start up....

What I would like to know is if I'm using the proper SDK. Where can I download the latest one where "queryplc" doesn't have any known problem?

Thank you for your help again
Title: Re: Help whit SKD queryplc command
Post by: -Bill- (of wgjohns.com) on August 22, 2008, 11:05:41 PM
Hi Bill and thank you for your help !

....

What I would like to know is if I'm using the proper SDK. Where can I download the latest one where "queryplc" doesn't have any known problem?

Thank you for your help again


The current link to the SDK software is: http://www.x10.com/activehomepro/sdk/index.html (http://www.x10.com/activehomepro/sdk/index.html)

Technically, I'm not using the files provided by the SDK itself, but the files that AHP installed in: C:\Program Files\Common Files\X10\Common which are as follows:

File NameFile VersionDate ModifiedDate Created
ahcmd.exe3.0.0.183Wednesday, March 23, 2005, 6:11:50 PMSaturday, October 29, 2005, 5:58:51 PM
ahscript.dll3.0.0.200Thursday, February 02, 2006, 4:53:38 PMSaturday, October 29, 2005, 5:58:49 PM
rundll32.exe4.90.0.3000Tuesday, October 30, 2001, 7:41:42 PMSaturday, October 29, 2005, 5:12:58 PM
x10.exe1.0.0.1Tuesday, October 30, 2001, 7:36:42 PMSaturday, October 29, 2005, 5:12:40 PM
x10lv.dll3.0.0.82Friday, January 17, 2003, 11:44:58 AMSunday, March 23, 2008, 12:53:06 AM
x10net.dll3.0.0.204Wednesday, June 21, 2006, 11:10:32 AMSaturday, October 29, 2005, 5:12:40 PM
X10nets.exe1.0.0.1Monday, November 12, 2001, 2:31:48 PMSaturday, October 29, 2005, 5:12:40 PM
xcap.ax2.0.0.106Tuesday, May 13, 2003, 4:50:56 PMSunday, March 23, 2008, 12:53:06 AM
xsetup.dllNone shownFriday, November 04, 2005, 3:19:02 PMSaturday, October 29, 2005, 5:44:04 PM

For the most part, the "Date Created" seems to be when the file was first installed on my system.

Hope that helps at least some!

 >!
Title: Re: Help whit SKD queryplc command
Post by: -Bill- (of wgjohns.com) on October 22, 2008, 01:48:00 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.

Title: Re: Help whit SKD queryplc command
Post by: EL34 on October 22, 2008, 10:36:06 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
Title: Re: Help whit SKD queryplc command
Post by: originalevil on January 21, 2009, 05:17:47 PM


Technically, I'm not using the files provided by the SDK itself, but the files that AHP installed in: C:\Program Files\Common Files\X10\Common which are as follows:


Bill, you are a prince. I've been reading through threads for days looking for this tiny bit of information! Thank you for your helpful post!
Title: Re: Help whit SKD queryplc command
Post by: Tuicemen on January 21, 2009, 06:38:21 PM


Technically, I'm not using the files provided by the SDK itself, but the files that AHP installed in: C:\Program Files\Common Files\X10\Common which are as follows:


Bill, you are a prince. I've been reading through threads for days looking for this tiny bit of information! Thank you for your helpful post!
This post got me looking! ::) I've been running the files from the SDK!
Never needed to use anything else for my apps.::) :' :'
The newest ahscript.dll file is 3.0.0.234
Wow -:) guess I should use the updated dll!
Title: Re: Help whit SKD queryplc command
Post by: Martyn on January 17, 2010, 05:28:17 AM
Sorry to resurrect this, but I can't seem to find ahscript.dll anywhere on the net as any version other than 3.0.0.183.

i have redownloaded the SDK from the X10 site, but I always end up with 3.0.0.183.

i have the same QueryPLC issue as the above and am hoping that 3.0.0.200 or 3.0.0.<later> will help me.

Can anyone point me in the right direction, or email it to me?

thanks
Title: Re: Help whit SKD queryplc command
Post by: wizztjh on June 23, 2010, 10:14:18 AM
mine also 183 version , can anyone send me the latest one?
Title: Re: Help whit SKD queryplc command
Post by: dbemowsk on June 24, 2010, 01:14:29 AM
I just don't understand what the problem is.

I have used:
Code: [Select]
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 (http://www.phpwebscripting.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=9&MMN_position=34:33).  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 (http://www.phpwebscripting.com/downloads/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 (http://www.phpwebscripting.com/phpwebsite/downloads/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. (http://www.phpwebscripting.com/downloads/ahscript.dll)  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.  >!