X10 Community Forum

🖥️ActiveHome Pro => SDK => Topic started by: L_elfe on June 30, 2010, 10:37:45 AM

Title: [VB]how to know if device are plugged?
Post by: L_elfe on June 30, 2010, 10:37:45 AM
Hello,

For the need of a project, I need to know which X10 device are plugged or unplugged.

After reading sdk documentation and this forum, I was thinking to use this method :
Code: [Select]
status = ActiveHomeObj.SendAction("queryplc", unitID + " on")On result, I should have the following matching : {-1, unplugged}, {0, off}, {1, on}
And with a loop from A to P and from 1 to 16, I was thinking to be able to know the status of all "port".

My program compile, and I get some result but not those expected.
I don't detect the current status but the value of the last request send.
If I unplug the device (for example a LM12F) or change it channel, it is not detected when I do a new query.

I found the application that store those information : X10nets.exe.
If I stop this program, all status are set to -1. No check to know if something is plugged.

I would like to know if there is a way to really ask to device the "real" current status ?


Regards,
L'elfe

PS : I have downloaded the version 3.0.0.200 of library ahscript.dll, and set I on the folder C:\Program Files\ActiveHome Pro otherwise I couldn't even get a status "on" or "off", and I'm using VS2008
Title: Re: [VB]how to know if device are plugged?
Post by: Brian H on June 30, 2010, 12:45:20 PM
Most modules including the LM12F are not two way modules. They have no power line transmitter in them and can not report their status; with an X10 status request.

Your code is reporting the last Known status of a module though AHP.