Please login or register.

Login with username, password and session length

Author Topic: [VB]how to know if device are plugged?  (Read 5303 times)

L_elfe

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 1
[VB]how to know if device are plugged?
« 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
Logged

Brian H

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 305
  • Posts: 13295
Re: [VB]how to know if device are plugged?
« Reply #1 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.
Logged
 

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