Hello Guest it is April 20, 2024, 12:58:14 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - TonyG

Pages: 1
1
VB and the development of wizards / Using the COM API in VB .NET
« on: January 14, 2010, 12:48:01 PM »
I'm trying to use VB .NET to control Mach, and I'm having problems getting things set up.  I searched the forums for help, and the only useful topic I found (http://www.machsupport.com/forum/index.php/topic,8429.msg54415/topicseen.html#msg54415)  mentions adding Mach3 as a component to your project, then gives the following code snipit:

Public Class Form1
     Dim mach As Mach4.IMach4
         mach = GetObject(, "Mach4.Document")
     Dim scriptObject As Mach4.IMyScriptObject
         scriptObject = mach.GetScriptDispatch()

     scriptObject.LoadFile("d:\Mach3\GCode\roadrunner.tap")
End Class

I added the Mach3 component by selecting Project->Add Existing Item (BTW, I'm using VB 2008 Express).  Then I selected the "Mach3.exe".  After that I saw a Mach4 namespace in my component browser window with a class named "CMach4Doc".  I then copied the code into the form procedure and tried to run the program.

The compiler complains that "Mach4.IMach4" is not defined.  Since the class name is CMach4Doc, I also tried "Dim mach As Mach4.CMach4Doc" with the same results.

I'm sure I'm missing something obvious, I just don't know what.

Tony

2
General Mach Discussion / COM API
« on: November 13, 2009, 05:14:33 PM »
My company purchased a desktop CNC machine and a copy of Mach 3 to use for some automated testing.  I need to write a program that controls the stepper motor positions and captures some data from our sensor.  I'm a software programmer and don't know anything about CNC machines or G-Code (other than what little research I've done today).  I found one message one this forum where someone talked about using VB.NET to send commands via the "COM API", but I couldn't find any other references to the API or to controlling the unit with external software.

Can someone point to a reference manual, sample code, etc. that shows how I can interact with Mach 3 programmatically to do what I need?  I'm not really picky about how it gets done since this is for research use only, not production.  For example, I'd be OK with writing out a G-Code script file and then executing Mach 3 with a command call if that's possible.


Pages: 1