Hello Guest it is April 19, 2024, 02:49:57 PM

Author Topic: Plasma Consumable Tracking  (Read 40679 times)

0 Members and 1 Guest are viewing this topic.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Plasma Consumable Tracking
« Reply #60 on: November 01, 2012, 08:38:33 AM »
The problem is that MACH3 has a mind of its own with macros and scripts when combined with Gcode. It seems to loose control of the script threads and CAN on "some" systems just fly through the Script before each segment of Gcode is completed.

It seems to be the case with your machine. Here it runs fine. Loops through the gcode and updates the countdown.

SO I guess that cool stuff that combines Scripting and GCODE is out for the masses.  

A a double check can you run the script from the Script editor to see if it runs correct from there??

Load the Gcode open the editor select the macro code and then press run.

I guess I can try using semaphores

(;-) TP
« Last Edit: November 01, 2012, 08:41:06 AM by BR549 »
Re: Plasma Consumable Tracking
« Reply #61 on: November 01, 2012, 09:02:38 AM »
LOL. Actually I tried that last nite and it froze up my computer and I had to re-boot it. I know some machine are just weird. I have a dedicated computer on the cnc plasma. It's a real bare bones running XP. I don't know what's going on, but I'm stubborn, I'll try to figure it out. I'm always up for a challenge. lol I'll mess with it some later today, keep you posted. I might put that one on the back burner and try the next episode. I'm going to have another cup of coffee before I go out to the shop. I have to throw some logs in the woodburner and warm it up in there. It got chilly last nite, frost all over the place. I'll keep you posted on progress with this one. Have yourself a good day.

Thanks so much

GL

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Plasma Consumable Tracking
« Reply #62 on: November 01, 2012, 09:03:23 AM »
oK try this , It works here BUT then again so did the last version(;-) the idea is to make it work on your machine.


'Macro M3007 Auto Batch Load Horizonal
Dim fname As String
Dim Cuts As Single
Dim Xext As Double
Dim Yext As Double
Dim Test As String
Dim Cdown As Single
Sub Main()

Test = ("No File Loaded.")
Fname = FileName()
While Ismoving()
Wend
Message"" &Fname
While Ismoving()
Wend
If Fname = Test Then
MsgBox("No File Loaded, PLEASE LOAD FILE and RESTART")
 End
 End If
Cuts = Question("How Many Horizonal Parts UP TO 10 ?")
If Cuts >10 Or  Cuts <1 Then
MsgBox(" Number Out Of Range 1-10 Retry Again ")
 End

End If

Cdown = Cuts

SetUserDro(2002,Cdown)

Message" Parts to Go: "& Cdown

For x = 1 To Cuts
If x = 1 Then Goto N1
If x = 2 Then GoTo N1
If x = 3 Then GoTo N1
If x = 4 Then GoTo N1
If x = 5 Then GoTo N1
If x = 6 Then GoTo N1
If x = 7 Then GoTo N1
If x = 8 Then GoTo N1
If x = 9 Then GoTo N1
If x = 10 Then Goto N1


N1:

RunFile()

While Ismoving()
wend





Xext= GetOemDro(10)
While Ismoving()
Wend
Yext= GetOemDro(5)
While Ismoving()
Wend
Code" G0 Z1.00"
While IsMoving()
Wend
Code"X" & (Xext + .250)
While Ismoving()
Wend
Code"Y"& Yext
While IsMoving()
Wend
DoButton(8)
While Ismoving()
Wend
DoButton(9)
While Ismoving()
Wend

Cdown=(Cdown-1)

SetUserDro(2002,Cdown)
While Ismoving()
Wend

Next x

Message("End Of Batch Load")

end sub
End

 
(;-) TP
« Last Edit: November 01, 2012, 09:07:58 AM by BR549 »
Re: Plasma Consumable Tracking
« Reply #63 on: November 01, 2012, 09:20:29 AM »
I will try it, but I have to warm the shop up first, I hate cold. I'm an old transplanted desert rat. lol  I really appreciate the help, you have been more than helpful. I actually like messing with stuff, you have me hooked. I  need to get more up to speed on this style of code. Well, I'll give this latest version a try and mess with it. I'll keep you posted.

Thank you for being patient with this "Old Dog". lol

GL

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Plasma Consumable Tracking
« Reply #64 on: November 01, 2012, 09:56:31 AM »
From one old DAWG to another it is RUFF,RUFF  to get going on a cold day.

(;-) TP

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Plasma Consumable Tracking
« Reply #65 on: November 01, 2012, 10:13:44 AM »
IF that did not work try it this way. Enclosed macro.

(;-) TP
Re: Plasma Consumable Tracking
« Reply #66 on: November 01, 2012, 10:55:04 AM »
The first one you sent did the same as the other, but did run correctly if ran from the script editor. M3007b did the same, ran only one part and the counter went to zero before any move. But ran fine from the script editor.  WEIRD..... ???

GL

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Plasma Consumable Tracking
« Reply #67 on: November 01, 2012, 11:28:40 AM »
I am afraid this is one of those lost causes for the masses. When you mix Gcode and CB together "sometimes" all you get is a mess. (;-).  I will think on this some more .

(;-) TP




Re: Plasma Consumable Tracking
« Reply #68 on: November 01, 2012, 11:32:43 AM »
Sounds good. It isn't a life or death, gotta have it right now, end of the world situation. No rush at all. I'll say it again, I really appreciate the help.
 ;D What's next. lol

Thanks

GL

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Plasma Consumable Tracking
« Reply #69 on: November 01, 2012, 04:26:04 PM »
Is it tuesday again?  dang time flies.

Auto scale is next. Here iuse it about 1 time a day to adjust a cut profile(artsy work) to fit a piece of material OR make the pruduct larger or smaller as needed. Customer want THAT art BUT it needs to be 24" wide and the file is for 18"wide.

Here is the button codes AND there is NO GCODE involved here(;-)


    'Macro M3004 Auto Scale Start buttom
Dim Size1 As Double
Dim Size2 As Double
Dim Scale As Double

Size1 = Question(" Current Size ? ")   'Asks for the current size   
Size2 = Question(" New Size ?")      'Asks for the NEW scaled size
While Ismoving()
Wend
Scale = (Size2/Size1)         'Calculates the scale factor
While Ismoving()
Wend

SetOemDro(59,Scale)         'Set the X axis scale factor
While Ismoving()
Wend
SetOemDro(60,Scale)         'Set the Y axis scale factor
While Ismoving()
Wend

DoOemButton(160)         'REGEN the toolpath display
While Ismoving()
Sleep(100)
Wend

End   


'*****************************************************
'Macro Button to reset scaling
SetOemDro(59,0)
SetOemDro(60,0)
End

« Last Edit: November 01, 2012, 04:28:20 PM by BR549 »