K8061 + k8055

Hi,
I’m working on my final project for certification as a technican.

For this I need about 20 inputs (14 digital and 6 analog) and 16 outputs.
I’ve learned and worked with your K8055 at school and now I bought the K8061 and the K8055 from “Conrad” in Germany.

Both Kits works very good seperately.
But I doesn’t know, how I can connect both cards simultaneously to my pc.
I’m using Borland C++ Builder 6.0 under Windows XP.

I’ve tried to include every DLL in a seperate class in my project, but it did’t work

Could anyone help me?
Thanks in advance!

The problem is that there are same function names in both DLLs.
(I don’t know if it is possible use alias names in the Borland C++ Builder.)

The solution may be to use two K8061 cards.

Hi, thanks for your answer.

yes, this is exactly the problem.
This is why I included the both DLL´s in seperate classes. One class for the K8061 and one for the K8055.
But it doesn’t work…

I need the counter-function of the K8055, because the inputs of an incremental rotary encoder are too fast to use them directly with the K8061.

Or is there a counter-function at the K8061?
How could I count the pulses?

There is no counter function in the K8061.

Delphi is one possible solution to this problem.
There you may use alias names if there are same function names in the two (or more) DLLs.
I understand that it is not easy to jump to other language - regardless of the similarity of the Borland C++Builder and Delphi…

“Similarities Between Delphi and C++Builder”: cesis.lv/learn/delphi/ch21.htm#Heading1

One more alternative is to change the function names in the K8061.DLL.
—> This solution seems to work.
I added “X” to the K8061 function names.

You may download modified DLL, LIB, .h and a working demo project (in Borland C++Builder) that runs K8055 and K8061 simultaneously from: vel255.diinoweb.com/files/K8055_K8061_DLL_combined.zip
Please copy and paste this link to your browser to download the ZIP file.

[code]#ifdef __cplusplus
extern “C” {
#endif

#define FUNCTION __declspec(dllimport)

FUNCTION long __stdcall OpenDeviceX();
FUNCTION __stdcall CloseDevicesX();
FUNCTION long __stdcall ReadAnalogChannelX(long CardAddress,long Channel);
FUNCTION __stdcall ReadAllAnalogX(long CardAddress, long *Buffer);
FUNCTION __stdcall OutputAnalogChannelX(long CardAddress, long Channel, long Data);
FUNCTION __stdcall OutputAllAnalogX(long CardAddress, long *Buffer);
FUNCTION __stdcall ClearAnalogChannelX(long CardAddress, long Channel);
FUNCTION __stdcall ClearAllAnalogX(long CardAddress);
FUNCTION __stdcall SetAnalogChannelX(long CardAddress,long Channel);
FUNCTION __stdcall SetAllAnalogX(long CardAddress);
FUNCTION __stdcall OutputAllDigitalX(long CardAddress, long Data);
FUNCTION __stdcall ClearDigitalChannelX(long CardAddress, long Channel);
FUNCTION __stdcall ClearAllDigitalX(long CardAddress);
FUNCTION __stdcall SetDigitalChannelX(long CardAddress, long Channel);
FUNCTION __stdcall SetAllDigitalX(long CardAddress);
FUNCTION bool __stdcall ReadDigitalChannelX(long CardAddress, long Channel);
FUNCTION long __stdcall ReadAllDigitalX(long CardAddress);
FUNCTION __stdcall OutputPWM(long CardAddress, long Data);
FUNCTION bool __stdcall PowerGood(long CardAddress);
FUNCTION bool __stdcall Connected(long CardAddress);
FUNCTION __stdcall ReadVersionX(long CardAddress, long *Buffer);

FUNCTION long __stdcall ReadBackDigitalOut(long CardAddress);
FUNCTION __stdcall ReadBackAnalogOut(long CardAddress, long *Buffer);
FUNCTION long __stdcall ReadBackPWMOut(long CardAddress);

#ifdef __cplusplus
}
#endif[/code]

Since you’re using C++ you can use namespaces to prevent name collisions

namespace K8055
{
	extern "C"
	{
		#define FUNCTION __declspec(dllimport)

		FUNCTION long __stdcall OpenDevice();
		FUNCTION void __stdcall CloseDevices();
		FUNCTION long __stdcall ReadAnalogChannel(long CardAddress,long Channel);
		FUNCTION void __stdcall ReadAllAnalog(long CardAddress, long *Buffer);
		FUNCTION void __stdcall OutputAnalogChannel(long CardAddress, long Channel, long Data);
		FUNCTION void __stdcall OutputAllAnalog(long CardAddress, long *Buffer);
		FUNCTION void __stdcall ClearAnalogChannel(long CardAddress, long Channel);
		FUNCTION void __stdcall ClearAllAnalog(long CardAddress);
		FUNCTION void __stdcall SetAnalogChannel(long CardAddress,long Channel);
		FUNCTION void __stdcall SetAllAnalog(long CardAddress);
		FUNCTION void __stdcall OutputAllDigital(long CardAddress, long Data);
		FUNCTION void __stdcall ClearDigitalChannel(long CardAddress, long Channel);
		FUNCTION void __stdcall ClearAllDigital(long CardAddress);
		FUNCTION void __stdcall SetDigitalChannel(long CardAddress, long Channel);
		FUNCTION void __stdcall SetAllDigital(long CardAddress);
		FUNCTION bool __stdcall ReadDigitalChannel(long CardAddress, long Channel);
		FUNCTION long __stdcall ReadAllDigital(long CardAddress);
		FUNCTION void __stdcall OutputPWM(long CardAddress, long Data);
		FUNCTION bool __stdcall PowerGood(long CardAddress);
		FUNCTION bool __stdcall Connected(long CardAddress);
		FUNCTION void __stdcall ReadVersion(long CardAddress, long *Buffer);

		FUNCTION long __stdcall ReadBackDigitalOut(long CardAddress);
		FUNCTION void __stdcall ReadBackAnalogOut(long CardAddress, long *Buffer);
		FUNCTION long __stdcall ReadBackPWMOut(long CardAddress);
	}
}

int main()
{
	K8055::OpenDevice();
	return 0;
}

vel255.diinoweb.com/files/K8055_K8061_DLL_combined.zip

[color=#FF4000]not download fail[/color]

The link to the K8055_K8061_DLL_combined.zip is now updated: box.com/s/ax5axtgwfucri1t7oznq

Thank you

[quote=“VEL255”]The link to the K8055_K8061_DLL_combined.zip is now updated: box.com/s/ax5axtgwfucri1t7oznq[/quote]push button open k8061 ------> card not found

This DLL and the demo works only with the driver version 1.0.0.6.
You’ll find this driver in the “Complete software package edition 2011” here:
velleman.eu/support/download … 8061&type=

[quote=“VEL255”]This DLL and the demo works only with the driver version 1.0.0.6.
You’ll find this driver in the “Complete software package edition 2011” here:
velleman.eu/support/download … 8061&type=[/quote]Download all versions K8061.dll press the button open k8061 writes dots and all K8061 not respond to commands . is it possible to control K8061 and K8055 in one програме? may still have takiezhe program?

After downloading and extracting the software package “Complete software package edition 2011”, you’ll find the driver in the subfolder: \USB_driver.

When the driver is installed, you can test the card operation by running the K8061_Demo.exe in the subfolder: \Demo.

We are using C# programming language do you have any advices can you use the C dll from the link that you proposed are there aliases also in C#
Thank you have a nice day

[quote]are there aliases also in C#[/quote]Yes, and there is no need for modified DLL.
You can use the K8061.DLL v4.0.0.0 and the latest K8055D.DLL from: http://www.velleman.eu/support/downloads/?code=k8055n&type=
In this link please see chapter “Renaming Function in C# and C++”: https://msdn.microsoft.com/en-us/library/f5xe74x8(v=vs.110).aspx
For more info please see also “Using the DllImport Attribute”: https://msdn.microsoft.com/en-us/library/aa984739(v=vs.71).aspx

Here an example:
For the K8061 you can declare the function SetAllDigital:

[DllImport("k8061.dll")] public static extern void SetAllDigital(int CardAddress);
and use it:

SetAllDigital(CardAddress);

For the K8055 you can declare the function SetAllDigital:

[DllImport("k8055d.dll", EntryPoint = "SetAllDigital")] public static extern void SetAllDigital_K8055();
and use it:

SetAllDigital_K8055();

Did all that was sugested but get error Keine Überladung for the ReadAllAnalog_K8055 Method takes one Argument
implemented the following code
[DllImport(“k8055d.dll”, EntryPoint = “ReadAllAnalog”)]
public static extern void ReadAllAnalog_K8055(ref int Data1, ref int Data2);
[DllImport(“k8061.dll”)]
public static extern void ReadAllAnalog(int CardAddress, int[] Buffer);
ReadAllAnalog_K8055(ref int Data1, ref int Data2);
Greetings

This should work:

[DllImport("k8055d.dll", EntryPoint = "ReadAllAnalog")] public static extern void ReadAllAnalog_K8055(ref int Data1, ref int Data2);

[DllImport("k8061.dll")] public static extern void ReadAllAnalog(int CardAddress, int[] Buffer);

For more details please see the K8061 C# example code.

Implemented the code as proposed but still get Errors
any advices appreciated how that can be solved
are there other Solutions
nice day

Found that the Card is easily disturbed by EMC pulses
1nF to ground could solve the Problem
had the Problem that usb was diconnected that was because of direct contact of cables with cables that have a distortion
there should be a hint in the Manual how to install the cables correct

May we ask how many cards of K8055 and K8061 your company sells each year
contacted your collegue one year ago and asked him if it is possibel to get a link from my company which is shown at your site
is it possibel to get a link for commercial software product
solved our question which we stated at the forum
forgot to open the connection to the card now everything works with both cards
thank you very much have a nice day greetings
P.S. is there a card planned with more output channels