Block Delete , Skip

Post anything you want to discuss with others about the software.

Block Delete , Skip

Postby dammogreen » Fri Dec 14, 2018 6:05 pm

Is there a way to Skip / Block (pre) specified lines of code *without* editing the G code each time.

I read that some other systems can skip lines of code marked with prepended with a "/" AND the external trigger is set to "Block Delete"


Currently I use subprogram calls in the main body of my G code and then comment the calls out I desire to skip .....embracing them with "(P100 .....)"
I use subprograms calls just because it is easier/clearer to comment out one line rather than a large group of lines.

However this requires opening the editor etc.

Something like M1 operation but for skipping lines instead of pause/hold.

Sorry if this has already been talked about, I searched for it but...Thanks in advance.
dammogreen
 
Posts: 61
Joined: Thu Jan 11, 2018 10:24 pm

Re: Block Delete , Skip

Postby cncdrive » Fri Dec 14, 2018 6:21 pm

Can you please describe this with an example code?
You've mentioned the / character as a skipping code, but how would that work?
It would skip one line or ... ?
An example via a code and some description would be great, because I do not fully understand it yet.
cncdrive
Site Admin
 
Posts: 4695
Joined: Tue Aug 12, 2014 11:17 pm

Re: Block Delete , Skip

Postby dammogreen » Sat Dec 15, 2018 1:22 am

See post #2 on the linked (external) forum:

"Block delete works in conjunction with a /, if you put / in front of a block and have the block delete on the control will skip that block, if block delete isn't on it will read it as normal."

...from this forum:

https://www.practicalmachinist.com/vb/c ... lp-217500/
--------------------------

>>> I pasted an example from here: http://cnc-programming-tips.blogspot.co ... mmand.html <<

"How the Block delete Command works on CNC Programming"
Block delete (/):
Block delete is used in a program by placing a forward slash (/) at the beginning of the line. It is a useful function which allows the operator to skip the blocks within the program. Block delete will not actually delete the blocks in the program but the block will be still there and those blocks will be ignored by the controller.
Block delete works same as Optional stop M01, so operator has to switch ON the Block delete switch on the control board, so controller will skip the blocks which are marked with forward slash (/) symbol in the beginning of the line or block. If the Operator forgets to Switch ON the Block delete Button then the Blocks marked with forward slash (/) symbol in the beginning of the line or block will be executed normally by the controller.

Example: In the example show below is the same program segment for two similar parts, except the part B has the addition of drilling holes.
Part A: 3 position of drilling holes (With Block delete ON in controller)
Part B: 6 Position of drilling holes. (With Block delete OFF in controller)

Program:
N170 G80 X0 Y10 Z-10 R02 F50
N171 X0 Y20
N172 X0 Y30
/N173 X10 Y10 (Used only for part B)
/N174 X10 Y20 (Used only for part B)
/N175 X10 Y30 (Used only for part B)

N176 M05
dammogreen
 
Posts: 61
Joined: Thu Jan 11, 2018 10:24 pm

Re: Block Delete , Skip

Postby Robertspark » Sat Dec 15, 2018 6:46 am

How would you turn block delete on / off

Macro number?
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: Block Delete , Skip

Postby ger21 » Sat Dec 15, 2018 12:10 pm

In Mach3, it's just a button on the screen.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2663
Joined: Sat Sep 03, 2016 2:17 am

Re: Block Delete , Skip

Postby cncdrive » Sat Dec 15, 2018 12:46 pm

Hmm, this is a good idea, thank you for the explanation, I'll try to implement it, but likely only in the next-next test release.
cncdrive
Site Admin
 
Posts: 4695
Joined: Tue Aug 12, 2014 11:17 pm

Re: Block Delete , Skip

Postby Battwell » Sun Dec 16, 2018 12:02 pm

would be even better if it could work like arduino codeing
*/ code
code
code
code
*/

would ignore all code between the */ which makes editing code in/out of a file much faster especially for large chunks of code
and have ignored code highlighted a different colour when in block delete mode (like unknown gcode highlights red)
(im suprised terry never asked for this)
Uc300eth on router and mill.
UK uccnc powered machine sales. https://cncrouter.uk/atc-cnc-routers.htm
Automateanything/duzzit cnc/mercury cnc
Battwell
 
Posts: 819
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Re: Block Delete , Skip

Postby Robertspark » Sun Dec 16, 2018 12:26 pm

I did wonder if a macro could do this by loading the current gcode file, purge based on / and save and reload... Terry would have I thought had a go
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: Block Delete , Skip

Postby Dan911 » Sun Dec 16, 2018 8:44 pm

Robertspark wrote:I did wonder if a macro could do this by loading the current gcode file, purge based on / and save and reload... Terry would have I thought had a go


It seems a macro wouldn't be that difficult.... if the line starts with a forward slash enclose in parenthesis. Quick test it doesn't seem UCCNC has trouble adding a forward slash to line start and of course is going to ignore line enclosed in parenthesis.

Code: Select all
 
System.IO.StreamReader reading = System.IO.File.OpenText(gcodefile);
string line;
while ((line = reading.ReadLine())!=null)
{
      if (line.StartsWith("/"))
      {
         line = "("+line+")";
                
      }
     gfile = gfile+line+Environment.NewLine;
}

Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Block Delete , Skip

Postby Blaise » Mon Sep 20, 2021 3:25 am

Any news on the développement of the block delete feature?
It is common on industrial machines and it would be a great added value tu UCCNC I believe.
I sure would use it!

Thanks!

- Blaise
Blaise
 
Posts: 81
Joined: Tue Jan 16, 2018 3:41 am

Next

Return to General discussion about the UCCNC software

Who is online

Users browsing this forum: No registered users and 7 guests