Hello Guest it is April 23, 2024, 02:11:53 PM

Author Topic: Restart required to edit scripts  (Read 1436 times)

0 Members and 1 Guest are viewing this topic.

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
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: Restart required to edit scripts
« Reply #1 on: December 05, 2016, 08:50:06 AM »
Quote
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.

As you would of gathered by now Mach4 is quite reliant on lua, this is used within the gui and in macros etc.. we all have a tinker and tweek the scripts to our liking but we also dont always see some of the problems with a tiny bit of code thats just not quite right. In light of this it can sometimes crash parts of mach4 that we are not aware of, this can lead to parts not working like they should or an incomplete shutdown cycle.
I know from experience that unless mach4 shuts down gracefully it will not find the ESS until a power cycle is done, this is because the ESS still thinks its connected.

Sorry not a remedy but just some things to consider like check the m40/41 codes are working and they are not causing the fault, or disable the pendant plugin to eliminate the conflict between them.

DazTheGas
New For 2022 - Instagram: dazthegas
Re: Restart required to edit scripts
« Reply #2 on: December 05, 2016, 04:19:57 PM »
Hi DTG,
yes I've found exactly that, if M4 does not shutdown cleanly it wont restart. Its not always obvious that a shutdown fault
has occurred.

One small issue I found was this statement:
--mc.mcCntlEnable(inst, false);
which is in M400 in uncommented form in commented out in M41 in my macro.

It resulted in an enable instruction being thrown in the mix at the end of the probe Gcode job
and would return an error along the lines 'cannot end from MDI'. It was the error which tipped me off
to concentrating on the statement and determining the effect it has on operating flow.

Notwithstanding the issues I've mentioned when M4/ESS is running the motion is smooth and accurate.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'