help needed VB6 ActiveX dll

Pop your questions regarding Home automation software here.....
Post Reply
martijn
Starting Member
Starting Member
Posts: 2
Joined: Fri Oct 22, 2010 12:30 pm

help needed VB6 ActiveX dll

Post by martijn »

Hi all,

I've been looking for a few hours now and then I thought, perhaps someone here might be able to help me out a lot easier.
I'm looking for an activeX dll to controll a Velleman VM110 / K8055 from vbscript (or other scripting languages by use of the com object).

I found 1 version but it didnt expose all the methods correctly which renders the whole thing useless (I cannot switch single relais off with it)
Then i found another forum where someone tried (and did) the same thing.
He managed to create a simple VB6 wrapper dll and posted the source code, but I don't have VB6, nor do I know how to recreate that dll.

I have VB2010 Express installed here, but I cannot find a way to create COM accessable dll's with it.
So my question is: Does anyone have VB installed and could someone perhaps help me by compiling this code for me?

http://forum.velleman.eu/viewtopic.php? ... 93&p=11372

Copy paste from the post in question:
I created an ActiveX wrapper in VB6 and use it in ASP pages, vbscripts and HTML applications (.hta).
Here is the source for the wrapper. I called my DLL USB8055 and the class ZAP8055

Code: Select all

Option Explicit
Private Declare Function OpenDevice Lib "k8055d.dll" (ByVal CardAddress As Long) As Long
Private Declare Sub CloseDevice Lib "k8055d.dll" ()

Private Declare Function ReadAnalogChannel Lib "k8055d.dll" (ByVal Channel As Long) As Long
Private Declare Sub ReadAllAnalog Lib "k8055d.dll" (Data1 As Long, Data2 As Long)
Private Declare Sub OutputAnalogChannel Lib "k8055d.dll" (ByVal Channel As Long, ByVal Data As Long)
Private Declare Sub OutputAllAnalog Lib "k8055d.dll" (ByVal Data1 As Long, ByVal Data2 As Long)
Private Declare Sub ClearAnalogChannel Lib "k8055d.dll" (ByVal Channel As Long)
Private Declare Sub SetAllAnalog Lib "k8055d.dll" ()
Private Declare Sub ClearAllAnalog Lib "k8055d.dll" ()
Private Declare Sub SetAnalogChannel Lib "k8055d.dll" (ByVal Channel As Long)

Private Declare Sub WriteAllDigital Lib "k8055d.dll" (ByVal Data As Long)
Private Declare Sub ClearDigitalChannel Lib "k8055d.dll" (ByVal Channel As Long)
Private Declare Sub ClearAllDigital Lib "k8055d.dll" ()
Private Declare Sub SetDigitalChannel Lib "k8055d.dll" (ByVal Channel As Long)
Private Declare Sub SetAllDigital Lib "k8055d.dll" ()
Private Declare Function ReadDigitalChannel Lib "k8055d.dll" (ByVal Channel As Long) As Boolean
Private Declare Function ReadAllDigital Lib "k8055d.dll" () As Long

Private Declare Function ReadCounter Lib "k8055d.dll" (ByVal CounterNr As Long) As Long
Private Declare Sub ResetCounter Lib "k8055d.dll" (ByVal CounterNr As Long)
Private Declare Sub SetCounterDebounceTime Lib "k8055d.dll" (ByVal CounterNr As Long, ByVal DebounceTime As Long)

Private Declare Function SearchDevices Lib "k8055d.dll" () As Long
Private Declare Function SetCurrentDevice Lib "k8055d.dll" (ByVal Address As Long) As Long
Private Declare Sub Version Lib "k8055d.dll" ()
'Opens the communication link to the K8055 device
Public Function Open_Device(CardAddress As Long) As Long
Open_Device = OpenDevice(CardAddress) 'rs
End Function

'Closes the link to the K8055 device
Public Sub Close_Device()
CloseDevice
End Sub

'Reads the status of one analogue input-channel
Public Function Read_AnalogChannel(ByVal Channel As Long) As Long
Read_AnalogChannel = ReadAnalogChannel(Channel)
End Function

'Reads the status of both analogue input-channels
Public Sub Read_AllAnalog(Data1 As Long, Data2 As Long)
ReadAllAnalog Data1, Data2
End Sub

'Sets the analogue output channel according to the Data
Public Sub Output_AnalogChannel(ByVal Channel As Long, ByVal Data As Long)
OutputAnalogChannel Channel, Data
End Sub

'Sets both analogue output channels according to the Data
Public Sub Output_AllAnalog(ByVal Data1 As Long, ByVal Data2 As Long)
OutputAllAnalog Data1, Data2
End Sub

'Sets the analogue output channel to minimum
Public Sub Clear_AnalogChannel(ByVal Channel As Long)
ClearAnalogChannel Channel
End Sub

'Sets all analogue output channels to maximum
Public Sub Set_AllAnalog()
SetAllAnalog
End Sub

'Sets all analogue output channels to minimum
Public Sub Clear_AllAnalog()
ClearAllAnalog
End Sub

'Sets the analogue output channel to maximum
Public Sub Set_AnalogChannel(ByVal Channel As Long)
SetAnalogChannel Channel
End Sub

'Sets the digital outputs according to the data
Public Sub Write_AllDigital(ByVal Data As Long)
WriteAllDigital Data
End Sub

'Clears the output channel
Public Sub Clear_DigitalChannel(ByVal Channel As Long)
ClearDigitalChannel Channel
End Sub

'Clears all output channels
Public Sub Clear_AllDigital()
ClearAllDigital
End Sub

'Sets the output channel
Public Sub Set_DigitalChannel(ByVal Channel As Long)
SetDigitalChannel (Channel)
End Sub

'Sets all output channels
Public Sub Set_AllDigital()
SetAllDigital
End Sub

'Reads the status of the input channel
Public Function Read_DigitalChannel(ByVal Channel As Long) As Boolean
Read_DigitalChannel = ReadDigitalChannel(Channel)
End Function

'Reads the status of all the input channels
Public Function Read_AllDigital() As Long
Read_AllDigital = ReadAllDigital
End Function

'Reads the content of the pulse counter number 1 or counter number 2
Public Function Read_Counter(ByVal CounterNr As Long) As Long
Read_Counter = ReadCounter(CounterNr)
End Function

'Resets the 16 bit pulse counter number 1 or counter number 2
Public Sub Reset_Counter(ByVal CounterNr As Long)
ResetCounter CounterNr
End Sub

'Sets the debounce time to the pulse counter
Public Sub Set_CounterDebounceTime(ByVal CounterNr As Long, ByVal DebounceTime As Long)
SetCounterDebounceTime CounterNr, DebounceTime
End Sub

'Returns all connected devices as bit field
'bin 0000, dec 0 - No devices found
'bin 0001, dec 1 - card address 0 found
'bin 0010, dec 2 - card address 1 found
'bin 0100, dec 4 - card address 2 found
'bin 1000, dec 8 - card address 3 found
'e.g. value 9 = card 0 and card 3 connected
Public Function Search_Devices() As Long
Search_Devices = SearchDevices
End Function

'Set the current controlled device 0 thru 3. Returns device address or -1 if specified address not found
Public Function Set_CurrentDevice(ByVal Address As Long) As Long
Set_CurrentDevice = SetCurrentDevice(Address)
End Function

'Pops up window showing DLL version info
Public Sub DLL_Version()
Version
End Sub

Thanks a lot for anyone who can help me with this.

Martijn
pleaseask
Member
Member
Posts: 84
Joined: Fri May 23, 2008 9:33 pm
Location: Netherlands

Re: help needed VB6 ActiveX dll

Post by pleaseask »

Hi Martijn,

Take a look at the following site: http://www.vellemanusa.com/us/enu/download/files/
Scroll down and you will find :
==================================
K8055/VM110: USB EXPERIMENT INTERFACE BOARD
Software development utilities and examples:

k8055dll_rev3_0_2.zip
New DLL (rev 3.0.2) file for K8055 & VM110, with Windows Vista support. Also special Microsoft VC++ version and executable examples.
k8055_dll_2_001.zip
DLL rev 2 with examples and soure code (this source can be uses also with DLL Rev 3.)
k8055_graphical_demo.zip
Graphical DEMO in Visual Basic with soure code
k8055_vc2005.zip
Software example for VC 2005
demo_install_package.zip
Installable DEMO Package w/o source code
k8055_source_code.zip
Source code files for Borland C++ builder, Visual Basic 6.0 and Delphi 6.x
chk8055d_c-1.0.0.zip
Source code for C/C++ Interpreter Ch for more information about Ch: http://www.softintegration.com/products ... n/#chk8055
labview8_k8055.zip
3rd. party, National Instruments Labview driver for the K8055 board
======

Regards.. pleaseask
Homeseer 3 Pro on Windows 10 / Zwave

Edwin.
Post Reply

Return to “Questions & Discussions Forum”