Hello Guest it is April 25, 2024, 01:01:37 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 - joeaverage

Pages: « 1 2 3 4 5 6 »
31
Mach4 General Discussion / Stop/Reset scripts with and without Gcode
« on: January 28, 2017, 11:32:55 PM »
Hi All,
I've got myself tied up in knots. Over the last few days I've been helping Zuxztah to write code sufficient to control a VFD
over Modbus. Has been coming on pretty well but find myself out of my depth and the end.

Have got the Modbus link to work, have the scripts necessary for the CW and CCW buttons and associated spindle override to work.

The problem is how to stop the spindle under different conditions. From Gcode or MDI m5 works fine.

For the 'Stop' button I have the following:
Code: [Select]
Shutdown();
CycleStop();

For the 'Reset' button I have:
Code: [Select]
Shutdown();
local inst = mc.mcGetInstance()
mc.mcCntlReset(inst)
--mc.mcSpindleSetDirection(inst, 0)
mc.mcCntlSetLastError(inst, 'diagReset')

And the two functions in the screen load script:
Code: [Select]
---------------------------------------------------------------
--  Spindle Shutdown
---------------------------------------------------------------
function Shutdown();
    local inst=mc.mcGetInstance();
    mc.mcCntlGcodeExecuteWait(inst,"m5");
end;
---------------------------------------------------------------
-- Cycle Stop function.
---------------------------------------------------------------
function CycleStop()
    mc.mcSpindleSetDirection(inst, 0);
    mc.mcCntlSetLastError("Cycle Stopped");
    mc.mcCntlCycleStop(inst);
end

---------------------------------------------------------------

When I click the Reset button it appears to work, namely it calls m5 and therefore stops the spindle executes the mc.mcCntlReset(inst) statement
and as a diagnostic feature displays mc.mcCntlSetLastError(inst, 'diagReset').

When I click the Stop button it executes m5 and stops the spindle and appears to execute mc.mcCntlCycleStop but never displays
mc.mcCntlSetLastError("Cycle Stopped");.

Worse however if I have a Gcode program running and either Stop or Reset buttons are clicked the spindle does not stop and Mach4 crashes.

What am I misunderstanding?

What does mc.mcCntlCycleStop actually do?

Craig

32
Mach4 General Discussion / Backing up a Screen Set
« on: January 27, 2017, 01:14:58 AM »
Hi All,
just shot myself in the foot. Was messing around with the PLC script and elected to put a wxMessageBox statement
as a diagnostic check. Bad mistake now the message box displays repeatedly to the extent I can't open the
Screen Edit and fix my mistake. Trying to open with a backup profile didn't help because the fault was in my customised
screen set.

What I was able to do was manually edit my ini file to open with the wx4.set. As it turns out my customised screen set
is really only a modestly edited version of wx4.set anyway, so not a huge loss.

It does make me ask; does anyone back up their screenset and how did you go about it?

Craig

33
Mach4 General Discussion / Multiple controllers/devices
« on: January 05, 2017, 06:33:04 AM »
Hi All,
is it possible to have more than one motion controller active at once? I had assumed not but in truth don't know.

Looking at the Mach config for both inputs and outputs it looks like you can have different devices active for different I/Os.
Is this correct?

Craig


34
Mach4 General Discussion / Logging M4/ESS probe events
« on: December 22, 2016, 02:52:38 AM »
Hi All,
I have an issue with a probefile and needs to get some 'tools' to solve it.

I use a software utility to probe a PCB blank on a set of mesh points, the board I'm working on at the moment has 210 probe
mesh points which are recorded in a file. The G-code probe job runs fine, the file is created and the data triplets recorded.
The problem it that the file contains more data triplets than probe cycles, sometimes as many as 220 after only 210 probe cycles.

Thought in first instance that I had a noisy probe circuit. I've used this setup with M3/PP for sometime without this behaviour.
Tried increasing debounce settings on ESS probe pin, no change. Fitted capacitor to the BOB pin with a time constant of 1ms, no change.
Have probed the output of the BOB with my scope and have yet to find any switch bounce. I can't categorically state that its not a hardware
issue but increasingly forced to believe the hardware is good..ergo the ESS/M4 combination is randomly recording two events instead of one.
When an extra unintended data triplet is recorded its a duplicate of the preceeding entry.

I have watched the ESS plugin diagnostics page like a hawk when a probe job is running but have yet to see a fault. There doesn't appear to
be any facility to log the diagnostic so I can only watch it in realtime, hardly conducive to finding a fault if there is one. Does anyone know if the
diagnostic can be logged either by a built in facility or maybe some code that would have to crafted to do so?.

Have had a look at the M4 log but have only a few guesses at what all the entries mean. Is there any documentation official or otherwise that might
allow me to make more sense of what I'm seeing?

What I'm hoping is that I can record a probe job run log and then either manually count the events in the log or 'strip' the logfile of irrelevant entries
to focus on the probe event/issue of data triplet record to the outgoing file stream.

Craig

35
Mach4 General Discussion / mcCntlGetGcodeFileName ...Crashes M4
« on: December 13, 2016, 04:46:22 AM »
Hi All,
I'm writing a script that involves file handling and despite my infancy with LUA getting some good results.

This piece of code doesn't work as I expected:

 local code,rc= mc.mcCntlGetGcodeFileName(inst) ;
    if rc ~=0 then;
        wx.wxMessageBox("G code file not loaded");
        error=1;
        return error;
    end;

When this  macro is called either by a running Gcode file or MDI with a file loaded but not running it works well. I had hoped to use the macro as a file processing
utility even when a Gcode file is not loaded. My intention was to use the error trap and at some later stage add a navigation panel to select the file to process.

The problem is that the macro fails immediately on the ...mc.mcCntlGet...function and so never gets to the error trap which I had hoped to use.

Any ideas on how to detect whether a file is loaded or not?

Craig

36
Mach4 General Discussion / Restart required to edit scripts
« on: December 05, 2016, 06:28:27 AM »
Hi All,
first day of cutting chips with M4/ESS. When it works it works very well indeed but having teething problems.

I have two scripts named M40 and M41 (to match M3 practice) which are probe-file-open and probe-file-close.
They are lightly edited versions of M400 and M401 that ship with M4 in Lua examples folder. To get the app
(Autoleveller) to read the file has been necessary to massage the format statement.

1)Fire up M4/ESS (with pendant in USB)
2)Reference axes
3)MDI to start and zero axes
4)Run the Gcode probing file.
5)Submit probe data to the app/ does it work?
6)If not edit script- PROBLEM, the browse window opens to show the scripts in my profile, choose the right one, click open
        but script editor does not open. Have to shut down M4 (remember to remove pendant before shutdown), restart M4
then the script editor will open. Have to re-reference, zero out etc. All quite tedious complicated by the fact that if the USB
pendant is active when I shut down it is necessary to depower the ESS before its recognised by M4.

Seems to me that there are two problems, the first is that depending on the sequence of events the USB pendant interferes with
the ESS establishing comms, a hardware conflict issue.
The second is what am I doing wrong that requires I restart M4 to get the script editor to open? If it opened on schedule the need
to sequence the shutdown disappears.

Craig

37
General Mach Discussion / Hall of Fame?
« on: September 29, 2016, 02:37:43 AM »
Hi all,
I note there is a 'Hall of Shame', dodgy suppliers and the like.

How about a 'Hall of Fame'. As a beginner I've had so much help from
a number of regular posters and could nominate half a dozen or so without
having to think that hard.
I'm extremely grateful and I'm not the only one. The forum and the regulars who
deliver the 'help goods' add immeasurably to the hobby.

Craig

38
Hi All,
I've been fooling around making a lvdt for a tool height setter. Very amateurish
at present but coming along.

39
Mach4 General Discussion / Return Codes
« on: September 17, 2016, 06:52:00 AM »
Hi All,
yet another dumb question from a  Lua virgin...

Have written this code in a file dialog:

rc=mc.mcCntlLoadGcodeFile(inst, path)
            if(rc==MERROR_NOERROR)then wx.wxMessageBox("success")

When debugging the path variable is good, it correctly indentifies a Gcode file
but the return code is a number, value=0.

The API.chm reference:

rc = mc.mcCntlLoadGcodeFile(
      number mInst,
      stringFileToLoad)

and the return codes are:

MERROR_NOERROR No Error.
MERROR_INVALID_INSTANCE The mInst parameter was out of range.
MERROR_INVALID_ARG FileToLoad is NULL.
MERROR_FILE_EXCEPTION Exception while loading file.
MERROR_FILE_EMPTY No data a in file.
MERROR_FILE_SHARING Violation sharing file.
MERROR_FILE_INVALID Not a valid file type.
MERROR_FILE_BADSIZE Invalid file size (over 1.5GB).
MERROR_FILE_NOT_FOUND The file cannot be found in the file system.
MERROR_FILE_BADFORMAT The file had a line end without a new line character. The file may be incomplete.

How is it that the return code from my function call is numeric?

Is MERROR_NOERROR=0
and MERROR_INVALID_INSTANCE=1
and MERROR_INVALID_ARG=2

etc.

Craig

40
Mach4 General Discussion / Namespace?
« on: September 12, 2016, 07:32:03 AM »
Hi All,
please forgive my ignorance but have a question...

Reading some software manuals and references and came across...

wxLua functions using 'wx.' namespace.
From the context I guess wxGet...,for example, is a wxLua function but is accessed wx.wxGet....

If my guess is correct the mcGet...., a Mach Core function is accessed using mc. namespace as
mc.mcGet....

If these are true then scr. must be screen namespace. So what are screen functions and is there
any documentation that I might read?
Are there any other 'namespaces' that I might need to be aware of that affect Mach4 customisation?

Craig

Pages: « 1 2 3 4 5 6 »