Please login or register.

Login with username, password and session length

Author Topic: Problem with multiple programs using ActiveHome  (Read 7311 times)

John_Mac

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 1
Problem with multiple programs using ActiveHome
« on: March 26, 2008, 11:28:26 AM »

I have two programs running on the same computer that use the ActiveHome X10 scripting library.  One is a program that is always running on the computer to handle the events when an X10 event is detected written in Visual Basic.  The other is a WebPage written with Visual Web Developer with CodeBehind in Visual Basic. 

When I run only the Visual Basic program, all is fine.  It receives X10 commands (sent by remote controls or motion detectors) and executes fine.

When I run the webpage (VB program still running) and have it send X10 commands, the VB program sees the X10 commands and responds.  But when I exit the Webpage, the VB program stops seeing X10 events from the remote.  Exiting the webpage or stopping and starting the VB program doesn't correct this.  I have to reboot the computer.

Here is the code I use in both the VB program and Webpage to use ActiveHome X10:

 

Both use:

Dim WithEvents ActiveHomeObj As ActiveHome

...

 



 

 

The Webpage sends X10 commands by:

ActiveHomeObj = CreateObject("X10.ActiveHome")

ActiveHomeObj.SendAction("sendplc", "a10 on")

ActiveHomeObj = Nothing

 

The VB program that handles the events has:

Sub ActiveHome_RecvAction(ByVal bszRecv As Object _

, ByVal v1 As Object _

, ByVal v2 As Object _

, ByVal v3 As Object _

, ByVal v4 As Object _

, ByVal v5 As Object _

, ByVal vRes As Object) Handles ActiveHomeObj.RecvAction

 

(code to handle events)

 

end sub

 

 

Any suggestions?

I should have noted that I have included the reference for ActiveHome in the both programs.

 
Also, this problem does not happen when I run the webpage with Visual Web Developer debugging using the local host...only when I run the webpage in the normal way with a browser.
Logged

-Bill- (of wgjohns.com)

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 81
  • Posts: 1340
  • He's just this guy. You know?
    • wgjohns.com
Re: Problem with multiple programs using ActiveHome
« Reply #1 on: March 26, 2008, 09:59:16 PM »

John_Mac,

Have you made sure that both programs appropriately release their hold on the X10 object before closing?

The development software will frequently do that for you while you're running within it, but when running stand-alone, the program may not do this when it closes unless you explicitly tell it to.
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.