new post problems

Having problems with or questions about SheetCam? Post them here.
Post Reply
jmajorg
Posts: 7
Joined: Thu Apr 23, 2020 2:04 am

new post problems

Post by jmajorg »

I am working on a post for a Koike laser cutter. This machine uses a macro at the beginning of a cut profile that establishes
laser settings for both piercing and cutting. This macro is different for different materials and thicknesses. There is also a macro
that is used at the end of the cut profile that shuts off the laser and raises the head making ready for the rapid movement to the next profile.
The post inserts the correct starting macro in the OnPenDown function and inserts the profile end macro in the OnPenUp function.
The problem is the ending macro is being inserted after the OnNewOperation function. Surely this is not correct. Am I doing something wrong?

Below is a sample of the output from the post.

O1000 (Filename: 9029014-3_KOIKE.tap)
(Post processor: KOIKE.scpost)
(Date: 4/20/2020)
G90
G92 X0 Y0 U0
G64
G20 (Units: Inches)
N1 (Operation: Outside Offset, 0, T17: 1/2" MS KOIKE NORMAL) (from OnNewOperation)
G90
G00 X2.5310 Y4.9933
G65 P5100 (from OnPenDown beginning macro)
G03 X3.4336 Y6.0074 I-0.0558 J0.9584
G01 X3.2146 Y9.7689
N2 (Operation: Outside Offset, 0, T17: 1/2" MS KOIKE NORMAL) (from OnNewOperation)
G65 P5200 (from OnPenUp ending macro) ??????????????????????????????????
G90
G00 X11.2310 Y4.7933
G65 P5100 (from OnPenDown beginning macro)
G03 X13.4336 Y6.0074 I-0.0558 J0.9584
G01 X13.2146 Y9.7689
G65 P5200 (from OnPenUp ending macro)
G90
G00 X-1.0000 Y-1.0000 (parking position
M30

The G65 P5100 should be before N2

Thanks
User avatar
Les Newell
Site Admin
Posts: 3668
Joined: Thu May 11, 2006 8:12 pm

Re: new post problems

Post by Les Newell »

This is a quirk of the post processor system that catches a few people out. In some cases the cutter does not need to lift between operations, for instance if you have chaining enabled. The post only knows if it has to reposition after the operation has started.

One workaround is to set a flag in OnNewOperation, e.g:

Code: Select all

   newOp = true
Now in OnPenDown:

Code: Select all

   if newOp then
      newOP = false
      ....do whatever you need to do
   end
Post Reply