Please login or register.

Login with username, password and session length

Author Topic: looking for good visual basic example  (Read 23097 times)

russ

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 9
looking for good visual basic example
« on: January 06, 2006, 07:04:56 PM »

Has anyone found a good visual basic
example. Any help would be great!
Logged

quadrabyte

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 4
Re: looking for good visual basic example
« Reply #1 on: January 06, 2006, 11:52:33 PM »

Russ,

I was able to build a VB.Net application
based on the Interop.ActiveHomeScriptLib that
Visual Studio 2005 created automatically for
me. It took all of about 15 minutes to get
control of my universal on/off units (forget
the model number of those puppies). Very
easy. I can't post the project stuff here but
drop me an email and I'll be happy to zip it
up and send it.
Logged

quadrabyte

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 4
Re: looking for good visual basic example
« Reply #2 on: January 06, 2006, 11:55:40 PM »

Hey, Russ, just occurred to me that you don't
know how to 'drop me an email' without my
email address. I think I will get email
notices of any replies to this message, so
try that first.

Logged

russ

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 9
Re: looking for good visual basic example
« Reply #3 on: January 07, 2006, 03:41:31 PM »

quadrabyte,
Thanks but not sure I have VB.Net????
What I have is VB6.0
Logged

quadrabyte

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 4
Re: looking for good visual basic example
« Reply #4 on: January 08, 2006, 11:27:57 AM »

Russ,

I think everything in this very simple form
is VB6 compatible (or very close). I'll try
simply pouring the text into this reply so
you can copy/paste it into your VS6 tool. My
email address is quadrabyte@gmail.com if you
want to contact me directly for the code.
You'll need to add a reference to the
ActiveHomeScriptLib.dll to get things to link.

Here's the content of the form:
Public Class Form1

Private WithEvents _oActiveHomeController
As New ActiveHomeScriptLib.ActiveHome

Private Sub Button1_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Try
If _oActiveHomeController Is
Nothing Then
_oActiveHomeController = New
ActiveHomeScriptLib.ActiveHome
End If

send(TextBox1.Text,
TextBox2.Text, TextBox3.Text, TextBox4.Text)

Catch ex As Exception
MsgBox(ex.Message)
End Try

End Sub

Private Sub
_oActiveHomeController_RecvAction(ByVal
bszAction As Object, ByVal bszParm1 As
Object, ByVal bszParm2 As Object, ByVal
bszParm3 As Object, ByVal bszParm4 As Object,
ByVal bszParm5 As Object, ByVal bszReserved
As Object) Handles
_oActiveHomeController.RecvAction
receive(bszAction, bszParm1,
bszParm2, bszParm3)
End Sub

Private Sub send(ByVal bszAction As
Object, ByVal bszParm1 As Object, ByVal
bszParm2 As Object, ByVal bszParm3 As Object)

_oActiveHomeController.SendAction(bszAction,
bszParm1)
ListBox1.Items.Add("<< " &
bszAction.ToString & " " & bszParm1.ToString
& " " & bszParm2.ToString & " " &
bszParm3.ToString)
End Sub

Private Sub receive(ByVal bszAction As
Object, ByVal bszParm1 As Object, ByVal
bszParm2 As Object, ByVal bszParm3 As Object)
ListBox1.Items.Add(">>     " &
bszAction.ToString & " " & bszParm1.ToString
& " " & bszParm2.ToString & " " &
bszParm3.ToString)
End Sub
End Class
Logged

marc

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 13
Re: looking for good visual basic example
« Reply #5 on: January 12, 2006, 01:19:02 AM »

Russ,
Try this example. I've stashed the .vbp,etc
files in a zip file at
http://members.cox.net/marcland/. It's in VB
6, and it's a single form. When the form
loads, it generates 16 on/off buttons (for
unit codes), and a combo-box for selecting
the house code. Nothing fancy: no dimming or
RF, but it should give you a decent example
of using VB to send PLC and to listen the
what the CM15a hears.
Good luck.
Logged

russ

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 9
Re: looking for good visual basic example
« Reply #6 on: January 12, 2006, 07:38:13 AM »

Marc,
Great example will provide me with a good
start. Do you know why there are at least
three log entries when a motion detector is
triggered? Is there a way to only get one?
I want to set it up so when the motion is
detected it will trigger something and if
it records it three times it will trigger
it three times, any advise? Thanks for your
help!
Logged

marc

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 13
Re: looking for good visual basic example
« Reply #7 on: January 13, 2006, 12:44:29 AM »

Russ,
Very good question. I don't have a clue. As
you've likely seen mentioned in this forum,
x10 has done a poor job of providing
documentation. So why there are three log
entires (or three signals sent per action),
or sometimes only two, and what the -1 or 0
mean, I just don't know.

At least they come very fast. Here's a few
simple thoughts you probably already
considered, but just in case:

1) study the patterns of signals you get
when your motion detector is  triggered.
Even if there are 3 signals, is the one with
the, say, the -1 flag always there, and
always there only once? If so, use that as
your trigger.

2) Always store parameters from the last 3-9
events, and compare the event times. Reject
anything that occured within 2 seconds (or
anytime you choose) of the last set of
signals

3) Use a VB timer to lock out the trigger
for the time period of your choosing.

Anyway, my two cents. Good luck!
Logged

marc

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 13
Re: looking for good visual basic example
« Reply #8 on: January 13, 2006, 12:55:35 AM »

Russ,
Ooops, my apologies. I just noticed there is
some info in the ahscript.chm help file in
the folder C:\Program Files\AHSDK\help (at
least that's where it is on my PC). Look in
the section on Using the Scripting
Interface. Apparently the 0,1, -1 is key
data (key up, key down, etc) . What does
that mean for a motion sensor? I dunno...
Logged

russ

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 9
Re: looking for good visual basic example
« Reply #9 on: January 13, 2006, 07:48:39 AM »

Marc,
Again thanks for your help all good
suggestions, I will continue to try and
find solution. If you think of any thing
else please let me know.
Logged

sport

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 2
Re: looking for good visual basic example
« Reply #10 on: February 19, 2006, 02:24:34 PM »

quadrabyte  could you sent this to me?
Logged

chrisatwan

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 2
Re: looking for good visual basic example
« Reply #11 on: December 16, 2010, 07:46:20 PM »

I am trying to read a CM19A into PC with VB6. I tried the http://members.cox.net/marcland/ link but said it didn't exist anymore. I know this is a while ago but does anyone have any VB6 expience with a CM19A?

Regards,
Christopher
Logged

EL34

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 278
    • My X-10 projects
Re: looking for good visual basic example
« Reply #12 on: January 06, 2011, 07:06:15 PM »

I have VB 2008 express example program, not VB6
See my Sig
Logged
W10 - CM15A - AHP 3.301 - i Witness - MyHouse online - Smart Macros - SDK using Visual Basic express 2008
My X10 page-> http://www.el34world.com/Misc/home/X10_0.htm
 

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