Create Hardware Interface Plugin in VB?

HouseBot Plugin Development Discussions.
Automate

Create Hardware Interface Plugin in VB?

Post by Automate »

I had seen that you have a Visual Basic Device Plugin SDK. I had not noticed that it was for devices only. Is there any way to create a Hardware Interface Plugin in VB?



Thanks
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

The COM/VB Device Plugin was created by Peter Zandvoort. As far as I know, he did not create a COM Hardware Interface plugin as well.



If you are interested in creating a Hardware Interface Plugin, Peter may be willing to share the source with you as a reference. Let me know.



Scott
pzand
Member
Posts: 10
Joined: Tue Jun 10, 2003 8:43 am

Post by pzand »

Automate,



I'm not sure why I never extended this to include hardware devices. I suppose I just never had the need :)

It's been a while, but I'll look at it... Meanwhile, I'd be happy to share the source with you. It's done in VC6...



Peter
Automate

Post by Automate »

Peter,



My C programming skills are not very good so I don't think I could do much with your code. Thanks for the offer. Hopefully you can find time to make the changes. Thanks again.
pzand
Member
Posts: 10
Joined: Tue Jun 10, 2003 8:43 am

Post by pzand »

What are you trying to achieve? Is there any way you can do it through a software device?
Automate

Post by Automate »

I would like to get temperature readings from a 1-wire network similar to http://www.ibutton.com/weather/ . I guess I could use the Generic Serial control and then use a VB Scripting device but I thought using a Hardware Interface Plugin would be cleaner, better approach.
pzand
Member
Posts: 10
Joined: Tue Jun 10, 2003 8:43 am

Post by pzand »

Cool project 8)



I think the advantage of the hardware interfaces comes from the fact that different software devices are able to use the same hardware interface. A hardware interface would be the 1-wire port, and you could have various software devices that are connected to that 1-wire port (basically making it a bus). If you will only have 1 device (and only 1 type of device) on the port ever, it really doesn't matter much. Might as well combine the HW and SW logic into one. You'll always have to write a SW device since it's the SW device that publishes the data to HouseBot.



I did the same thing for my TV. It has a serial port, so I wrote a HW device that speaks the protocol. Then I wrote a SW device that uses the HW device to talk to the TV. Seems very flexible, until you realize that the protocol is so specific that no other SW device will be able to use the HW device other than me. I might as well have put the serial port logic into the SW device.



So, although I agree that splitting it out is cleaner, I'd use just a SW device I think.



All that said, I *will* look into the HW part of a COM wrapper...
Automate

Post by Automate »

I also thought of using this software http://home.tiscali.no/henriksen/1-wire ... tatus.html to be the communications driver. It has a built in DDE server. So if I could write a DDE client driver for HouseBot, I could get the values that way. This would probably be more complicated than a serial driver but it would open up HouseBot to any DDE server application. http://www.applicom-int.com/us/applicom ... erver.html
pzand
Member
Posts: 10
Joined: Tue Jun 10, 2003 8:43 am

Post by pzand »

wow... this is a really cool project! I've been wanting to do something like this, but never got around to it.



It looks like there are a lot of ways to go about this. In all honesty, I think using DDE or UDP broadcasts is probably even easier than going the actual serial route. DDE works well locally, but with UDP broadcasts you can have the weather server running on a different machine than the housebot box (provided they're both in the same IP subnet). Both are VERY easy to implement in VB.



Did you build or buy your weather station?
Automate

Post by Automate »

DDE works across a network also, it's called NetDDE. It works well, I have used it at work. Here is a FAQ that talks about it. http://www.angelfire.com/biz/rhaminisys/ddeinfo.html



I do not have a weather station yet but I always have big plans. :D Who knows if I will ever get them implemented. Besides monitoring the outside weather I also want to monitor, record and control the inside temperature. Using the 1-wire network it is easy to connect a lot of temperature sensors. You just daisy chain them along a 2 conductor cable. I want to put a sensor in just about every room of my house and then use zoned heating and A/C to only send it to the rooms that need it. Also at night when we are sleeping I can heat/cool just the bedroom area. Something similar to this sourceforge project http://diy-zoning.sourceforge.net/ but without the Java/Linux.
pzand
Member
Posts: 10
Joined: Tue Jun 10, 2003 8:43 am

Post by pzand »

Hehehe... You have the same plans as I do. And (perhaps not unlike you) I may never get there! Gotta dream, though... :D

I did get to the point of hooking a DS1820 to a PIC16F84 and a little $5 RF transmitter. I was going to have a whole bunch of those and a receiver on the PC end... Yet another unfinished project :?



I did, a while back, write a SW device for HouseBot that pulls data from AWS WeatherBug. It gets you reasonable outside weather, *and* I did it to test my VB COM wrapper. I can email you a copy if you're interested.



Haven't had much time to look at the HW implementation on the VB side. My PC is very, VERY busy installing the whole .NET deal.... what a hog...
Automate

Post by Automate »

pzand wrote:I did, a while back, write a SW device for HouseBot that pulls data from AWS WeatherBug. It gets you reasonable outside weather, *and* I did it to test my VB COM wrapper. I can email you a copy if you're interested.
That would be great. Let me know if you don't still have my e-mail address
pzand
Member
Posts: 10
Joined: Tue Jun 10, 2003 8:43 am

Post by pzand »

Check you email...
MediaStorm
Member
Posts: 30
Joined: Sat Jun 28, 2003 1:58 pm

Post by MediaStorm »

Peter,



I'd also applaud your efforts to create an interface to the hardware plugin. I've got lots of ideas I'd like to play with but since I use Delphi I also need an interface as well.



I recently finished a serial control engine for the Kenwood DVD changers and would love to interface it with Housebot cleanly via the hardware plugin interface.



I'd also like to put together a hardware interface to 'The Link' for 1-wire interfacing and for Kenwood A/V receivers all of which really need more advanced interfacing than is currently possible in the generic serial interface.



Thanks.
pzand
Member
Posts: 10
Joined: Tue Jun 10, 2003 8:43 am

Post by pzand »

I have to admit I've been preoccupied with other things lately, which means I haven't done any coding on this. Sorry :?



Why couldn't you do this Delphi directly? All it takes is a DLL that exports the right functions... Probably easier than implementing a COM interface! I know Delphi can do this... VB can't 8)
Post Reply