K8055 & C# Analogue problems

Hi!
I’m trying to build a Laser-Motion-Control with the Velleman K8055.
I have made several Projects with the K8055 and Delphi5, but now I’ve changed my preferred programming Language to Visual C#.
The problem is: Everything works fine, except the Analogue Out/Inputs.

ReadAnalogChannel(1) returns something around 7209240045289472.
OutputAnalogChannel(1,255) doesn’t do anything.
OutputAnalogChannel(2,255) doesn’t do anything.
OutputAllAnalog(255,255) correctly sets DA1 to about 4,7V, but DA2 is unchanged.
SetAllAnalog() Sets both DA1 and DA2 to about 4,7V and ClearAllAnalog() sets them to 0V.

Nasty, right? Is this a known problem or my fault?
All the compiled demo applications from velleman.be do their work.

Any Ideas? Thank you!

If your function returns 7209240045289472 then i’m guessing you’re using long (64 bits) instead of int (32 bits).

YES! PERFECT!
Thank you very very much works great now!
I will provide my Test-Application in Visual C# when i’ts finished (tomorrow i think.)

Edit:
You can now find a Demonstation of a K8055 Interface in Visual C# @ plaputta.de/ (Feel free to link to the site, but please don’t put a direct link to the file. Thank you)

Thanks for sharing the code! :smiley: