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
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
Osler