Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: PeterF on April 03, 2010, 07:11:32 PM

Title: Properly doing "Run Frome Here"
Post by: PeterF on April 03, 2010, 07:11:32 PM
What is the proper way to do "Run From Here"? (exact click and scroll sequence, including clicks in the GCode window, scrolling there, clicking "Run From Here" and so on.)

The background is as follows: Today we loaded G code, and I wanted to do "running from here". Mach3 even told us the line number (lets say, 308) and "Run From Here" was clicked by me. The tool was in place, all offsets were right, the position was right, the spindle was spinning. But when we pressed "Cycle Start", it started not from line 308, but from the beginning. At line 9, it did (lets say) G0Z20. At line 10 it did (lets say) M6 T2 and requested the tool change. G0Z20 was not exactly the right move.

Thanks for exact instructions.
Title: Re: Properly doing "Run Frome Here"
Post by: Hood on April 03, 2010, 07:25:01 PM
Is it a demo version you have?
I use RFH all the time, way I do it is scroll the code to the line past the one I want to start at, press run from here, Mach will scroll through the code and once stopped you press Start. A box will pop up showing a prep move that you need to OK, it also allows you to choose whether to switch on the spindle, you OK that if it looks correct and then the machine will move once there press start again .

Hood
Title: Re: Properly doing "Run Frome Here"
Post by: PeterF on April 03, 2010, 08:01:46 PM
yes Mach3 was in demo mode and we hit line 501. I couldn't quit and restart it in licensed mode because I would have lost the "referenced state". Therefore I shortened the GCode file by enough, approx. 200 lines, loaded it and wanted to continue from line now 308, formerly line 501.

Is the code window still selected (lighter color) when you press RFH ?
Title: Re: Properly doing "Run Frome Here"
Post by: Hood on April 04, 2010, 01:48:10 AM
Yes the code window should still be selected when you press RFH but if you are using the Demo version then thats why it doesnt work.
Hood
Title: Re: Properly doing "Run Frome Here"
Post by: renatom on June 28, 2010, 07:53:04 AM
Hi Hood,

I just need a bit of advice on RFH. Everything works fine from the line I select and the Initial Sart and the line it should Start. I have noticed that all the MCODES activates during Start up to the RFH including Macro which has ActivateSignal. Am I  doing it the wrong way of running RFH? Please advice me of a solution. Thanks in advance.

Thanks
Renato
Title: Re: Properly doing "Run Frome Here"
Post by: PeterF on June 28, 2010, 08:59:38 AM
As far as I know, Mach3 runs quickly thru the program from the beginning up to the RFH line,to ensure that the mode of Mach3 is correct. Mode would include G20/G21, cutter radius compensation, plane selection, M03, M06 and so on ("mode" includes all the ones given at the top right of the screen).

I don't understand what is meant by you "Macro which has ActivateSignal" but I'm not that much pro.

edited for orthography
Title: Re: Properly doing "Run Frome Here"
Post by: ger21 on June 28, 2010, 11:53:10 AM
Run From Here does not work in Demo mode.
Title: Re: Properly doing "Run Frome Here"
Post by: renatom on June 28, 2010, 07:51:37 PM
Hello Peter, Gerry,

Thank you very much for the Reply. I have a full license Mach 3 So is not on Demo Mode. What I meant is one of My Macro(M71) is turning an Output1. When I run RFH and its scrolling Down I have notice that Output 1is turning on while reading the file up to the point that it reaches the line where I want to start. Just need an advice if this is the way it should work. Thanks again.

Regards
Renato
Title: Re: Properly doing "Run Frome Here"
Post by: Hood on June 28, 2010, 07:57:05 PM
I would imagine that if your code has the macro call in it ( that is before the point you are starting) then it should be called when you do a RFH as that would seem to be the state it should be in.
Hood
Title: Re: Properly doing "Run Frome Here"
Post by: renatom on June 28, 2010, 09:11:51 PM
Hi Hood,

Thanks for the reply. I think that will be the case. Macro M71 turns on a Solinoid Pneumatic Valve and its turning on and OFF during the run of RFH. I think i will not be able to use RFH. Would there be a command that I could disable Macro while on RFH so I could edit the Button Script of RFH and prevent Macro from excecuting?

Thanks Again
Renato
Title: Re: Properly doing "Run Frome Here"
Post by: Hood on June 29, 2010, 02:54:36 AM
There is an option on General Config page called Ignore  M calls while Loading I am not sure if that will help when doing a Run From Here or not but its worth a try.
The other option you may have is to use the Set Next Line option rather than RFH, never used it so not sure if it will do as you wish, again worth a try.
Hood
Title: Re: Properly doing "Run Frome Here"
Post by: manmeran on June 29, 2010, 04:02:28 AM
i have problem with RFH
i think in plasma dont work
for example in this code:
N0100 G00 Z50.0000
N0110 X54.5560 Y43.6976
N0120 G31 Z -100 F500.0
N0130 G92 Z0.0
N0140 G00 Z0.0000
N0150 G92 Z0.0
N0160 G00 X54.5560 Y43.6976 Z5.0000
N0170 M03
N0180 G01 Z2.0000 F500
N0190 X56.6592 Y42.9879
N0200 X61.0873 Y42.8287
N0210 Y41.0483
N0220 X32.7073
N0230 Y42.8287
N0240 X37.3161 Y43.0319
N0250 X38.5330 Y43.3942
N0260 X40.4880 Y44.6611
N0270 X41.5513 Y46.2541
N0280 X42.0049 Y48.4512
N0290 X42.2073 Y52.7383
N0300 X42.1246 Y98.4651
N0310 X41.7569 Y101.3149
N0320 X41.0934 Y103.1154
N0330 X39.6993 Y104.4128
N0340 X37.6922 Y105.2646
N0350 X35.1942 Y105.5483
N0360 X32.7073
N0370 Y107.3283
N0380 X51.5873
N0390 X51.6252 Y50.7880
N0400 X51.9287 Y47.6757
N0410 X52.5362 Y45.6137
N0420 X52.9551 Y44.9758
N0430 X54.5560 Y43.6976
N0440 M05

Amir
Title: Re: Properly doing "Run Frome Here"
Post by: renatom on June 29, 2010, 04:25:44 AM
Hi Hood,

I have seen that Option on General config and works only When Loading The program but doesnt apply on RFH. That option is the solution if it Works with RFH. If that option is not ticked on General Config, It will be doing the same thing as RFH when loading Gcode program all the Macro are Triggering. I hope that option will be available as a command. Thanks for your Help


Thanks Again
Renato
Title: Re: Properly doing "Run Frome Here"
Post by: Hood on June 29, 2010, 04:30:15 AM
I thought that may be the case.
 Have you tried the Set Next Line rather than RFH?
Hood
Title: Re: Properly doing "Run Frome Here"
Post by: renatom on June 29, 2010, 04:57:44 AM
Hello  hood,

Thanks for the information, I will try that option tomorrow morning and will let you know.

thanks for the great support
Renato
Title: Re: Properly doing "Run Frome Here"
Post by: PeterF on June 29, 2010, 12:31:21 PM
Is it true that you said M71 does work when running, but turns on and OFF when RFH ? You have only one M71 call, right? It couldn't be a "race" condition in the execution of M71?
Title: Re: Properly doing "Run Frome Here"
Post by: renatom on June 29, 2010, 07:07:05 PM
Hello Peterf

Thanks again for the help. Yes M71 executes properly when called on a GCODE program. But M71 turns on and OFF when RFH. I forgot to mention that M70 turns OFF M71. Its similar if you tick off the option under general config  IGNORE M CALLS WHILE LOADING and you load a GCODE Program. Sorry I did not quite understand what you meant by "RACE".  If there is an OEMButton that will do "Ignore M calls while loading "it will fix the problem....Thanks in Advance

Regards
Renato
Title: Re: Properly doing "Run Frome Here"
Post by: renatom on June 29, 2010, 07:15:28 PM
Hello Hood,

I have tried SET NEXT LINE this morning and seems to be working. I will do a bit more testing. Thank you for the Idea. I still have one last question if you could Please give me a starting point on the best way to deal with tool offset.
I have 5 router heads on the Z axis  and individually turn on. Which is the best way to Do individual   OFFSET on  all four Spindle Motor to the first Motor? I know i am asking too much but dont know where to start at this stage.

Thanks again

Renato

Title: Re: Properly doing "Run Frome Here"
Post by: Hood on June 30, 2010, 01:39:40 AM
I believe rev4  when its released will have support for multihead spindle offsets but until then you will probably have to use work offsets.
Hood
Title: Re: Properly doing "Run Frome Here"
Post by: renatom on June 30, 2010, 02:20:33 AM
Do you know when Rev4 is going to be release?

Thanks
Renato
Title: Re: Properly doing "Run Frome Here"
Post by: Hood on June 30, 2010, 02:50:12 AM
Afraid not, It is getting closer to Beta release but impossible to say when, it is almost a total re-write of Mach so issues keep popping up and need fixed.
Hood
Title: Re: Properly doing "Run Frome Here"
Post by: PeterF on June 30, 2010, 03:47:39 AM
Hello Peterf

Thanks again for the help. Yes M71 executes properly when called on a GCODE program. But M71 turns on and OFF when RFH. I forgot to mention that M70 turns OFF M71.

Regards
Renato

Are you sure you don't have also M70 in your program?And I would believe you, if you told us that M71 does nothing, but a double effect on-OFF is not plausible. "race" means M71 does not work because it is too near to another M71 or something (perhaps M70), when RFH does the preflight. ("race condition" is a general word from computer programming where timing of operations is not right).
Title: Re: Properly doing "Run Frome Here"
Post by: renatom on June 30, 2010, 05:02:53 AM
Hi Peter,

M71 tuns on output1 and M70 turns off output1 in a Gcode program.

Thanks
Renato
Title: Re: Properly doing "Run Frome Here"
Post by: PeterF on June 30, 2010, 05:49:12 AM
M71 tuns on output1 and M70 turns off output1 in a Gcode program.

Hi renato, I'm sure M70 and M71 work as you described them ( twice).

Regarding my suggestion resp. your unsolved problem I'm not sure .... Does your GCode contain both M70 and M71 bevore the RFH line, and in what sequence, and in what distance?
Title: Re: Properly doing "Run Frome Here"
Post by: renatom on June 30, 2010, 06:08:24 AM
Hi Peter,

Sorry I was not very attentive to the  Question, The Gcode contains Both M70 and M71  before RFH line. M71 will turn the output first then will run a line depending on the program then M70 will be called to disable the output


Thanks
Renato
Title: Re: Properly doing "Run Frome Here"
Post by: PeterF on June 30, 2010, 06:42:47 AM
The Gcode contains Both M70 and M71  before RFH line. M71 will turn the output first then will run a line depending on the program then M70 will be called to disable the output



renato it seems clear why the signal is OFF, that is because you seem to have an M70 OFFing it (disabling it) before the RFH line.

However I'm not sure what is yet meant be "run a line depending on the program". GCode does not have conditional execution, and when you manage to have it, then the preflight of RFH might not handle conditional execution.
Title: Re: Properly doing "Run Frome Here"
Post by: renatom on June 30, 2010, 07:34:45 AM
Hello Peter


I have attached a sample Gcode below. The code has been working for a long time on our 20 year Old CNC controller. Sorry about the mess. Once I get the right format that will work on Mach 3. The code will be cleaned up with labels and line numbers.


N9992
G90
G71
G0
M70
G53
X629.14Y297.00
M71
F5000
G1X352.50
G0
M70
X350.64Y296.00
M71
G1X319.64
G0
M70
X317.63Y297.00
M71
G1X41.12
G0
M70
X39.64Y296.00
M71
G1X9.14
G0
M70

Thanks
Renato
Title: Re: Properly doing "Run Frome Here"
Post by: PeterF on June 30, 2010, 07:53:19 AM
renato, which line is the RFH line, the first line to be executed in RFH?


PS G53 needs to be on the same line as X and Y to which it applies. You have it alone on one line, it will not be effective for the next line. This is a side notice.
Title: Re: Properly doing "Run Frome Here"
Post by: renatom on June 30, 2010, 08:04:01 AM
Hi peter

Any RFH starting M71. Point taken on G53 thanks for the correction.

Thanks
Renato
Title: Re: Properly doing "Run Frome Here"
Post by: PeterF on June 30, 2010, 08:20:23 AM
In my opinion the preflight will turn off (M71+M70, with M70 as the last command), and RFH will turn on (M71).

However I believe Hood would be in a better position to tell whether your constellation is run correctly from Mach3's point of view. (correctly sequencing the several M70 and M71's in the preflight)

 I could imagine your external device does not like (enjoy) M70 and M71 within the same millisecond. You could try a dwell  G4 as the RFH point, just  before M71.

PS my manual reads: "Run From Here performs a dummy run of the program to establish what the modal state (G20/G21, G90/G91 etc.) should be..." I'm not sure if that is in the offical Mach3 documentation therefore I post it here.
Title: Re: Properly doing "Run Frome Here"
Post by: renatom on June 30, 2010, 06:32:47 PM
Hello Peter,

Thank you for your ideas, time and Help. I will investigate more and will let you know the outcome.

Thanks

Renato
Title: Re: Properly doing "Run Frome Here"
Post by: BR549 on June 30, 2010, 06:41:44 PM
RFH is NOT suppose to cycle any Mcodes. It is just suppose to cycle the modal states to insure mach wil restart in the correct place in the Correct mode. That is why in the popup it asks IF you want the spindle to turn back on as it not capable of doing it from the preveiw.
Title: Re: Properly doing "Run Frome Here"
Post by: BR549 on June 30, 2010, 08:50:19 PM
Well testing proved that part wrong (;-) Seems it has changed from older versions. It does run Mcodes during the preveiw.
Title: Re: Properly doing "Run Frome Here"
Post by: Hood on July 01, 2010, 04:17:53 AM
Terry RFH will not switch on spindle unless you select it in the prep move box but it will do other M Codes such as coolant, or at least it will do them for me. It has always been that way for me for at least 3 years, prior to that I do not know as I never had any things such as coolant controlled from Mach.
Hood
Title: Re: Properly doing "Run Frome Here"
Post by: Hood on July 01, 2010, 05:34:05 AM
Meant to say Tool Changes dont work in RFH, for me at least, in Turn, dont have a changer on the Mill so dont know.
Hood
Title: Re: Properly doing "Run Frome Here"
Post by: PeterF on July 01, 2010, 07:07:35 AM
someone should write a specific diagnostic M70 and M71 that just pops a message. (M70 M71 are not among the well-known like M0 thru M9. MAch3 cannot do special handling for them).
Title: Re: Properly doing "Run Frome Here"
Post by: Hood on July 01, 2010, 07:13:17 AM
In reality you should only be using over 100 for custom M Codes.
Hood
Title: Re: Properly doing "Run Frome Here"
Post by: Hood on July 01, 2010, 07:23:22 AM
Actually should maybe clarify what I said above,  Custom User macros should be over m100. It is quite OK to have custom versions of standard m-codes such as tool change (M6), Coolant(m7,m8,m9) etc.
Hood
Title: Re: Properly doing "Run Frome Here"
Post by: BR549 on July 01, 2010, 09:59:36 AM
Might be time to revist how the RFH works, scary thought to have it cycle macros. Scan them for modal values yes, run them NO. I guess that might have been the reason we stopped trying to use the RFH several years ago.

I will have a look in the old trouble notes.
Title: Re: Properly doing "Run Frome Here"
Post by: PeterF on July 03, 2010, 07:55:40 AM
I tried a test, and Mach3 executes macros in preparation for RFH. When clicking "RFH", Mach3 does the macros up to before the RFH line. After that, Mach3 needs a click on Run for the preparatory move and another click on Run for running from the RFH line. Consequences for renatos problem to be discussed later.

Macro used was: (file M71.m1s in folder \mach3\macros\ your profile name \
'M71
public m71call

m71call=m71call+1
p = param1()

msgbox"in m71" & " m71call=" & m71call & ", p="&p


G Code was:
(beginn)
G0 X0  
m71 p10
M71 p15
G0 X1
m71 p20
G0 X2
%

To explain the test, p10, p15 and p20 are arguments to the macro. Reading them in the macro is thru the Param1() function. The arguments help to distinguish and identify the macro calls, in this test.
Title: Re: Properly doing "Run Frome Here"
Post by: renatom on July 03, 2010, 08:06:45 PM
Hello Peter

Thanks for spending time running a test on the current problem that I am having.

Thanks
Renato
Title: Re: Properly doing "Run Frome Here"
Post by: PeterF on July 04, 2010, 04:15:18 AM
Renato, I apreciate it. The test was easy and just a few minutes. It sounds still unlogical that RFH turns your device off, because the first M71 in RFH is executed isolated.

(Please be aware that RFH seems only preparatory, and after that two RUN are required. The prompts are written  in the message windows. The line for RFH is selected with the arrow keys, not by clicking with the mouse on the line. Did you take all  this into account?)
Title: Re: Properly doing "Run Frome Here"
Post by: PeterF on July 04, 2010, 02:59:48 PM
renato wrote:
Macro M71 turns on a Solinoid Pneumatic Valve and its turning on and OFF during the run of RFH.

Peter writes:
this seems correct behaviour, as there are in fact several M71 and M70 above the RFH line.
RFH seems preparatory. After RFH, one has to start the program using RUN twice. First RUN is again preparatory, second RUN actually starts from the line.
Title: Re: Properly doing "Run Frome Here", M Code ranges
Post by: PeterF on July 04, 2010, 03:05:59 PM
Actually should maybe clarify what I said above,  Custom User macros should be over m100. It is quite OK to have custom versions of standard m-codes such as tool change (M6), Coolant(m7,m8,m9) etc.
Hood

From the Mach3 customization Wiki, chapter 2:
Mach3 macros. As already mentioned, a macro is a piece of VB Script. Each macro has a name like M134. The M is used at the start of every macro name and the number can be any integral value up to 99999 that is not used to define a built-in M-code. These built-in numbers are listed in chapter 11. Thus for example, M12, M50, M16543 are all valid macro names; while M3, M-56, M0234, M567.4 are not valid names. Standard macros will use the number range up to M999, Original Equipment Manufacturers (OEMs) are advised to use M1000 to M89999 and end-users can avoid naming conflicts by using M90000 to M99999.

edited for readability.
Title: Re: Properly doing "Run Frome Here"
Post by: Hood on July 04, 2010, 05:06:38 PM
Every day is a school day :)

Hood
Title: Re: Properly doing "Run Frome Here"
Post by: PeterF on July 04, 2010, 05:21:26 PM
Renato:
The other similar command, Set Next Line, lets abbreviate it as SNL, doesn't preparatory scans. But it wouldn't do either other preparatory state changes (G20/G21 and more, see any documentation on G Code for the modal states)

Hood has been right in one of his earlier posts on page 2 of this thread:
The checkbox, Ignore M Calls While Loading in the third column of Config->General Config, inhibits Macros only when Loading G Code. It does not inhibit macros during RFH.  Hood also mentioned SNL in that earlier post.
(http://www.machsupport.com/forum/index.php/topic,14579.msg101852.html#msg101852)
Title: Re: Properly doing "Run Frome Here"
Post by: renatom on July 11, 2010, 11:03:03 PM
Hi Peter, Hood.

Sorry for the late reply. We were busy the whole week moving to a new Factory. Anyway I have tried SNL which Hood and you suggested. I have notice that the feedrate is not taken into account when running SNL.

Thanks
Renato
Title: Re: Properly doing "Run Frome Here"
Post by: Hood on July 12, 2010, 02:03:20 AM
I dont use the Set Next Line but I would have thought the feedrate should be taken into account as long as it is on or after the line you are starting from. Possibly your code is written with the feedrate only at the beginning of code? If that is the case then have you tried entering the feedrate into the DRO before you do the SNL?
Hood
Title: Re: Properly doing "Run Frome Here"
Post by: renatom on July 12, 2010, 02:08:05 AM
Hello Hood,

That might be the case.  Anyway thank you very much for your support

Thanks
Renato