Modifying a post...

Having problems with or questions about SheetCam? Post them here.
Post Reply
Davek0974
Posts: 286
Joined: Sat Feb 01, 2014 2:07 pm

Modifying a post...

Post by Davek0974 »

I need to modify a plasma post, I have already made changes but it's not quite there yet.

At present it inserts a pause before each cut, so the sequence is...

Move
Pause
Set ref
Cut
Lift
Move

What I want is...

Pause
Move
Set ref
Cut
Lift
Pause

I have inserted my changes here...

Code: Select all

function Reference()
   if (firstRef == true) then
     --do nothing
   else
      if (tool == 8) then --Tool 8 is a plasma tool used as a drill-marker
        --do nothing
      else
        post.Text (" M00")
        post.Text (" (Paused: Hit RUN to continue)\n")
      end
   end
Where should I stuff my code to get the right sequence? As you can see it ignores the pause on the first-ref because my post already pauses so you can check the voltage and current settings etc. Tool 8 is a standard plasma tool that I use at minimum current to create pecks where I can later drill with a standard drill.

The issue that came to light at the weekend was that it mis-fired on a cut, then moved to the next cut position, I rewound the code in Mach3 to the pause at the start of the mis-cut but as it positions BEFORE the pause it started the torch then happily dragged itself cutting across the plate until it reached the start position :)

If I can get it to position AFTER the pause and BEFORE the cut, everything will be sweet :)
Davek0974
Posts: 286
Joined: Sat Feb 01, 2014 2:07 pm

Post by Davek0974 »

I think I have it sussed now,

I declared a variable at the start of the post

post.DefineVariable("MyPause",-1)

At the end of the "OnRapid" block, I put this code

Code: Select all

   if(MyPause == true) then
      if (tool == 8) then --Tool 8 is a plasma tool used as a drill-marker
         --do nothing
      else
         post.Text (" M00")
         post.Text (" (Paused: Hit RUN to continue)\n")
      end 
      MyPause = false
   end
In the "OnReference" block I put this line...

MyPause = true

So, the variable is false when the job starts - my code does nothing for the first reference and cut.
After the first reference, MyPause is now true.
On the next rapid my code now stops the operation before positioning.

The variable was needed as simply putting the code in the OnRapid block without it seemed to insert multiple pauses.

Seems to work.
drafting@gsb
Posts: 2
Joined: Mon Jan 27, 2020 6:20 pm

Re: Modifying a post...

Post by drafting@gsb »

Hi,
I am having no clue in the Macro language. Please help me to sort a situation where I want Pauses before every cut in Plasma Rotary Mach3 by editing the post.
I have a situation where I wanted this sequence
Travel from origin
Set Ref
Cut
Lift
Pause
Move to the next cut
Pause
Set Ref
Cut
Lift
Move to the next cut
Pause
Set Ref
Cut
Lift
Move to the next cut
And so on till the last cut

Let me tell what I did
I declared a variable at the start of the post

post.DefineVariable("MyPause",-1)

Inside of “OnRapid” block ,At the end I put this code
if(MyPause == true) then
if (tool == 0) then --Tool 0
--do nothing
else
post.Text (" M00")
post.Text (" (Paused: Hit RUN to continue)\n")
end
MyPause = false
End
In the "OnReference" block I put this line...

MyPause = true
I used tool 0 as I don’t want any operation to take place
This stops the torch immediately after the first cut, and doesn’t move to the next cut, which is not I wanted.

Someone please respond.
Davek0974
Posts: 286
Joined: Sat Feb 01, 2014 2:07 pm

Re: Modifying a post...

Post by Davek0974 »

Hi

For some reason, the code i posted is corrupted, there are lots of figures and junk in there - it will not work,

Her is my own post file, you can study and take what you like but note it will NOT work for you directly because i have a very custom setup here.
DTHC-HYT-TAP-rev11B With Pauses.scpost
(23.21 KiB) Downloaded 64 times
Dave
User avatar
Les Newell
Site Admin
Posts: 3661
Joined: Thu May 11, 2006 8:12 pm

Re: Modifying a post...

Post by Les Newell »

You need to put your code at the start of function OnPenDown(). OnPenDown is called just after the move to pierce height.
Post Reply