Quick description

Quick description

Postby Andrej » 12 May 2013, 08:11

This new API works really well. I have working examples in C# and in Delphi7. Delphi7 uses API as a COM object.

API should also work with other languages (VB, C, C++, LabView, ...) but I don't have examples.

Unfortunately you can not use API if debugger is running. If debugger is running you will get "The type initializer for '<Module>' threw an exception" of similar error.

Here is short summary of available methods and properties:

Initialize - initializes and connects to controller
Dispose - disposes connection to controller
OnUpdate - event that triggers when new data from controller is available
VersionHW - returns controller firmware version
VersionHWRequired - returns required controller firmware version
VersionSW - returns software version
VersionAPI - returns API version
Serial - returns conroller serial number
LicenseValid - returns TRUE if license is valid
StepsPerUnit - returns "StepsPerUnit" setting value
Units - returns "Units" setting value
BufferFree - returns amount of free buffer
BufferSize - return buffer size
Position - returns current position
Speed - returns current speed
EStop - return "E-Stop" status
SendEStop - sends "E-Sstop" command
SendStop - sends "Stop" command
Pause - return "Pause" status
SendPause - sends "Pause" command
Limit - returns limit switches status
LimitRaw - returns limit switches status
Jog - returns jog switches status
JogRaw - returns jog switches status
Output - returns output pin status
SendOutput - sets output pins
SendSetPos - sets new position
SendMoveDelta - moves axes to new position
SendMovePos - move axes to new position
SendMoveDeltaAxis - moves one axes to new position
SendMovePosAxis - moves one axes to new position
Attachments
CNCUSBControllerAPI_CSharp.zip
(12.64 KiB) Downloaded 3312 times
CNCUSBControllerAPI_D7.zip
(514.27 KiB) Downloaded 2972 times
Andrej
 
Posts: 2489
Joined: 10 Jan 2012, 16:09
Controller: Many controllers

Re: Quick description

Postby TegoKelly » 31 Mar 2015, 15:41

I've downloaded Visual Studio 2013 Community edition but can't get the C# example to compile.
The first warning is
Warning 1 The referenced project '..\CNCUSBControllerAPI\CNCUSBControllerAPI.csproj' does not exist. CNCUSBControllerAPI_CSharp
I assume there is something else I need to download ?
TegoKelly
 
Posts: 12
Joined: 23 Sep 2014, 15:26
Controller: Mk2/4

Re: Quick description

Postby Andrej » 01 Apr 2015, 09:35

You don't need anything else. You need to fix your solution so that paths are correct.
Andrej
 
Posts: 2489
Joined: 10 Jan 2012, 16:09
Controller: Many controllers

Re: Quick description

Postby TegoKelly » 01 Apr 2015, 14:54

I've run "regasm" in the program directory on CNCUSBControllerAPI.dll but the program is still looking for
..\CNCUSBControllerAPI\ directory containing the .csproj file.

I don't have this directory anywhere ??

Thank you
TegoKelly
 
Posts: 12
Joined: 23 Sep 2014, 15:26
Controller: Mk2/4

Re: Quick description

Postby Support » 02 Apr 2015, 09:43

Please remove your reference to the .dll and then add it later.
Output should be in the same folder where your .dll is located .

Will not work in debugging mode.
Support
 
Posts: 2577
Joined: 07 Apr 2014, 17:39
Controller: Many controllers

Re: Quick description

Postby ksfksf » 19 Nov 2015, 00:59

How to use api send G-command(ex: G0 X 10)
ksfksf
 
Posts: 1
Joined: 19 Nov 2015, 00:52
Controller: Mk2

Message=The type initializer for '<Module>' threw an excepti

Postby Norcott » 21 Dec 2015, 16:35

Hi

Can you please issue a version of the API that developers can step & debug?

Thanks

EPR
Norcott
 
Posts: 16
Joined: 21 Dec 2015, 16:32
Controller: Mk2/4

Re: Quick description

Postby Support » 22 Dec 2015, 09:48

Unfortunately this is currently not available.
Thank you for understanding.
Support
 
Posts: 2577
Joined: 07 Apr 2014, 17:39
Controller: Many controllers

Re: Quick description

Postby Norcott » 22 Dec 2015, 10:01

Support wrote:Unfortunately this is currently not available.
Thank you for understanding.


I will be using the API with .NET, is there a requirement to register each card to activate a licence? I am seeing other posts suggesting I need to else commands will fail after 25 cycles?

Thanks
Norcott
 
Posts: 16
Joined: 21 Dec 2015, 16:32
Controller: Mk2/4

Re: Quick description

Postby Support » 22 Dec 2015, 10:25

Yes, this is correct, you need the license to activate controller or else you will be limited to 25 lines.
Support
 
Posts: 2577
Joined: 07 Apr 2014, 17:39
Controller: Many controllers

Re: Quick description

Postby Zaphod » 11 Jan 2016, 02:42

I'm also trying to get this to work and getting similar errors to those mentioned in above posts.

Here is exactly what I have done, please correct any steps I have missed or done wrong.

I downloaded CNCUSBControllerAPI_CSharp from this thread
I copied it to my E drive and put it in the root of E:
I extracted the zip file, creating a folder named CNCUSBControllerAPI_CSharp

Using visual studio 2013, I select File > Open > Project/Solution
I navigate to my E:\ Drive and change folders to CNCUSBControllerAPI_CSharp and opened the file named
CNCUSBControllerAPI_CSharp.csproj

Visual Studio 2013 pops up a box that says:
Review Project And Solution Changes
These projects are either not supported or need project behavior impacting modifications to open in this version of Visual Studio. Projects not displayed either require no changes or will automatically be modified such that behavior is not impacted

I select OK to make the modifications, and it seems to open the project.

I select Build > Build Solution and get the following Warnings and errors:

Error 1 The type or namespace name 'PlanetCNC' could not be found (are you missing a using directive or an assembly reference?) E:\CNCUSBControllerAPI_CSharp\TestForm.cs 19 9 CNCUSBControllerAPI_CSharp

Warning 2 The referenced project '..\CNCUSBControllerAPI\CNCUSBControllerAPI.csproj' does not exist. CNCUSBControllerAPI_CSharp

Warning 3 The referenced component 'CNCUSBControllerAPI' could not be found. CNCUSBControllerAPI_CSharp

Would someone be kind enough to help me figure out what these errors and warnings mean and how to correct them? Do I need more files from someplace? or is there some additional configuration needed?

please be specific about where I need to go or what to do, I am new to visual studio and also with working with any kind of API. I feel I must be missing some basic setup or important step, but I just don't know what that would be.

I do have CNCUSB controller installed on the same machine, but I have not run it, nor have I done anything with any of it's files. I am really not clear on weather that even needs to be installed or if I need files from it, or some kind of configuration to use some of it's files or not.

I would really appreciate any help in getting this working!
Zaphod
 
Posts: 2
Joined: 02 Nov 2015, 14:34

Re: Quick description

Postby Support » 11 Jan 2016, 14:43

We will help you as soon as possible. Thank you for your patience.
Support
 
Posts: 2577
Joined: 07 Apr 2014, 17:39
Controller: Many controllers


Return to API



Who is online

Users browsing this forum: No registered users and 2 guests