It is currently Sat Apr 29, 2017 9:21 pm

All times are UTC




Post new topic Reply to topic  [ 72 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
 Post subject: K8061 + K8055
PostPosted: Mon Feb 09, 2009 5:42 pm 
Offline
Member
Member

Joined: Mon Feb 09, 2009 2:39 pm
Posts: 2
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!


Top
 Profile  
 
 Post subject: Re: K8061 + K8055
PostPosted: Tue Feb 10, 2009 8:32 pm 
Offline
User avatar
Velleman Support
Velleman Support

Joined: Mon Dec 11, 2006 12:03 pm
Posts: 4881
Location: Belgium
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.


Top
 Profile  
 
 Post subject: Re: K8061 + K8055
PostPosted: Tue Feb 10, 2009 9:15 pm 
Offline
Member
Member

Joined: Mon Feb 09, 2009 2:39 pm
Posts: 2
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?


Top
 Profile  
 
 Post subject: Re: K8061 + K8055
PostPosted: Wed Feb 11, 2009 11:23 am 
Offline
User avatar
Velleman Support
Velleman Support

Joined: Mon Dec 11, 2006 12:03 pm
Posts: 4881
Location: Belgium
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": http://www.cesis.lv/learn/delphi/ch21.htm#Heading1


Top
 Profile  
 
 Post subject: Re: K8061 + K8055
PostPosted: Thu Feb 12, 2009 10:26 pm 
Offline
User avatar
Velleman Support
Velleman Support

Joined: Mon Dec 11, 2006 12:03 pm
Posts: 4881
Location: Belgium
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


Top
 Profile  
 
 Post subject: Re: K8061 + K8055
PostPosted: Mon Feb 16, 2009 9:01 am 
Offline
User avatar
Velleman Support
Velleman Support

Joined: Wed Dec 06, 2006 12:49 pm
Posts: 1892
Location: Belgium
Since you're using C++ you can use namespaces to prevent name collisions

Code:
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;
}


Top
 Profile  
 
 Post subject: Re: K8061 + K8055
PostPosted: Sun Feb 10, 2013 4:24 pm 
Offline
Member
Member

Joined: Sun Feb 10, 2013 4:13 pm
Posts: 4
vel255.diinoweb.com/files/K8055_K8061_DLL_combined.zip

not download fail


Top
 Profile  
 
 Post subject: Re: K8061 + K8055
PostPosted: Mon Feb 11, 2013 8:34 am 
Offline
User avatar
Velleman Support
Velleman Support

Joined: Mon Dec 11, 2006 12:03 pm
Posts: 4881
Location: Belgium
The link to the K8055_K8061_DLL_combined.zip is now updated: https://www.box.com/s/ax5axtgwfucri1t7oznq


Top
 Profile  
 
 Post subject: Re: K8061 + K8055
PostPosted: Fri Mar 01, 2013 1:22 pm 
Offline
Member
Member

Joined: Sun Feb 10, 2013 4:13 pm
Posts: 4
Thank you


Last edited by MACHOMAN on Fri Mar 01, 2013 1:40 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: K8061 + K8055
PostPosted: Fri Mar 01, 2013 1:39 pm 
Offline
Member
Member

Joined: Sun Feb 10, 2013 4:13 pm
Posts: 4
VEL255 wrote:
The link to the K8055_K8061_DLL_combined.zip is now updated: https://www.box.com/s/ax5axtgwfucri1t7oznq
push button open k8061 ------> card not found


Top
 Profile  
 
 Post subject: Re: K8061 + K8055
PostPosted: Fri Mar 01, 2013 5:30 pm 
Offline
User avatar
Velleman Support
Velleman Support

Joined: Mon Dec 11, 2006 12:03 pm
Posts: 4881
Location: Belgium
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:
http://www.velleman.eu/support/download ... 8061&type=


Top
 Profile  
 
 Post subject: Re: K8061 + K8055
PostPosted: Fri Mar 01, 2013 6:40 pm 
Offline
Member
Member

Joined: Sun Feb 10, 2013 4:13 pm
Posts: 4
VEL255 wrote:
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:
http://www.velleman.eu/support/download ... 8061&type=
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?


Top
 Profile  
 
 Post subject: Re: K8061 + K8055
PostPosted: Mon Mar 04, 2013 7:55 am 
Offline
User avatar
Velleman Support
Velleman Support

Joined: Mon Dec 11, 2006 12:03 pm
Posts: 4881
Location: Belgium
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.


Top
 Profile  
 
 Post subject: Re: K8061 + K8055
PostPosted: Mon Mar 07, 2016 7:42 am 
Offline
Member
Member

Joined: Thu Oct 22, 2015 8:44 am
Posts: 55
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


Top
 Profile  
 
 Post subject: Re: K8061 + K8055
PostPosted: Mon Mar 07, 2016 9:21 am 
Offline
User avatar
Velleman Support
Velleman Support

Joined: Mon Dec 11, 2006 12:03 pm
Posts: 4881
Location: Belgium
Quote:
are there aliases also in C#
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:
Code:
[DllImport("k8061.dll")]
        public static extern void SetAllDigital(int CardAddress);

and use it:
Code:
SetAllDigital(CardAddress);


For the K8055 you can declare the function SetAllDigital:
Code:
 [DllImport("k8055d.dll", EntryPoint = "SetAllDigital")]
        public static extern void SetAllDigital_K8055();

and use it:
Code:
SetAllDigital_K8055();


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 72 posts ]  Go to page 1, 2, 3, 4, 5  Next

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group