Hello Guest it is November 20, 2019, 09:00:55 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.


Messages - bri999

Pages: 1
1
Mach4 General Discussion / Re: Comments about Mach4 in Demo
« on: April 28, 2014, 03:46:59 PM »
Is it going to be possible to remotely access and control Mach4 as I could with Mach3 using third party software such as:
Mach = (Mach4.IMach4)Marshal.GetActiveObject("Mach4.Document");
Script = (Mach4.IMyScriptObject)Mach.GetScriptDispatch();

Then using script.Code(Gcode);  to send the command to Mach4 to move the steppers etc.
I have tried this with the Mach4 demo but it wont connect or respond.

There is no DCOM interface.  Mach4 is cross platform and we had to choose a way of doing the remote stuff that is also cross platform.  There is a library that you will link to in order to accomplish this.  The full API is exposed.  Running scripts, etc...

Steve
Thank you for the info. I look forward to being able to use the new version with my pick and place machine and software. Will I need to register as a developer to have access to the API ?

2
Mach4 General Discussion / Re: Comments about Mach4 in Demo
« on: April 28, 2014, 10:14:53 AM »
Is it going to be possible to remotely access and control Mach4 as I could with Mach3 using third party software such as:
Mach = (Mach4.IMach4)Marshal.GetActiveObject("Mach4.Document");
Script = (Mach4.IMyScriptObject)Mach.GetScriptDispatch();

Then using script.Code(Gcode);  to send the command to Mach4 to move the steppers etc.
I have tried this with the Mach4 demo but it wont connect or respond.

3
I am using a C# winform app to control a diy pick and place machine via Mach3 and a Smoothstepper Ethernet board. The code I am using uses the Mach4.Document object:

Mach = (Mach4.IMach4)Marshal.GetActiveObject("Mach4.Document");
Script = (Mach4.IMyScriptObject)Mach.GetScriptDispatch();

Then using script.Code(Gcode);  to send the command to Mach3 to move the steppers etc.

I am using this function which checks that the movement has finished before the next command can run:

public bool RunMach3Command(Mach4.IMyScriptObject script, string command)
        {
            try
            {
            script.Code(command);
            }
            catch { }
            try
            {
                while (script.IsMoving() != 0)
                {
                    Thread.Sleep(10);
                }
            }
            catch { }
            return true;
        }

The problem I am experiencing with running the Gcode commands in this way is there is a small pause between each movement which is slowing down the placement of the parts. If I run a set of commands via a Gcode file it runs much faster and smoother but I cant do this as the application needs to use other sensors and inputs to check that things such as component feeders are ready before it can pick the parts.

I have tried to send several commands one after the other without the script.IsMoving() being used but Mach3 seems to choke on the commands and only run the last one.

Is there any way to send several lines of Gcode to Mach3 via the scripting objects so Mach3 runs them all in sequence in the same way it runs a Gcode file or will this be available in Mach 4 when it is released?

The full code for the application is on https://github.com/briandorey/PNPControllerUSB and info about the pick and place machine with some videos of it running on http://briandorey.com/post/DIY-Pick-and-Place-V2-Project-Complete.aspx
Any help or ideas greatly appreciated!

Pages: 1