API for Mk2 and Mk2/4

Re: API for Mk2 and Mk2/4

Postby Pierre » 02 Jul 2013, 17:59

Hello everybody,

I have a question for you, Andrej.
I have the same problem as Next2you with the Csharp sample project, and i downloaded CNCUSBControllerAPI.dll, CNCUSBControllerAPI.tlb and CNCUSBControllerAPI.
I put those files in the project folder, and tried to import in the project but It didn't work.

I'm not a pro in Csharp and really don't want to become.
I'm more familiar with C++, I usually use C++ for communication with different types of instruments ( weighing machine, spectrophotometer ).
I'm looking for CNCcontroller wich i can drive with my own software.

Anyway, my question is : is it possible for you to give us a sample project in C++?

Have a nice day.

Pierre
Pierre
 
Posts: 2
Joined: 02 Jul 2013, 17:29

Re: API for Mk2 and Mk2/4

Postby Andrej » 03 Jul 2013, 08:15

If you copied files elsewhere then you need to register again using RegAsm:

C:\Windows\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe CNCUSBControllerAPI.dll /codebase
Andrej
 
Posts: 2489
Joined: 10 Jan 2012, 16:09
Controller: Many controllers

Re: API for Mk2 and Mk2/4

Postby Pierre » 03 Jul 2013, 09:21

And for C++ do you think it is possible to have a sample project ?
Pierre
 
Posts: 2
Joined: 02 Jul 2013, 17:29

Re: API for Mk2 and Mk2/4

Postby Andrej » 03 Jul 2013, 12:14

I'm not very good with C++. But for somebody familiar with C++ environment this should be very easy.
Andrej
 
Posts: 2489
Joined: 10 Jan 2012, 16:09
Controller: Many controllers

Re: API for Mk2 and Mk2/4

Postby gumush » 30 Sep 2013, 07:28

With the camera semi automatic pick and place machine can be done with api.

http://www.youtube.com/watch?v=bkYNBFXlJYQ
gumush
 
Posts: 14
Joined: 29 Sep 2013, 21:59
Controller: Mk2

Re: API for Mk2 and Mk2/4

Postby Andrej » 30 Sep 2013, 22:01

You can use API to move p'n'p machine.
But you can not use API to recognize shapes from camera. You need to do this with something else.
Andrej
 
Posts: 2489
Joined: 10 Jan 2012, 16:09
Controller: Many controllers

Re: API for Mk2 and Mk2/4

Postby Henry89it » 02 Dec 2013, 18:32

I'm sorry, I don't understand why I find this error when compiling.
Which using directory should I add?
I put the API project in the same folder of the other libraries.
Thank you
Attachments
errorvs.jpg
errorvs.jpg (131.78 KiB) Viewed 4305 times
Henry89it
 
Posts: 4
Joined: 28 Nov 2013, 17:01
Controller: Mk2/4

Re: API for Mk2 and Mk2/4

Postby Andrej » 03 Dec 2013, 06:55

I suspect it is because you did not correctly referenced assembly.
Andrej
 
Posts: 2489
Joined: 10 Jan 2012, 16:09
Controller: Many controllers

Re: API for Mk2 and Mk2/4

Postby Henry89it » 03 Dec 2013, 11:49

I added the reference to the two libraries. However, the error "the referenced project '..\CNCUSBControllerAPI\CNCUSBControllerAPI.csproj' does not exist" remains. I haven't bought the license yet. May this be the reason?
Henry89it
 
Posts: 4
Joined: 28 Nov 2013, 17:01
Controller: Mk2/4

Re: API for Mk2 and Mk2/4

Postby Andrej » 03 Dec 2013, 22:13

No, license is not a problem.

You need to learn how to use references with c#. There are a lot of tutorials on internet.
Andrej
 
Posts: 2489
Joined: 10 Jan 2012, 16:09
Controller: Many controllers

Re: API for Mk2 and Mk2/4

Postby Math1010 » 22 Apr 2014, 18:08

Hello,
Is it possible to control the on/off and speed of the spindle with the API ?
Thank you.
Math1010
 
Posts: 17
Joined: 06 Aug 2013, 10:52
Controller: Mk2

Re: API for Mk2 and Mk2/4

Postby Support » 23 Apr 2014, 07:17

It is not possible at the moment, this will be added on our To-Do list.
Support
 
Posts: 2655
Joined: 07 Apr 2014, 17:39
Controller: Many controllers

Re: API for Mk2 and Mk2/4

Postby paulrengifo » 29 Sep 2014, 20:30

help me please to solve this error:
the api is for mK1 or somebody have a example in visual studio please help

the error : Error 1 Can not find the type or Namespace Name ' planetcnc ' ( A Lack using directive or an assembly reference ? )

on the image show in the : planetcnc.API.CNC cnc;

helpe me please
Attachments
csharp.png
csharp.png (86.84 KiB) Viewed 4211 times
paulrengifo
 
Posts: 9
Joined: 15 May 2014, 16:03
Controller: Mk1

Re: API for Mk2 and Mk2/4

Postby Support » 30 Sep 2014, 11:58

planetcnc.API.CNC cnc; is wrong. c# is case sensitive, mind the uppercase and lowercase letters.
Support
 
Posts: 2655
Joined: 07 Apr 2014, 17:39
Controller: Many controllers

Re: API for Mk2 and Mk2/4

Postby TegoKelly » 31 Mar 2015, 16:17

I programmed in C, C++, and assembly for years and have no clue how to get the C# example to build.
From this thread it looks like I'm one of several people trying to get the C# example to build.

Would a C++ programmer out there explain how to get the CNCUSBControllerAPI to be referenced properly
in Visual Studio 2013 ?
I've tried to use the C Wrapper examples but they crash immediately. I'm hoping I can get started in C#
then write code in C++ after I experiment with the API in C#.

Thank you in advance for any help :-)
TegoKelly
 
Posts: 12
Joined: 23 Sep 2014, 15:26
Controller: Mk2/4

Re: API for Mk2 and Mk2/4

Postby Andrej » 01 Apr 2015, 09:34

To use API with C++ you need to add it as clr reference.
Andrej
 
Posts: 2489
Joined: 10 Jan 2012, 16:09
Controller: Many controllers

Previous

Return to API



Who is online

Users browsing this forum: No registered users and 1 guest