Hello Guest it is April 18, 2024, 03:10:33 PM

Author Topic: THC on off problem  (Read 4384 times)

0 Members and 1 Guest are viewing this topic.

THC on off problem
« on: August 26, 2015, 05:00:26 PM »
I´m having very much problem with turning the THC on in a gcode.
Included are the macros I use for turning the THC on and off and the file which I test the function with.
By them self the macros work fine, and if I delete the M101 in the gcode file it also work fine,
but when I run it as it is now it turns the THC on and then the Torch, and then nothing happens?? until I hit stop and the run again, then it continues, its like there is something wrong with the macro that I have to abort with the stop button.

I have also tried to move the M101 after M3 and then it hangs after M101.
There is no problem with klicking the THC button when the program is running.

I have been trying different approaches now for two hours and are supposed to have this ready for a customer on the morrow (in Sweden that is) so if anyone could help me it would be much appriciated.

M101 macro:

Rem THC On
If GetOEMLED(24) = FALSE Then
   DoOEMButton(123)
End If

M102 Macro:

Rem THC Off
If GetOEMLED(24) = TRUE Then
   DoOEMButton(123)
End If
   
Gcode:

N0010 (Filename: Plasmatest1.tap)
N0020 (Post processor: Mach3 plasma.scpost)
N0030 (Date: 26/08/2015)
N0040 G21 (Units: Metric)
N0050 G53 G90 G91.1 G40
N0060 F1
N0070 S500
N0080 (Part: Drawing1)
N0090 (Operation: Inside Offset, A new layer, T1: Plasma, 6 mm kerf)
N0100 M06 T1 F2000.0  (Plasma, 6 mm kerf)
N0110 G00 Z20.0000
N0120 X449.6106 Y299.8261
N0130 Z5.0000
N0140 M101
N0150 M03
N0160 G02 X456.7401 Y305.4020 I6.3527 J-0.7768 F2000.0
N0170 G01 X461.7031 Y304.7951
N0180 X426.0583 Y13.2934
N0190 X13.1060 Y56.9178
N0200 X24.7354 Y358.2275
N0210 X456.7401 Y305.4020
N0220 G02 X455.6415 Y296.4179 I-5.0413 J-3.9427
N0230 M102
N0240 M05
N0250 G00 Z20.0000
N0260 M05 M30
        

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: THC on off problem
« Reply #1 on: August 26, 2015, 11:43:25 PM »
You are going to have to add some logic to the  M010 M102 macros to determine IF the Thc is off, turn it on OR if the thc is on turn it off.

They way you are doing just toggles it reguardless if it is right or wrong.

Normally you just turn the THC on and leave it on. There are only a few instances where you would want to turn it off/on via Gcode Also there can be delays in macros so the timing of execution is not perfect.

You can set teh anti dive to do MOST of what you need done THC wise.

Just a thought, (;-) TP
Re: THC on off problem
« Reply #2 on: August 27, 2015, 01:21:29 AM »
How do you mean? thats exactly what the macros are doing:

M101 macro:

Rem THC On
If GetOEMLED(24) = FALSE Then 'Check if off, then turn it on, else do nothing
   DoOEMButton(123)
End If

M102 Macro:

Rem THC Off
If GetOEMLED(24) = TRUE Then
   DoOEMButton(123)
End If
   
I want do be able to set cutting rules in sheetcam to control the THC, thats why I want this to work.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: THC on off problem
« Reply #3 on: August 27, 2015, 02:33:00 AM »
My Mistake I misread your LED num. I thought you were looking at the torch LED  and then toggling the THC.

I tried you code here and it runs FINE.

Are you getting any error other than a stall.