Integrate the Vellmen V110 board into HouseBot

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Integrate the Vellmen V110 board into HouseBot

Post by Osler »

I have worked on this with PT and have come up with a serviceable way to integrate the Velleman V110 USB board into HouseBot.

http://www.vellemanusa.com/us/enu/produ ... ?id=522053

I have used an ActiveX DLL to enable VBscript to use API calls to the VM110 K8055.dll. Currently the only problem encountered by PT is that when setting a single output (analog or digital) all others are reset as well. This is a problem in the K8055.dll as far as I can tell. However, PT seems to have been able to work around this with scripting.

Available methods:

Code: Select all

DLL Name: VM110ScriptingInterface
     Class Name: VM110

OpenCard(ByVal CardAddress As Long)

CloseCard()

AllAnalogOn()

AllAnalogOff()

AllDigitalOn()

AllDigitalOff()

AnalogChannelOutput(ByVal Channel As Long, ByVal Data As Long)
 - Channel must be 1 or 2
 - Data must be from 0 to 255

AnalogOutputAll(ByVal Data1 As Long, ByVal Data2 As Long)
 - Data1 and Data 2 must be from 0 to 255

AnalogChannelClear(ByVal Channel As Long)
 - Channel must be 1 or 2

AnalogChannelSet(ByVal Channel As Long)
 - Channel must be 1 or 2

WriteDigitalAll(ByVal Data As Long)
 - Data must be from 0 to 255

DigitalChannelSet(ByVal Channel As Long)
 - Channel must be 1, 2, 3, 4, 5, 6, 7, or 8

CounterReset(ByVal CounterNumber As Long)
 - CounterNumber must be 1 or 2

CounterDebounceTime(ByVal CounterNumber As Long, ByVal DebounceTime As Long)
 - CounterNumber must be 1 or 2
 - DebounceTime must be from 0 to 5000

AnalogChannelRead(ByVal Channel As Long) As Long
 - Channel must be 1 or 2
 - Use to populate a variable

DigitalChannelRead(ByVal Channel As Long) As Boolean
 - Channel must be 1, 2, 3, 4, or 5
 - Use to populate a variable

CounterRead(ByVal CounterNumber As Long) As Long
 - CounterNumber must be 1 or 2
 - use to populate a variable
Sample Script:

Code: Select all

Dim Analog(1)
Dim Digital(4)

'create the object
Set Control = CreateObject("VM110ScriptingInterface.VM110")

'open the specific card with jumpers set to address 0
Control.OpenCard(0)

Dim I

'Read the analog channels
For I = 0 to 1

Analog(I) = Control.AnalogChannelRead(I + 1)

MsgBox "Analog Channel " & I & "= " & Analog(I)

Next

'Read the digital channels
For I = 0 to 4

Digital(I) = Control.DigitalChannelRead(I + 1)

MsgBox "Digital Channel " & I & " is " & Digital(I)

Next

'set all the analog outputs to +5V
Control.AllAnalogOn

'set all the digital outputs to +5V
Control.AllDigitalOn

'set all analog outputs to 0V
Control.AllAnalogOff

'set all digital outputs to 0V
Control.AllDigitalOff

'set the analog output channel 1 to 3.5V
Dim Setting

Setting = (3.5/5) * 255

Control.AnalogChannelOutput(1, Setting)

'clear analog channel 1
Control.AnalogChannelClear(1)

'set all analog output channels to 3.5V
Control.AnalogOutputAll(Setting, Setting)

'close the interface to the card
Control.CloseCard

'clean up
Set Control = Nothing
I do not own this particular board so PT will be the best one to ask questions regarding interfacing it to HouseBot. Enjoy.

Osler
Attachments
VM110ScriptingInterface.zip
(181.82 KiB) Downloaded 528 times
Steve Horn
HouseBot Guru
Posts: 757
Joined: Wed Apr 02, 2003 8:10 pm
Location: Pelham AL

Re: Integrate the Vellmen V110 board into HouseBot

Post by Steve Horn »

OK, I'm back to the point of wanting to use the Velleman K8055/VM110 to control some relays. I've read the threads (this one and another) about controlling relays and unfortunately wandered off into a sub-thread about creating plugins. :? That's where I got lost. For those that are using the VM110 and presumably the supplied K8055.DLL, what in addition is needed for HB to be able to control the innies and outies on the card using VBScript? From Osler's post above it looks like all that is needed is his attachment - vm110scriptinginterface. Is that right? (I have not sprung for the card yet - want be reasonably sure software involvement won't be over my head.)
Steve
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Re: Integrate the Vellmen V110 board into HouseBot

Post by Osler »

I don't use the card myself so I can't help too much. I think all you require is the board, the dll, and the activex control, though. Hopefully someone else will chime in.

Osler
raptor_demon
Senior Member
Posts: 141
Joined: Tue Jul 07, 2009 12:55 pm
Location: NC

Re: Integrate the Vellmen V110 board into HouseBot

Post by raptor_demon »

Hi,

I used this:
viewtopic.php?f=4&t=856438&p=449296&hilit=K8055#p449296

and it controlls my K8055 no problems, i am going to attach it to water valves later this year for an irrigation system.

Raptor
Steve Horn
HouseBot Guru
Posts: 757
Joined: Wed Apr 02, 2003 8:10 pm
Location: Pelham AL

Re: Integrate the Vellmen V110 board into HouseBot

Post by Steve Horn »

Raptor_demon: Just the K8055D.dll found in your reply link or do you use/need the K8055.dll that is supplied with the board too?

Related: I thought about using some type of relay board (Velleman or Phidgets) to control sprinklers too. But I could see any advantage other than having the control UI on HB over what are now reasonably cheap dedicated sprinkler controllers that one might stick in a closet or basement somewhere. Maybe its just the challenge of doing it that way :wink:
Steve
lostdreamer
Member
Posts: 54
Joined: Sat Apr 18, 2009 8:53 pm

Re: Integrate the Vellmen V110 board into HouseBot

Post by lostdreamer »

@steve: I didnt use the K8055.dll file when creating the plugin so I dont know if it's compatible with the K8055D I used.
Download the K8055D.dll and put it in your windows folder, the DotNetBridge, and the plugin for the VM110 / K8055

You do not need the K8055.dll at all.

Regards,
LostDreamer
Steve Horn
HouseBot Guru
Posts: 757
Joined: Wed Apr 02, 2003 8:10 pm
Location: Pelham AL

Re: Integrate the Vellmen V110 board into HouseBot

Post by Steve Horn »

LostDreamer, thanks. I've ordered the K8055 and downloaded what I think are the required DLLs etc. Lets see how much trouble I can get in...
Steve
Steve Horn
HouseBot Guru
Posts: 757
Joined: Wed Apr 02, 2003 8:10 pm
Location: Pelham AL

Re: Integrate the Vellmen V110 board into HouseBot

Post by Steve Horn »

Ok, I'm totally lost :oops: . Got the K8055 board, built it, tested it with their included program. All is well. Now how do I use it inside or outside of HB? I started off reading all the threads related to the Vm110/K8055 and tried to use VBScript (sample script attached in one of the posts) to do simple things (i.e. basically exercise the board using VBS). Tried putting several of the included/mentioned/attached DLLs (K8055D, HBK8055-VM100, DotNet, DotNetBridge, Vmscriptinginterface... you name it) into the Win32 subdir. then running the sample VBS. VBS is not liking the CreateObject step.
It seems like a lot of the posting reading is describing how to create code that will establish/create the VM100 board as a device within HB, and I'm getting lost in all the C#, compiling, etc. talk. To me, it looks like a VBS called from within HB as a script device, and reading or writing values to/from a null device would be all that's necessary to make use of the board from within HB. But more basic than that is I don't know what is required DLL-wise to allow me to control the board using VBS outside of HB. As I said at the top... lost. Excuse my ignorance.
Steve
raptor_demon
Senior Member
Posts: 141
Joined: Tue Jul 07, 2009 12:55 pm
Location: NC

Re: Integrate the Vellmen V110 board into HouseBot

Post by raptor_demon »

Hi,

I will get you more info on this tomorrow around how i made this work.

Raptor
raptor_demon
Senior Member
Posts: 141
Joined: Tue Jul 07, 2009 12:55 pm
Location: NC

Re: Integrate the Vellmen V110 board into HouseBot

Post by raptor_demon »

Ok

I used this plugin:
viewtopic.php?f=4&t=856438&p=449296&hilit=K8055#p449296

be sure you install the VB.net from here :
viewtopic.php?f=4&t=856395#p448493


the files go in the following locations:
HB k8055-vm110.dll goes in C:\Program Files\HouseBot\Plugins\Devices
HBDotNetBridge.dll goes in C:\Program Files\HouseBot\Plugins\Devices
HBDotNet.dll goes in C:\Program Files\HouseBot

Do all of this with housebot closed.

Load housebot and you should see the devices load on startup.

When housebot has loaded and assuming there are no errors, goto devices -> add new device -> Software device -> Velleman K8055

and you should see the attached image.

Let me know if this does not do the trick.

Raptor
Attachments
k8055.jpg
k8055.jpg (50.82 KiB) Viewed 6986 times
Steve Horn
HouseBot Guru
Posts: 757
Joined: Wed Apr 02, 2003 8:10 pm
Location: Pelham AL

Re: Integrate the Vellmen V110 board into HouseBot

Post by Steve Horn »

Raptor, that's EXACTLY what I needed to know! And it works like a champ.
I glad that you were able and willing to document the whole thing as concisely as that. When I read through all the earlier threads and posts, nowhere did it come clear to me what was being done and what the result was to be. Now I have a better, though not great, understanding of what was being described. With your posting, anyone in the future wanting to integrate the Velleman board into HB will be able to easily see how its done.
Thanks! :D :D :D
Steve
raptor_demon
Senior Member
Posts: 141
Joined: Tue Jul 07, 2009 12:55 pm
Location: NC

Re: Integrate the Vellmen V110 board into HouseBot

Post by raptor_demon »

Hi Steve,

Glad you got it working, it took me a few tries to get it right. I have not even connected the board to anything yet.... but that will come :)

Hope it all works out

Raptor
Post Reply