Software support for the VM110N unit

Hi !

Please, let me put a question about the use of the 8055-DLL in LibertyBasic, more detailed compared with my earlier message.

I like to build some hardware to be controlled by your Velleman I/O-interface with the type VM110N. It is connected with my Windows8-PC by USB. The board itself functions ok, because the direct demo I can operate. I like to do the controlling software by LibertyBasic, in stead of for instance by C or other language, because I never used this. I have experience in working with LibertyBasic, but with the DLL something goes wrong.

I did some simple examples to test the DLL-use. Please see next small source. (so the K8055D.dll is used for the VM110N-board ). I did the experiments with the board connected to the PC as well as not connected.

[i]
open “K8055D.dll” for dll as #user

calldll #user,“setdigitalchannel”,(2)

close #user
[/i]

Doing a run the open-statement appears to be ok, but the call-one is not, becomes blue. I did some different trials on the parameter but without success.

There is also a function “setalldigital”, so without parameter at all. But again faulty. The runs stop every time in the call-statement.

In stead of the word user I did also the word handle, same result. ( I don’t know the value of these words…… )

So now is my question : can you help me in this mystery-case ? Is there a fault in the syntax ? If yes…what to do…

I like to thank you in advance for an answer.
Regards,
Ton, somewhere in the Netherlands

I’m sorry I don’t have experience of LibertyBasic.
I think the code should look something like this:[code]open “K8055D.dll” for dll as #user

calldll #user,“OpenDevice”, 0 As long
calldll #user,“SetAllDigital”

close #user[/code]

It was a little tricky to get the VM110N communication to work with the Liberty Basic.
Now it works.
After running this program the digital outputs 1 and 5 are set on.

[code] open “K8055D.dll” for dll as #user

calldll #user,"OpenDevice", 0 as long, h as long
print h
calldll #user,"ClearAllDigital", h as long
print h
calldll #user,"SetDigitalChannel", 5 as long, h as long
print h
calldll #user,"SetDigitalChannel", 1 as long, h as long
print h
calldll #user,"CloseDevice", h as long
print h

close #user [/code]

Card address ‘0’ (jumpers SK5 and SK6 are set ‘on’).

This is the output on the screen:0 1 1 1 1

Here an example with some more functions:

[code]
struct result1, value as long
struct result2, value as long

open "K8055D.dll" for dll as #user

calldll #user,"OpenDevice", 0 as long, h as long
if h = 0 then
    print "Card address "; h; " opened"
else
    print "Card not opened. Return value = "; h
end if

calldll #user,"ClearAllDigital", h as long
calldll #user,"SetDigitalChannel", 5 as long, h as long
calldll #user,"SetDigitalChannel", 1 as long, h as long

calldll #user,"ClearDigitalChannel", 1 as long, h as void

calldll #user,"ReadDigitalChannel", 1 as long, h as long, result as long
print "Digital Input I1 = ";result

calldll #user,"ReadAllDigital", h as long, result as long
print "Digital Inputs = ";result

calldll #user,"ReadAnalogChannel", 1 as long, result as long
print "A1 = "; result
calldll #user,"ReadAnalogChannel", 2 as long, result as long
print "A2 = "; result

calldll #user,"ReadAllAnalog",  result1 as struct,  result2 as struct,  h as long
print "A1 = "; result1.value.struct
print "A2 = "; result2.value.struct

calldll #user,"OutputAnalogChannel", 1 as long, 120 as long, h as long

calldll #user,"CloseDevice", h as long

close #user[/code]