Velleman support

BlitzMax Forums/BlitzMax Programming/Velleman support

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I have just added code to support the velleman vm110 usb interface board.

http://www.maplin.co.uk/Module.aspx?C=Newsletter&U=06P11-2toys&ModuleNo=42857&T=461694

Specifications:
5 digital inputs (0= ground, 1= open) (on board test buttons provided)
2 analogue inputs with attenuation and amplification option (internal test +5V provided)
8 digital open collector output switches (max. 50V/100mA) (on board LED indication)
2 analogue outputs 0 to 5V, output resistance 1K5Ω PWM 0 to 100% open collector outputs max 100mA/40V (on board LED indication)
General conversion time 20ms per command
Power supply through USB approx. 70mA
Dimensions 145 x 88 x 20mm
Diagnostic software with DLL included

Global	DllHandle:Int=LoadLibraryA("K8055D_C.DLL")

	Global ClearAllAnalog()"Win32"=GetProcAddress( DllHandle, "_ClearAllAnalog@0" )
	Global ClearAllDigital()"Win32"=GetProcAddress( DllHandle, "_ClearAllDigital@0" )
	Global ClearAnalogChannel( Channel:Int )"Win32"=GetProcAddress( DllHandle,"_ClearAnalogChannel@4" )
	Global ClearDigitalChannel( Channel:Int )"Win32"=GetProcAddress( DllHandle,"_ClearDigitalChannel@4" )
	Global CloseDevice()"Win32"=GetProcAddress( DllHandle, "_CloseDevice@0" )
	Global OpenDevice:Int( CardAddress:Int )"Win32"=GetProcAddress( DllHandle, "_OpenDevice@4" )
	Global OutputAllAnalog( Data1:Int , Data2:Int )"Win32"=GetProcAddress( DllHandle,"_OutputAllAnalog@8" )
	Global OutputAnalogChannel( Channel:Int , Data:Int )"Win32"=GetProcAddress( DllHandle,"_OutputAnalogChannel@8" )
	Global ReadAllAnalog( Data1:Int Ptr, Data2:Int Ptr )"Win32"=GetProcAddress( DllHandle,"_ReadAllAnalog@8" )
	Global ReadAllDigital:Int()"Win32" = GetProcAddress( DllHandle,"_ReadAllDigital@0" )
	Global ReadAnalogChannel:Int( Channel:Int )"Win32"=GetProcAddress( DllHandle,"_ReadAnalogChannel@4" )
	Global ReadCounter:Int( CounterNr:Int )"Win32"=GetProcAddress( DllHandle,"_ReadCounter@4" )
	Global ReadDigitalChannel:Int( Channel:Int )"Win32"=GetProcAddress( DllHandle,"_ReadDigitalChannel@4" )
	Global ResetCounter( CounterNr:Int )"Win32"=GetProcAddress( DllHandle,"_ResetCounter@4" )
	Global SearchDevices:Int()"Win32"=GetProcAddress( DllHandle, "_SearchDevices@0" )
	Global SetAllAnalog()"Win32"=GetProcAddress( DllHandle,"_SetAllAnalog@0" )
	Global SetAllDigital()"Win32"=GetProcAddress( DllHandle,"_SetAllDigital@0" )
	Global SetAnalogChannel( Channel:Int )"Win32"=GetProcAddress( DllHandle,"_SetAnalogChannel@4" )
	Global SetCounterDebounceTime( CounterNr:Int, DebounceTime:Int )"Win32"=GetProcAddress( DllHandle,"_SetCounterDebounceTime@8" )
	Global SetCurrentDevice:Int( CardAddress:Int )"Win32"=GetProcAddress( DllHandle, "_SetCurrentDevice@4" )
	Global SetDigitalChannel( Channel:Int )"Win32"=GetProcAddress( DllHandle,"_SetDigitalChannel@4" )
	Global Version()"Win32"=GetProcAddress( DllHandle,"_Version@0" )
	Global WriteAllDigital( Data:Int )"Win32"=GetProcAddress( DllHandle,"_WriteAllDigital@4")