Please login or register.

Login with username, password and session length
Pages: 1 [2]

Author Topic: Super Simple VB6 script for triggering?  (Read 26167 times)

EL34

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 278
    • My X-10 projects
Re: Super Simple VB6 script for triggering?
« Reply #15 on: November 19, 2008, 09:21:07 AM »

Sure, but I would have to pluck sections out of the middle of programs, which I cannot verify run by just pasting them.

There isn't too much to the x10 stuff.

I showed you how to read the x10 traffic, the only thing left is to turn on/ off x10 devices and do queries
I don't ever use dimming or extended codes, so I don't have anything for those functions.

What do you need?
« Last Edit: November 19, 2008, 09:22:54 AM by EL34 »
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

jrwhit

  • Full Member
  • ***
  • Helpful Post Rating: 2
  • Posts: 39
Re: Super Simple VB6 script for triggering?
« Reply #16 on: November 19, 2008, 02:09:12 PM »

Starting off, what is the simplest code to turn A1 and A4 on - wait 20 seconds and then turn both back off.
Gotta start somewhere. Thanks
Logged

EL34

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 278
    • My X-10 projects
Re: Super Simple VB6 script for triggering?
« Reply #17 on: November 19, 2008, 03:33:57 PM »

Assuming you are adding this to my existing x10 traffic monitor that already works and has the proper references to the active home .dll

I assume you know how to add things in the designer by looking at all the tools

In Vb2008 you will have to add a timer to your program
It will be called timer1 automatically

Put this code in the form load area after you add timer1 to your form in the designer
1000 = 1 second, so 20000 is 20 seconds
You don't want the timer on yet so you set it to false

       Timer1.Interval = 20000
       Timer1.Enabled = False



If you are going to turn on A4 with a button, you will have to add a button also in the designer screen
When you double click on the button in the designer, it will take you to a click event for that button
Insert whatever code you want to happen when you click that button
You will also now turn on timer one and it will start it's 20 second countdown

This is the command to turn on A4

      ActiveHomeObj.SendAction("sendplc", "A4 on")
       Timer1.Enabled = true

when timer1 finishes the 20 seconds it will go to the timer1 event
put the code in there that turns off A4 and turns off the Timer1

       ActiveHomeObj.SendAction("sendplc", "A4 off")
       Timer1.Enabled = true



I am not near my VB computer.
I will check back and if you have trouble, i will add the code to my X10 traffic monyir program and post another copy here.

see ya
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

jrwhit

  • Full Member
  • ***
  • Helpful Post Rating: 2
  • Posts: 39
Re: Super Simple VB6 script for triggering?
« Reply #18 on: November 19, 2008, 04:20:37 PM »

If you have time please post the new code. I have to get to work. Got bills to pay you know.
Logged

EL34

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 278
    • My X-10 projects
Re: Super Simple VB6 script for triggering?
« Reply #19 on: November 20, 2008, 06:58:37 AM »

I added to my existing x10 monitor test program so you can see all the different items and how they work
Like how buttons, labels, timers, notify icons, tool strips, etc

I added a notify icon that sends the program to the tray. You click on the tray icon to bring back the window
I added a tool bar

A1 and A4 will go on for 20 seconds when you click the button.

I don't know if I would use A1 if I were you, unless you want all lights on.
If you want some other code change A1 to whatever

I left the G16 on/off/query section just cause it's useful to see how that works.

The textx10.zip file is located here
http://www.el34world.com/Misc/home/Files/testx10.zip

unzip the attachment and open the testx10.sln file in VB 2008 express
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

jrwhit

  • Full Member
  • ***
  • Helpful Post Rating: 2
  • Posts: 39
Re: Super Simple VB6 script for triggering?
« Reply #20 on: November 21, 2008, 03:36:37 AM »

Much thanks for helping a newbie.  :)%
A couple more questions. Why would you not use A1? It was the first module installed in the house and runs a lamp. Isn't A1 just like any other address?
Also, can you help with the syntax of turning a module on at certain times or for certain days, example -  turn A4 on at 12:20 AM Monday through Friday.
P.S. I'm sure others are wondering why not just use AHP software. I can and do, but want to know what goes on behind the GUI.
Logged

EL34

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 278
    • My X-10 projects
Re: Super Simple VB6 script for triggering?
« Reply #21 on: November 21, 2008, 06:32:53 AM »

Only because A1 is used as the default for several x10 devices.

You would have to write code that monitored the time to be able to turn things on and off at certain times.
I don't have any code snippets for that.

I only use AHP for two macros because it seems to do the time thing ok, and I haven't gotten around to writting code that replaces those macros.
I am not running AHP, I load the macros into the CM15A and shut down AHP

I have a dehumidifier that comes on at 1 am and off at 3 am in my garge every day.
And I have another macro that turns on a fake module at dusk and off at dawn.
That one is way harder to code than just coming on at a certain time.

So I let the CM15A handle those two macros and I do all the rest with my software.
« Last Edit: November 23, 2008, 07:21:58 PM by EL34 »
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

EL34

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 278
    • My X-10 projects
Re: Super Simple VB6 script for triggering?
« Reply #22 on: November 30, 2008, 07:54:41 AM »

JR, were you able to get my vb8 project open and working?
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

jrwhit

  • Full Member
  • ***
  • Helpful Post Rating: 2
  • Posts: 39
Re: Super Simple VB6 script for triggering?
« Reply #23 on: November 30, 2008, 11:31:53 AM »

Works fine. Thanks, EL34. Although VB 2008 Express seems like a strange beast compared to what I remembered of VB6.
I'm currently working on an HTA (HyperText Application) to control my X10 modules. If anyone's interested in seeing it, I'll post it when I get it cleaned up a little.
Logged

EL34

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 278
    • My X-10 projects
Re: Super Simple VB6 script for triggering?
« Reply #24 on: December 04, 2008, 10:30:23 AM »

okey doke
just checking to make sure you got it to fly
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
Pages: 1 [2]
 

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