Hello Guest it is April 26, 2024, 08:52:57 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 - smurph

1031
Mach4 General Discussion / Re: Mach 4 Bug Reports
« on: May 27, 2014, 01:09:51 AM »
Scott,

It runs fine here.  Load script, hit F5, and I end up at a auto generated break point.  Then I can F10 (step) or F11 (step into) as needed.  I can also hit F5 (continue) and the scripts finishes with a message "Debug session finished."

XP perhaps?  I have not visited the XP VM in a while...

Steve

1032
Mach4 General Discussion / Re: Screen Set Ideas
« on: May 26, 2014, 11:24:39 PM »
I found and fixed over 15 of them!  All bad bindings.

Steve

1033
Mach4 General Discussion / Re: MACH4 Mcode testing
« on: May 26, 2014, 07:18:26 PM »
A better example.  m100 will not execute at all from MDI or G code file.  Because user M codes start at 101.  It will run in the editor though.  So I changed it to M101 and it works fine.

Code: [Select]
function m101()
    local inst = mc.mcGetInstance();
    mc.mcCntlSetLastError(inst, "m101");
    local SNv = mc.mcCntlGetPoundVar(inst , 590);
    local str = string.sub(SNv, 1, 6);
    local idx = 0;
    mc.mcCntlSetLastError(inst, "#590 = " .. str);
    --local SN = {}
    local SN;
    for idx = 1, #str do
        SN = str:sub(idx, idx);
        if     SN == "1" then
                mc.mcCntlGcodeExecuteWait(inst, "G0 X1.0");
        elseif SN == "2" then
                mc.mcCntlGcodeExecuteWait(inst, "G0 X2.0");
        elseif SN == "3" then
                mc.mcCntlGcodeExecuteWait(inst, "G0 X3.0");
        elseif SN == "4" then
                mc.mcCntlGcodeExecuteWait(inst, "G0 X4.0");
        elseif SN == "5" then
                mc.mcCntlGcodeExecuteWait(inst, "G0 X5.0");
        elseif SN == "6" then
                mc.mcCntlGcodeExecuteWait(inst, "G0 X6.0");
        elseif SN == "7" then
                mc.mcCntlGcodeExecuteWait(inst, "G0 X7.0");
        elseif SN == "8" then
                mc.mcCntlGcodeExecuteWait(inst, "G0 X8.0");
        elseif SN == "9" then
                mc.mcCntlGcodeExecuteWait(inst, "G0 X9.0");
        elseif SN == "0" then
                mc.mcCntlGcodeExecuteWait(inst, "G0 X0.0");
        end
    end
    mc.mcCntlSetLastError(inst, "Setting #590 = " .. tostring(SNv + 1));
    mc.mcCntlSetPoundVar(inst , 590, SNv + 1);
end

if (mc.mcInEditor() == 1) then
    m101()
end

1034
Mach4 General Discussion / Re: MACH4 Mcode testing
« on: May 26, 2014, 06:30:16 PM »
For your first example, I don't know what you were doing with that table.  I assume that you wanted to walk the digits of the #590 var.  This is more easily accomplished by converting the #var number to a string.  This is done by the "string.sub(SNv, 1, 6);".  Then just loop through each character.

Code: [Select]
function m100()
    local inst = mc.mcGetInstance();
    local SNv = mc.mcCntlGetPoundVar(inst , 590);
    local str = string.sub(SNv, 1, 6);
    local idx = 0;
    --wx.wxMessageBox(tostring(str));
    --local SN = {}
    local SN;
    for idx = 1, #str do
        SN = str:sub(idx, idx);
        if     SN == "1" then
                mc.mcCntlGcodeExecuteWait(inst, "G0 X1.0");
        elseif SN == "2" then
                mc.mcCntlGcodeExecuteWait(inst, "G0 X2.0");
        elseif SN == "3" then
                mc.mcCntlGcodeExecuteWait(inst, "G0 X3.0");
        elseif SN == "4" then
                mc.mcCntlGcodeExecuteWait(inst, "G0 X4.0");
        elseif SN == "5" then
                mc.mcCntlGcodeExecuteWait(inst, "G0 X5.0");
        elseif SN == "6" then
                mc.mcCntlGcodeExecuteWait(inst, "G0 X6.0");
        elseif SN == "7" then
                mc.mcCntlGcodeExecuteWait(inst, "G0 X7.0");
        elseif SN == "8" then
                mc.mcCntlGcodeExecuteWait(inst, "G0 X8.0");
        elseif SN == "9" then
                mc.mcCntlGcodeExecuteWait(inst, "G0 X9.0");
        elseif SN == "0" then
                mc.mcCntlGcodeExecuteWait(inst, "G0 X0.0");
        end
    end

    mc.mcCntlSetPoundVar(inst , 590, tonumber(str) + 1);
 
end

if (mc.mcInEditor() == 1) then
    m100()
end

1035
Mach4 General Discussion / Re: MACH4 Mcode testing
« on: May 26, 2014, 02:28:53 PM »
Did you forget to post the script?  Or are you talking about the one above?

1036
Mach4 General Discussion / Re: MACH4 Mcode testing
« on: May 26, 2014, 02:40:44 AM »
Try combining the two Gcode executes.  Like:

mc.mcCntlGcodeExecute(inst, "G0X10\nG0X0");

I wasn't looking too closely at your original script and I didn't catch that.  If you'll take a look at the m6 macro, you'll see where we did the same sort of thing that combines a lot of lines of G code into one call to mc.mcCntlGcodeExecute().

The technical reason is that each call to mc.mcCntlGcodeExecute() fires up it's own interpreter.  It is not like feeding a new line to the same interpreter.  It executes the code as a unit of work.  If you want the script to wait on the G code to complete before moving on, call mc.mcCntlGcodeExecuteWait() instead.

Steve

1037
Mach4 General Discussion / Re: MACH4 Mcode testing
« on: May 25, 2014, 11:53:49 PM »
Did you name the file m100.mcs?   Go look at m3.mcs.  It is NAMED m3.mcs, there is a function NAMED m3.mcs, and then there is a piece of code at the bottom of the script that tests to see if it is being run from the editor.  If it is running in the editor, if calls the m3() function inside that if block.

In a file called m100.mcs, put:
Code: [Select]
function m100()
    inst=mc.mcGetInstance();
    mc.mcCntlSetLastError(inst, 'Serial Number Engrave')
    mc.mcCntlGcodeExecute(inst, "G0X10 ");
    mc.mcCntlGcodeExecute(inst, "G0X0 ");
end

if (mc.mcInEditor() == 1) then
    m100()
end

It is like that for a reason.  It has to be that way where the scripts run in compiled mode as part of a larger "chunk" in Mach 4 and it also enables you to run the "snippet" inside the editor to debug it.

Steve

1038
Mach4 General Discussion / Re: Screen Set Ideas
« on: May 25, 2014, 09:11:53 PM »
mc.mcToolPathGetBackColor() has a bad binding.  Thanks for finding that Scott!  It will be in the next update.

Steve

1039
Galil / Re: Galil plugin version 4.6 available.
« on: May 24, 2014, 01:35:49 PM »
No,  I do not keep such a log.  Most of the work was to provide plugin that would work with Smart Term.  And then also one that works with the newer software from Galil.  I have not done anything with slaving.  I don't have a gantry machine.

Mach is the trajectory planner.  The Galil just follows the ball.  So Mach is outputting a trapezoidal profile and you will not change that.  In the plugin, we set VA and VD to the same value.  This value is pretty high as we usually want the Galil to follow what Mach is giving it as closely as possible.  You can try it, but your mileage may vary.  It is not something ANY of it was designed to do.

Steve

1040
Mach4 General Discussion / Re: Re: Mach 4 and Galil
« on: May 23, 2014, 09:49:00 PM »
The Galil plugin takes trajectory data from Mach and converts it into a format that the Galil can use.  Some older controllers use Linear Interpolation.  The newer controllers use Contour mode.  The newest controllers will use PVT mode.  

There are no problems to be solved. The concepts for the plugin are not new and they are well understood.  We run Galil with Mach 3 with great success.  It is just a matter of testing all code paths in the Mach 4 plugin.  Like making sure that when the user hits Stop that it actually stops, etc...  You would not believe how many paths you have to account for just because we never know what the user will do.

Steve