Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: scbrniddvl on October 27, 2012, 03:01:40 PM

Title: Plasma Consumable Tracking
Post by: scbrniddvl on October 27, 2012, 03:01:40 PM
Does anyone have any way of tracking consumable usage, change date, cost and so on in Mach 3. I think it would be a very handy way to track expenses and aid in cut quality.
Title: Re: Plasma Consumable Tracking
Post by: BR549 on October 27, 2012, 04:28:22 PM
(;-) Funny you should ask, I am redoing the consumables tracking for plasma using SheetCam and Mach3 for the shop here.

DO you use SheetCam ? What are looking to track. I have all the mods you need to make to the Scam post to get the values OUT of Scam and into Mach3.

DO you want to help layout a tracking function in MACH3 ? 

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 27, 2012, 04:50:46 PM
Sounds like fun to me too. What do I need in the way of software to help? I use SheetCam, Mach 3, I just downloaded Mach3Screen.
I would like to track electrode and tip usage, so I would need total inches cut, pierces, install dates, etc. Cost factors would be cool also.

Let me know what else in the way of software I would need at this end.      

Thanks for the reply.
GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on October 27, 2012, 06:47:18 PM
OK here is what you need to do first. You will have to add these mods to your Scam post. This allows Scam to bring out the values and get them into the Gcode in a form that MACH3 can use. IF you cannot do the mods let me know and I can fix your post for you.

The part that say Oninit()  is a section and the addon code is after that part. There are several sections that you have to add code to.

SheetCam
Mach3
MachScreen

YEP that will do.

After you get the post running we can work on a new page i mach3. Think about what you want to see.


ADD this to the Scam POST for the Consumables values ( Cut Inches, #pierces)


ONInit()

Tpierce = 0
totalLength = 0

****************************************************
ONPenDown()

Tpierce = (Tpierce + 1)

****************************************************
ONMove()

 totalLength = totalLength + len

****************************************************
ONArc()

totalLength = totalLength + len

****************************************************
ONFinish()


post.Text (" #650 = ")
   post.Number(totalLength * scale,"0.### \n")
   post.Text (" #651 = ")
   post.Text  (Tpierce )
   post.Eol()

   post.Text ("( CUT Units = ")
   post.Number(totalLength * scale,"0.### \n")
   post.Text (" #Pierces = ")
   post.Text (Tpierce,")\n")
  

*****************************************************

Example of the end of Gcode file Showing the #var call back to Mach3

N3710 M05
N3720 G00 Z0.5000
N3730 X0.0000 Y0.0000
N3740 #650 = 55.133 #651 = 8
N3750 (Cut Inches= 55.13  #pieces= 8 )
N3760 M30


To make use of the Values You need to modify the M1030 macro in Mach3. It runs as part of the  M30 end

of file Mcode.

M1030 macro mods, Add this

SetUserDro(2000, (GetUserDro(2000) + GetVar(650)) )  
SetUserDro(2001, (GetUserDro(2001) + GetVar(651)) )  

That transfers the #var's value to the Consumables page DROs . The REAL Dro numbers are whatever you

used(;-)

After every cut file is complete the Consumable Values are added to the Consumables Page.
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 27, 2012, 08:07:43 PM
Thanks. Doesn't look to difficult.  I'll get on it tomorrow and let you know how I do.

Thanks
GL
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 28, 2012, 04:29:29 PM
Ok, Had to play with the post a little bit, but seems to work right. Distance and pierces seem to be correct. And the 650, 651 posts look the same as your example.

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on October 28, 2012, 05:09:24 PM
OK next you need to decide HOW you want to look at the info. Main page , Add on to an existing page or create a new page. Then to start you need to ADD the 2 DROS I used USERDRO(2000) and USerDro(2001) you can use what you like to use. You just match the 2 to the M1030 macro calls to update them. ONCE you have the dros on screen THEN everytime you run a program and the M30 runs you will see updated values on the  DROs. It just adds the Program values to the Existing total.

Get that part going and we will move ahead.(;-)

Examples:
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 28, 2012, 05:19:25 PM
Sounds good, I'm sure I'll probably have a few questions before I have success. lol

Thanks
GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on October 28, 2012, 05:23:21 PM
I normall put a set of the DROS on the main work screen. That way you can see what the running total is ON the nozzle and tip. You will notice that after you mod the Scam post that the LAST message in the program shows the Programed values for  Cutinches and #pierce. It is that way because WHEN you load a new CUT program MACH parses through ALL the messages and LEAVES that LAST ONE in the file visable in the STATUS bar. (;-)

NOw you loaded the new cut program and just look at the totals on your  consumables AND add the status bar to see HOW MANY inches and pierces that program will add . NOW through your history of consumables you KNOW that chances are good that you may have to stop and change out a tip You can decide to change it out NOW. I know sometimes we cut ARTSY part that may take an hour to run to completion. Having a nozzle wear out in the procees sometimes DEGRADES the part quality.

NOW can you track multiple consumable sets (finecut,40amp,60amp ,etc) SURE it just takes more time to set it all up.

Just take your time and get it worked OUT as how you want to see it all THEN we can work on the particulars(;-) Nothing in this is overly complicated to work out.

Here whit every event it writes to A FIle AND REPORTS.

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: BR549 on October 28, 2012, 05:30:04 PM
I would just decide on HOW you want to see it and then ADD the 2 DROs to your screen. Then run a program and make sure it updates to the DROs. Once that works you have the CAT by the tail.

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 28, 2012, 05:34:56 PM
I'll give it my best shot. Who knows, I'll probably learn something new. (Us old dogs are suppose  to have a problem with that. lol) I really appreciate the help.

Thanks again
GL
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 28, 2012, 08:58:07 PM
Thanks for all the help. I'm sure I'll need some assistance from time to time. This should be a great help. Remembering to keep a log on all that is pretty tough when your busy trying to get work done. I'll keep you posted on my progress. I'm new to the Machscreen program so I will have to learn as I go. You have been a great help so far.

Thanks
GL

Title: Re: Plasma Consumable Tracking
Post by: BR549 on October 28, 2012, 09:28:35 PM
IF you need help or get stuck give us a holler.

How about a preview function for plasma where you can load a program push a button and it will run(torch off)  the outside profile of the part as a preview of where it will cut. Just a simple Scam post mod AND a new screen button(;-)

I have a full bag of tricks for plasma.

Just a thought, (;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 28, 2012, 10:35:49 PM
That would be cool as hell. Especially when cutting things out of scrap pieces of material. Lay it on me "Oh Guru of the G-Code"

Thanks
GL
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 28, 2012, 11:20:20 PM
I had a problem last week that was quite strange. I had installed Scam ver ?.?.16 (one of the newer versions) and tried to run the post processor on a very simple file that worked fine in version ?.?.14. Everything worked fine except it did not enter the switchoffset value. Then I installed version ?.?.21 and it did the same thing. Then went back to version ?.?.14 and it worked great. Got me scratching my head. Do you have any ideas?

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on October 29, 2012, 12:01:40 AM
Here is the process for the part preview function. Once in place you load up your Gocde file then set X0Y0 and make sure the Z is at a safe travel height. Press the preview run button. The machine will travel the outside profile of the part. When complete the program rewinds back to teh start. You can run it as many times as you like if you need to shift the metal around OR use the G68 function to rotate the program to fit the material.

When you have finished alignment just press Cycle start as normal .

I GUESS we really need to start a master Scam post for mach3 plasma with all the goodies built in.

Modify your SheetCam Post(;-)

ADD to


 OnPenDown()

 if  (string.find(operationName, _("Outside Offset") )) then
     post.TextDirect("o549 \n")
     post.Text (" X")
     post.Number (Sline1,"0.0000")
     post.Text(" Y")
     post.Number (Sline2,"0.0000")
     post.Eol()
   end


ADD TO  OnRapid()

   Sline1 =  (endX * scale)
   Sline2 =  (endY * scale)


Mach3  PREVIEW  BUTTON macro CODE************************

'Macro To AutoPreview
Sub main()
 Msg="Is Your Z HEIGHT Safe To Travel AND X0Y0 set?"
Response = MsgBox(Msg, 4 )
If Response = 7 Then
GoTo N3:
Else
GoTo N2:
End If
N2:
Code"G1 F30"
Code"M98P549"
DoButton(0)
GoTo N4:
N3:
MsgBox("Move Z To A Safe HEIGHT OR set X0.000 ,Y0.000 And Restart")
GoTo N4:
N4:
End Sub
End
Title: Re: Plasma Consumable Tracking
Post by: BR549 on October 29, 2012, 12:03:22 AM
DId you verify that it KEPT the same POST when you did the update?

I alway follow the rule "IF it ain't broke and I don't need it DON"T fix it" or update it(;-)

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 29, 2012, 12:17:49 AM
 ;D Cool new goodies... Thanks, your bound and determined to keep me busy. lol Feeling like Christmas!
As to the Scam version thing...Yeah I used the exact post processor and source dxf. Along with a couple variants of the post processor. Weird stuff. But like you said, "It ain't broke so I'm using it."

Thanks so much

GL
Title: Re: Plasma Consumable Tracking
Post by: Ya-Nvr-No on October 29, 2012, 09:12:59 AM
Terry is full of great ideas and solutions, but I guess I will just have to get used to calling him Sherry now.  ::)
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 29, 2012, 09:20:01 AM
LOL. Terry has been great. I think he is out to be the source for Scam and Mach stuff. He has been a great help to me, not to mention is giving a lot of homework. lol I have learned so much on this forum you guys are the best.

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on October 29, 2012, 10:45:48 AM
OH NO the secret is OUT(;-) My wife is REALLY the master mind behind all this. She is just bashfull.

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: Ya-Nvr-No on October 29, 2012, 10:54:38 AM
So would that be she was smart or / ______ enough to marry you. (fill in the blank)

Keep up the fine work.

You could make the screen set available, cause I'm having way too much fun engraving to program.
Title: Re: Plasma Consumable Tracking
Post by: BR549 on October 29, 2012, 11:05:28 AM
DUMB is the correct word (;-) I guess we could modify the stock PLASMA screenset. BUT who uses those?

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: Ya-Nvr-No on October 29, 2012, 11:12:13 AM
I modify everything for my use, but I am sure I'd use what you came up with as a great starting point.

Then I'd say you are the Smart one for letting Sherry straighten you out.
Title: Re: Plasma Consumable Tracking
Post by: BR549 on October 29, 2012, 07:43:22 PM
SO are ya ready for the next episode of "How the Plasma World Turns" starring the AutoScale Function?

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: tripleblack on October 29, 2012, 09:06:17 PM
Terry, about modifying the m30 and the m1030 macro. where are they located? be damned if i can find them unless its too obvious am i am just dumb.

Title: Re: Plasma Consumable Tracking
Post by: BR549 on October 29, 2012, 09:21:35 PM
You do not modify the M30 Just the M1030. You MAY NOT have an M1030 so you have to create it.

WHen the M30 runs it CALLS the m1030.

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 29, 2012, 10:56:13 PM
 ;D Ok Terry. I inserted a couple DRO's on the Program page in the lower right corner, modified the M1030. And believe it not, it works!!! Sweet little addition. I made a quote and invoice database in Access and with this little trick I can easily plug in my total inches and pierces into my cost figures. Sweet, sweet, sweet!!! I was having to keep so many notes and have to pull up the drawing files all the time to compute this stuff.

Thank you, Thank you my friend,
GL
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 29, 2012, 11:01:29 PM
Now I guess I'm ready to start on a consumables page. That will be a great help in figuring cost numbers. Tell Sherry Thanks to.

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on October 29, 2012, 11:06:06 PM
GL you do know that the function can WRITE and update a file on the fly. WHy are you still transfering it by hand ??

(;-) LOL , (;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 29, 2012, 11:06:55 PM
I'll try out my luck on the "Preview Routine" tomorrow. You have some gooooooood stuff. This is fun.

Thanks
GL
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 29, 2012, 11:11:05 PM
Hey, I'm just learning, give me a break. LOL I have so many things running through my head right now on helpful stuff that can be done, let me correct that, that you have probably already done. I will have to keep picking you brain. Hope you don't mind.

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on October 29, 2012, 11:27:55 PM
I will help any way I can.

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 30, 2012, 02:01:27 AM
Terry is there a way to program a botton to subtract the values that was just added to the Units and Pierces DRO's? That would be nice to have if you had to Re-Gen a file to move the piece of material and re-zero the program zeros. That way the cumulative total would be correct.

Just wondering

GL

Title: Re: Plasma Consumable Tracking
Post by: BR549 on October 30, 2012, 09:28:22 AM
The values will not update until the M30 runs and that triggers the M1030 to run. You can stop and start mid program if needed and it shoudl NOT trip the m30.

But yes you can create a button to do the subtract as welll as it can add. Use the same code but instead of the + sign substitute the - sign.

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 30, 2012, 12:50:28 PM
Having trouble with the button. It doesn't want to do anything. I made a user defined button in Machscreen and (if I understood you correctly) made a macro like the 1030 except with "-" instead of "+" named it 1031. Assigned it to the button and saved the .set file. Everthing shows up where it belongs, but won't do anything. I also tried naming the macro Reset-1.m1s to see if there might have been a conflict. Still nothing, Error line shows,
"Nested comment found , Block = SetUserDRO(2000, (GetUserDRO(2000) - GetVar(650)) )
SetUserDRO(2001, (GetUserDRO(2001) - GetVar(651)) )

I don't know where you live but hopefully not on the East Coast. Hope your warm and dry.

Thanks

GL
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 30, 2012, 02:58:29 PM
Ok, solved my problem by checking the "Ignore M calls while loading". DUHHHH! I stupid. The total units and pierces still show in the Error bar so I can do a little elementary math in my head to determine whether or not to change nozzle or what ever. I liked your consumable page. That's pretty sharp.

Thanks

GL

Title: Re: Plasma Consumable Tracking
Post by: BR549 on October 30, 2012, 05:04:01 PM
OK if you wanted a subtract button. IN Machscreen create a user button AND while you are there add this code to the button.

SetUserDro(2000, (GetUserDro(2000) - GetVar(650)) ) 
SetUserDro(2001, (GetUserDro(2001) - GetVar(651)) ) 

THen when you have loaded MACH3 back up and then you have a Cut file loaded then pressed the button it will subtract the Values from your running totals.

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 30, 2012, 07:51:26 PM
Got things working! ;D I Decided to use the nice built-in feature of Mach to ignore M calls while loading. Works well for my situation. I cleaned up the settings page and dumped some stuff I don't need and put in a consumable area similar to the one you have. I am very pleased so far with the way it works, thanks to you. I have a couple more parameters to put in and then I'll be happy.
Hope everything is going well with you.
I'll post back with more results.

Thanks for everything so far. (You notice I said "so far" LOL)

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on October 30, 2012, 09:10:54 PM
Good to hear good job.  I have the file writing stuff IF you need it(;-)

DiD I tell about the Auto Stacking routine were you can stack multiple cuts of the same part and cut quantaties of the same part. either Horizonally or vertically ? Just an extra button(;-)

SOrry could not resist, (;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 30, 2012, 09:24:03 PM
Your so bad..... >:D Of Course I want it. lol
Well I have the current nozzle and electrode inches and pierces DRO's, and the Current Job inches and pierces DRO's w/reset button on the Program page. And on the Settings page, Total inches and pierces DRO's w/reset button, Current nozzle and electrode inches and pierces DRO's w/reset button and Current Job inches and pierces DRO's w/reset. After a bunch of learning curve I think it came out pretty good.


And yes you are bad, but Thank You anyway.

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on October 30, 2012, 09:48:40 PM
i have a change out button for the nozzle AND the electrode as I track them separately.  press the button and it transfers the value to the totalizer dros that calculates the  total inches and pierces that set got, and then adds the values to the average stack to be added in for a new average inches and pierce per unit. then calculates the average CO$T per in and pierce for the consumables. That is for the part estimating side to make SURE the cost don't sneak up on you

You can have what you want or need. Ya just have to do what you need to do to get it and old DAWGS CAN learn new tricks.

Have FUn, RIng the bell if you need more, (;-) TP

Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 31, 2012, 12:26:51 PM
Terry, the preview button is a sweet little tool. Works great. You 'da man.

Thanks

GL
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 31, 2012, 05:55:51 PM
Hey Terry, I realized something today searching around on the forum. The administrator "Chaosticone" is a neighbor. Crazy world. I probably know him, but not in this realm. Anyway, today has been house keeping, cleaning up my screens and finding room for new gadgets. Hope your day is going good. I'm basically ready for my next course. lol

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on October 31, 2012, 07:33:47 PM
OH GEZZ the "As the plasma Turns" show only comes on on tuesday night right after NCIS. (;-)

What do you want to try next auto scale  or auto stackumup.

Auto Scale is a simple and easy way to adjust the G code scale functions.  It ask what size is your current part AND what size do you want it. YOU can only pick one axis to do the scaling from and it scales BOTH axis from that so that it maintains the same aspect ratio of the part.

Auto Stackumup is a function to cut multiple parts with the same file. Load your program then hit the button and tell it HOW MANY parts (1-10) that you want. AND make sure it has enough room on the material to cut them all out.  Say you have a part "Turtle Card Holder" and it is 4x6" . The order comes in for 6 of them.  Load the material, load the G code Set X0Y0  . The first part will cut then the machine moves OVER to the far right extents of the first part and adds .250" resets the X0Y0 and cuts the part again, and again,and again until 6 parts are cut. Then it stops.  In the meantionme you are free to do other work while IT does all the work.

There are 2 versions one for horizonal and one for vertical  (L/R and Up/Down).

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 31, 2012, 08:19:32 PM
Strange isn't it. And on Halloween to boot. lol

Ok, since I'm on a roll why not Auto Stackumup. I could use that quite often. Sometimes it's a pain to go through a nesting program for something your only going to make a few number of. Or manually re index the machine.

Thanks

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on October 31, 2012, 08:35:06 PM
OK we interrupt your normal show for this special "As the Plasma World Turns".

Auto Stackumup.  This is your button code.  To run load your material,  then load your Gcode and set X0Y0. NOW press the button. NOW if you forgot to load the program it will squeal on ya and make you go back and load it(;-). It will also ask how many copies(1-10) you want. You need to make sure you have enough room for the parts to cut.

'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

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

For x = 1 To Cuts
If x = 1 Then RunFile()
If x = 2 Then RunFile()
If x = 3 Then RunFile()
If x = 4 Then RunFile()
If x = 5 Then RunFile()
If x = 6 Then RunFile()
If x = 7 Then RunFile()
If x = 8 Then RunFile()
If x = 9 Then RunFile()
If x = 10 Then 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

Next x

Message("End Of Batch Load")
End

 
                     
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 31, 2012, 08:53:53 PM
Sounds pretty cool. :o I will have to look up Brett and give him a Howdy. Anything nasty you want me tell him in person.  >:D
I'll have that new chore done by some time in the morning. Thank you very much. Anything I can do for you? Let me know.

Thanks
GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on October 31, 2012, 09:02:23 PM
RIng the bell for the next episode(;-)

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 31, 2012, 09:15:42 PM
It only cuts 1, no matter what you enter. Any ideas?
Title: Re: Plasma Consumable Tracking
Post by: BR549 on October 31, 2012, 09:18:38 PM
Are you running the machine or just looking at the pretty picture(toolpath) on the toolpath you will only see 1 as it always starts based on 0,0.

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 31, 2012, 09:21:50 PM
Running the machine with torch off. That shouldn't make a difference should it?

GL
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 31, 2012, 09:24:34 PM
I loaded a program, zero'd the program DRO's and pushed the button. It makes the first pass and stops.

GL
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 31, 2012, 09:27:37 PM
Should there be some sort of diminishing counter. I don't see anything in the macro to suggest that. Of course I'm old and blind in one eye and can't see out of the other. lol
Should the next X statement be: X-1 maybe?
GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on October 31, 2012, 09:38:45 PM
OK I SEE what it is. It was developed on and OLDER version of MACH back when it actually had control over the threads . I will have to remake it to work with the newer versions.

countdown ? it could have.

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 31, 2012, 09:44:23 PM
Sounds good. I'll be your tester. lol Ok, Dr., you do your thing. I'll probably ring your bell tomorrow or just wait to see something from you. No hurry.

Thanks much

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on October 31, 2012, 10:14:56 PM
OK this fixes it here, give it a whirl.  ALSO I put in a countdown for ya. You will have to add a userdro(2002) to your screen. I tried to write it to the status BAR but when mach3 reruns the Gcode it writes  the gcode messages over the to go message(;-). SO if you want a countdown add the dro.

(;-)TP

'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

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 RunFile()
If x = 2 Then RunFile()
If x = 3 Then RunFile()
If x = 4 Then RunFile()
If x = 5 Then RunFile()
If x = 6 Then RunFile()
If x = 7 Then RunFile()
If x = 8 Then RunFile()
If x = 9 Then RunFile()
If x = 10 Then RunFile()

While Ismoving()
Wend
COde"G4P1"


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

 
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 31, 2012, 11:38:04 PM
Hey, it wasn't that I wanted a countdown, I am of the old school of programming, not use to this type. I didn't see a way for the macro to loop since I didn't notice a way to subtract a cut number per loop of the program. I know I'm dumb, trying to learn. I remarked the dro stuff out, and it still only cuts 1 pass. Don't worry about it, like I said no hurry.

Thanks

GL
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 31, 2012, 11:50:28 PM
That was interesting, I put a DRO in and when I entered the quantity of parts it showed what I entered, but did a countdown to 0 before it started its cut move. And just cut one.

GL
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on October 31, 2012, 11:59:05 PM
Just tried it with torch on, thought it might make a difference, but did the same. Something to ponder, yes?

Thanks

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 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
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl 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
Title: Re: Plasma Consumable Tracking
Post by: BR549 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
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl 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
Title: Re: Plasma Consumable Tracking
Post by: BR549 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
Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 01, 2012, 10:13:44 AM
IF that did not work try it this way. Enclosed macro.

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl 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
Title: Re: Plasma Consumable Tracking
Post by: BR549 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




Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl 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
Title: Re: Plasma Consumable Tracking
Post by: BR549 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

Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 01, 2012, 05:52:45 PM
I've been messing with the Stackumup macro on and off all day. Even this version I messed with works perfectly from the editor. But when run from the button it drops the Cdown to 0 and only makes 1 part.

'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(2010,Cdown)

N1:

RunFile()
While Ismoving()
Wend
Message" Parts to Go: "& Cdown
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(9)
While Ismoving()
Wend
DoButton(8)
While Ismoving()
Wend
Cdown=(Cdown-1)
If Cdown >= 1 Then
 SetUserDro(2010,Cdown)
 While Ismoving()
 Wend
 GoTo N1
ElseIf Cdown=0 Then
 Message("End Of Batch Load")
 End
End If
End Sub

What do you make of that?
Auto scale looks really nice. Play time. LOL

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 01, 2012, 05:59:09 PM
Yep that IS the main problem. I cannot find a way to keep the VB side in Sync with teh Gcode side in all cases. It all works here EVERY time from a button or the editor BUT I know what it does on other machines. It blows right by all the Gcode  stuff in one pass and does the last run.

I am truing to work out a solution even IF it is long winded to make it behave. ALL help welcome.

COme right up and take a shot at the autostackumup function. Earn your wizard badge in one session(;-)  Makes us look like dummies we don't care we are tuff. (;-)

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 01, 2012, 06:07:51 PM
LOL. What computer are you using? What Kernal speed due you run in Mach?
With one confuration I did, I got a "Cannot Zero while running" Error. Don't know what was up with that.

Wondering?

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 01, 2012, 06:30:33 PM
You got the error because mach3 was till RUNNING the Gcode program at the same time it was trying to Rezero the axis. The CB code was jumping over the Gcode and running at the same time.

Try this version(;-) AND yes it runs file here. But that is not unusal.   

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 01, 2012, 06:48:27 PM
Unfortunately, nope. Maybe rather than run it normally, can you have run from the editor? lol I know I'm a wise ass.

Got to go eat dinner

Thanks

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 01, 2012, 07:13:58 PM
NOPE it runs from a button on the main screen (;-) Running it from the editor is easy almost anything will run OK from the editor. 

Perhaps some others can test the code to see IF it runs from their machine(;-). I can't have the only 2 computer that can run this OR can I ?

(;-) TP

Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 01, 2012, 07:23:46 PM
Oh well it will get figured out sooner or later. lol

GL
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 01, 2012, 09:23:57 PM
Ok, Terry. You have to level with me. What computers do you have. What's you General config settings in Mach and on which foot do you stand when you push the botton. lol


 ???

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 01, 2012, 09:36:26 PM
V.066 Acer Puter Vista of all things and it works fine here and at the shop on 2 different dells running XP and .043.020.

Now the version at the shop is slightly different but that was the very first version that you tried AND it did fail here there same way you have had it do . BUT the MODs I did from there on out work fine here before I posted them.

Looking BACK at some old trouble notes this has ALWAYS been a problem so It limits what I can send out for yall to use.

(;-(   Well what would YOU like to create that would help you out?

(;-) TP

Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 01, 2012, 09:42:52 PM
NOW just a thought are you running simulation mode without the driver loaded???  Here I am running WITH the driver loaded.

Just a thought, (;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 01, 2012, 10:00:59 PM
I am running normally just with the torch off. Not simulation. I figured that would be the best real world test. I have tried with the torch active and it made no difference.

I tried lowering kernel speed, that made no difference. I tried evoking a modified 3007 from the g-code and that didn't work any better either. But I'll keep messing with it.

If you have any brainy ideas, let me know and I'll try it.

Thanks

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 01, 2012, 10:49:17 PM
What OS and version of MACh are you running?

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 01, 2012, 10:52:10 PM
Windows XP Pro Service Pack 2, Mach 3 Ver, R3.043.066

GL
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 01, 2012, 11:10:07 PM
A week or so ago
i ran into a problem with the newer versions of SheetCam, Versions 4.0.16 and .21 weer not entering the switchoffset data from the post processor to the g-code. I went back to 4.0.14 and it worked fine.
Go figure. Strangeness. ???

Gl
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 02, 2012, 12:53:04 PM
I have a question. In the mod for the post processor for preview is this correct?

 OnPenDown()

 if  (string.find(operationName, _("Outside Offset") )) then
     post.TextDirect("o549 \n")
     post.Text (" X")
     post.Number (Sline1,"0.0000")
     post.Text(" Y")
     post.Number (Sline2,"0.0000")
     post.Eol()
   end

The post.TextDirect("o549\n")

Just looks strange.

Thanks

GL
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 02, 2012, 01:14:01 PM
This is what it looks like in the post:

N0260 (Operation: Outside Offset, Default, T1: Plasma, 0.018 inch kerf)
N0270 M05
N0280 G00 Z1.0000
N0290 X2.1858 Y-0.1858
N0300 Z0.1200
o549
N0310 X2.1858 Y-0.1858
N0320 G28.1 Z0.12
N0330 G92 Z0.0
N0340 G00 Z0.2000
N0350 G92 Z0.0
N0360 G00 Z0.1200
N0370 M03

 ???

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 02, 2012, 01:38:33 PM
(;-) In order to use the GOTO object the Oword it cannot HAVE a line number in front of it. SO the line in question

The post.TextDirect("o549\n") Does just that. IT writes the TEXT direct to the stack without the Line number.

That way the Oword is recognised by MACH3.


BUT something is wrong in your post as it should be inserted AFTER the M3 call so the torch will NOT light and the TOM(G28.1) will not run.

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 02, 2012, 01:52:03 PM
I learn something new every day. ;D Ok, that was just a snippet of the post I'll fart with it. I thought I inserted it where you said in the OnPenDown section. Here is what it looks like.

function OnPenDown()
   Tpierce = (Tpierce + 1)
   if (string.find(operationName, _("Outside Offset") )) then
     post.TextDirect("o549 \n")
     post.Text (" X")
     post.Number (Sline1,"0.0000")
     post.Text(" Y")
     post.Number (Sline2,"0.0000")
     post.Eol()
   end
   if(dist >= (refdistance)) then
      dist = 0
      post.ModalText(" G28.1 Z")
      post.Number(3 * scale, "0.00")
      post.Eol()
      post.ModalText(" G92 Z0.0\n")
      post.ModalText (" G00")
      post.ModalNumber(" Z", switchoffset, "0.0000")
      post.Eol()
      post.ModalText(" G92 Z0.0\n")
      post.CancelModalNumbers()
   end
   post.ModalText (" G00")
   post.ModalNumber (" Z", pierceHeight * scale, "0.0000")
   post.Eol()
   if (preheat > 0) then
      post.Text ("\n G04 P")
      post.Number (preheat,"0.###")
      post.Eol()
   end
   post.Text ("\n M03\n")
   if (pierceDelay > 0) then
      post.Text (" G04 P")
      post.Number (pierceDelay,"0.###")
      post.Eol()
   end
end

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 02, 2012, 02:01:46 PM
Try it this way the function is added to the end of the OnPenDown() function AFTER the M3 CALL.



function OnPenDown()
   
   if(dist >= (refdistance)) then
      dist = 0
      post.ModalText(" G28.1 Z")
      post.Number(3 * scale, "0.00")
      post.Eol()
      post.ModalText(" G92 Z0.0\n")
      post.ModalText (" G00")
      post.ModalNumber(" Z", switchoffset, "0.0000")
      post.Eol()
      post.ModalText(" G92 Z0.0\n")
      post.CancelModalNumbers()
   end
   post.ModalText (" G00")
   post.ModalNumber (" Z", pierceHeight * scale, "0.0000")
   post.Eol()
   if (preheat > 0) then
      post.Text ("\n G04 P")
      post.Number (preheat,"0.###")
      post.Eol()
   end
   post.Text ("\n M03\n")
   if (pierceDelay > 0) then
      post.Text (" G04 P")
      post.Number (pierceDelay,"0.###")
      post.Eol()
   end

Tpierce = (Tpierce + 1)
   if (string.find(operationName, _("Outside Offset") )) then
     post.TextDirect("o549 \n")
     post.Text (" X")
     post.Number (Sline1,"0.0000")
     post.Text(" Y")
     post.Number (Sline2,"0.0000")
     post.Eol()
   end
end

GL
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 02, 2012, 02:21:33 PM
Ok, got it, works good . Any comment on my OS or Mach ver. ? Have you heard of anyone else having problem with the later Scam?


Thanks again O Master.

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 02, 2012, 02:32:03 PM
In Scam like mach3 and other developing software there are always the posibilities of a bug sneaking in. IF you check on the Scam Yahoo site I am sure if there is a problem it will be mentioned AND fixed right away. IF not then please bring it to Les's attention .


O master ??? you must have me confused with someone else I am a HEY YOU.

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 02, 2012, 05:15:59 PM
IS it tuesday yet?

Do you have need for a basic shapes generator for plasma ?  It generates gcode for basic shapes like squares,rectangles, Circles,ovals,triangles, Burn holes.

It is in PAGE form you would add the page to your existing screenset.
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 02, 2012, 05:47:52 PM
 ;D SURE Lay it on me TP. I a gluten for punishment.LOL

Thanks

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 02, 2012, 06:13:47 PM
Here it is 2 different ways the file will unzip to 2 page file sets. Same page just different ways for Machscreen to use.

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 02, 2012, 06:17:36 PM
Thank You, Thank You!  I'll my best to do you proud. lol

Thanks

GL
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 02, 2012, 08:19:16 PM
Never mind, I figured it out. Had a brain fart. LOL

Thanks

GL
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 02, 2012, 08:25:12 PM
Ok, I do have a problem. I un-zipped the two files and tried to open them in Machscreen and all I get is a grey box.  ???

GL
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 02, 2012, 08:35:02 PM
 ;D Never mind, got something now.

Thanks

GL
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 03, 2012, 10:31:37 PM
Ok TP, I got Shapes running. Had to mess with the screen quite a bit, but works good. I used the PlasmaShapesWizard 2.zip files. I LIKE IT. I cut a lot of just simple brackets, gussets and plates and this saves so much time. No drawing to do, no posting it's great. Love it!!!

Thanks a bunch

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 03, 2012, 11:00:20 PM
You are DA MAN, (;-)

What else do you need ?

InSheetCam we have the Barcoding of the Filename to the report section working GOOD. When you post your part file you also create a report to print. When you are ready to cut  that file we use a barcode reader to read the filename into MACH3.

Not really for everyone but it saves time and typing or MISTYPING here (;-).

How about a quicky FILE reader PAGE for mach3. You can load and veiw files then decide to keep or MOVE or delete the file from the mach3 Gcode dir.

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 03, 2012, 11:03:50 PM
THere IS a piece of OLD software for transfering pages from screenset to screenset for MACH3 it was written years ago AND works very well. I'll dig it out it could become VERY usefull these days.

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 03, 2012, 11:12:52 PM
Sure why not, if your offering.  ;D So how is things going with you, is the shop keeping you busy? Basically I just got done doing a minor rebuild of my CNC plasma. Limited funds keep me from doing the things I would like to do. The wife is deployed with FEMA and we have a 17 year old daughter that keeps me hoping. I really appreciate the help Terry, and playing with this stuff keeps my mind off other things.

Thanks

GL
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 03, 2012, 11:14:44 PM
Sure on the file reader, I don't really think I can justify the Barcode add on. But I appreciate the offer.

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 03, 2012, 11:45:35 PM
Do you ever need to do G68 coord rotation.  That is where you can ROTATE MACh3 coord base to make it fit the material . NOW IF you use the G28.1 method of TOM then it will not work BUT if you use the G31 method of TOM it works fine.

How we use this is with jobs that require you to cut say 5 pieces of  the same artsy work AND you need to use up some drops. I cut the first piece and use it as a pattern to find another spot on the sheet that may be used. I lay the pattern on the material and rotate it until it fits and draw a line on the RH side extents of the part this show how much it needs to rotate.  The Script allows you to set teh 0,0 point and then move to a point on the drawn line. It then calculates what ANGLE that LINE is and applies it to the corrd rotation angle. Then if you need to verify it  run the part preveiw routine to verify that it will cut .

It works good on LARGE sheets on the table that cannot be rotated very far if any.

YEP the barcode is NOT for everyone .Here it works good because I can give them a stack of cuts to make and all they have to do is scan in the barcode to load the program. It save them having to find the program to load.  AND a lot of times teh filenames are very similar and easy to use the wrong filename.

NOW WHAT do you need to make you life easier??? MACH# wise that is.

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 03, 2012, 11:55:22 PM
The G68 rotation sounds like something I could use. I predominantly use G28.1 but us old dogs can hunt. lol  I do a lot of big sheet stuff and would definitely save the old back moving a sheet around or time trying to do it by modifying a drawing. Sounds good.
Unless your a judge or a very generous millionaire, that will do it. lol

Thanks
GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 04, 2012, 09:43:35 AM
Here is the software.

Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 04, 2012, 06:28:34 PM
Hey TP,
Was playing around with the Auto-Scale Macro and came up with a slight change that takes less input from the operator. Since the MaxX is already stored in the OemDro(59) after the program is loaded, why have the operator enter it. If it is shown in a MsgBox for reference, then the operator doesn't have to refer to another screen.
This is what I came up with:

 'Macro M3004 Auto Scale Start buttom
Dim Size1 As Double
Dim Size2 As Double
Dim Scale As Double
Dim XSize1 As String
 
XSize1= cStr(GetOemDRO(10))
MsgBox "Current Size is: " & XSize1 'Shows what the current MaxX value for OemDro(59)
Size1 = GetOemDro(10)   'Gets 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

Just messing around, what do you think?

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 04, 2012, 06:40:58 PM
THought that too at first BUT IF the OP did not set 0,0 then the extents can be WAY OFF from what it really is.

IF you load a program and the table is at say X30Y50 MACHs calculation of extents includes the amount it is off from 0,0.

I forget that on my main screen there is a PART size DRO that tells the size of X and the size of Y of the part based on extents BUT that depends on the Machine setting at 0,0 to be accurate, ALSO I have in the Gcode comments the Part size from Scam. IF the 2 do not jive +/- then something is wrong. Normally the machine is not at 0,0.

Then I can look at the sizes and deside which axis is the master to control the scaling as BOTH axis have to be scale the same amount to maintain the same aspect ratio AND if you try to do only one MACH3 will error out on Circles as it would produce an elispe and MACH3 will not allow that with scaling. AND it shouldn't.

AND remember that YOU decide which axis is the master for scaling. Could be X OR it could be Y. Just depends on what you need it to do.

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 04, 2012, 06:46:31 PM
Ok, Got ya. See I told you, your the Guru. lol  I guess I am so use to Zeroing everything before I cut. Habit...

Thanks for the logical comments, I'm learning.

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 04, 2012, 07:23:49 PM
You are doing VERY well, (;-) TP
Title: Re: Plasma Consumable Tracking
Post by: Ya-Nvr-No on November 04, 2012, 07:49:41 PM
XSize1= cStr(GetOemDRO(10))
MsgBox "Current Size is: " & XSize1 'Shows what the current MaxX value for OemDro(59)
Size1 = GetOemDro(10)   'Gets 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

Why do you need

While Ismoving()
Wend

when your not moving?
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 04, 2012, 08:00:21 PM
As far as I know you really don't as long as nothing is moving. It's just kinda like insurance in case. I'm sure BR549 can give you a better answer.

GL
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 04, 2012, 08:04:45 PM
Hey TP.  Among my messing around with some of the stuff, I noticed you had the Auto-Scale Reset Button programed as:

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

Shouldn't it be:

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

Otherwise it will give you a "Divide by 0" Error
Because you want a 1:1 aspect normally.

Just thought

GL
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 04, 2012, 08:38:26 PM
TP, First off I made a mistake in the text explanation of the MsgBox line It should read: Shows what the current MaxX value for OemDro(10). Sorry

I have been doing my homework. lol  If I am not mistaken isn't the data reflected by the OemDro(10) value based on the toolpath data derived from the file loaded? According to the Oem  Dro"s number list, OemDro is defined as: "Tool Path In Work Coordinates Maximum X". I have moved the table around, zeroed, not zeroed, set the machine zero at random locations and nothing changes that Dro value.     

Just thinking while learning. LOL in my case that could be dangerous.

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 04, 2012, 09:13:41 PM
While Ismoving()  is not just for when Mach3 is physically moving . It is IF mach3 is doing anything other than idleing. 

Used after a SetDro() call makes MACH3 wait until after it does the update to carry on with the script.  SOmetimes without it mach3 will hop right over a group of code.

Best to make it wait than let it have free run without thread sync. AND sometimes even that does not stop it.

The point I was trying to make about the extents IS the putor does not know what axis I am going to choose to master the scaling by. 

(;-) TP

(;-) TP

Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 04, 2012, 09:56:17 PM
GL you are correct I keep in my head that I use the Max-Min to get size because some of our work 0,0 is not the Lower right but may be center of work then we have to work in all quadrants x+ x- y+ y-  . SOmetimes I gets cornfused. Tha is why we do the double check with Scam AND Mach3 sizes.

(;-) TP

Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 04, 2012, 10:05:25 PM
TP,  Sounds logical and safe. Takes a lot of screw up variables out. Good show. Still learning. lol

I guess as long as I have questions I'm learning.

Thanks

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 05, 2012, 12:48:57 PM
OK back to the G68 Coord Rotation Function. I had to break this back out to a 2 part function as the latest ver's do not like my ole SusWHileDo() routine that worked in older versions. AND yes I borrowed that idea "Thanks Stirling".

YOU CAN ONLY USE THIS FUNCTION if you use the G31 to run the TOM routine. The G28.1 version will not work.  Brian would have to fix the G28.1 function IF you had to have it that way.

Create 2 screen buttons Part1, Part2.

MOve to the 0,0 point then press the part1 button. Then move to a position on the rotated line you drew. Then press the 2nd button. It should calculate the require rotation angle AND apply it to the G68 and rotate the program for you.

You can then use the Preveiw function to verify it fits.

'Macro Plasma Coord Rotation G68
Dim X1 As Double
Dim X2 As Double
Dim Y1 As Double
Dim Y2 As Double
Dim XL As Double
Dim YL As Double
Dim CRA As Double
Dim RotAng As Double

DoButton(8)
While Ismoving()
Wend
DoButton(9)
While Ismoving()
Wend
X1= GetDro(0)
While Ismoving()
Wend
Y1= GetDro(1)
While Ismoving()
Wend
Setvar(301,X1)
SetVar(302,Y1)
Message"Move To 2nd refrence point and START Part2"
MsgBox "Move To 2nd refrence point and START Part2"
End



##################################################


'Macro For G68 Coord Rotation Part 2
X1= GetVar(301)
Y1=GetVAr(302)

X2= GetDro(0)
While Ismoving()
Wend
Y2= GetDro(1)
While Ismoving()
Wend
XL= (X1-X2)
YL= (Y1-Y2)
While Ismoving()
Wend
CRA= Atn(XL / Yl)
While Ismoving()
Wend
RotAng = ((CRA * 57.2957795)* -1)
MsgBox "Rotation Angle: " & RotAng
Code"G68 X0Y0 R"& RotAng
While Ismoving()
Wend
DoOEMButton(160)
While Ismoving()
Wend
MsgBox "Rotation Complete"
End
Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 05, 2012, 12:55:04 PM
NOW be aware that WHEN you rotate the Gcode program that MACH3 does NOT rotate the JOGGING along with it.  You will JOG in the original coord base BUT cut the part in the rotated base.

YES I know, BUT it is what it is.

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 05, 2012, 04:11:27 PM
Sounds good on the G68 rotation. I'll work on that one. I have copied a new version of the M3004 macro for you to look at. It adds the absolute values of both - and + extremes for both axis from the program and calculates the scale factor. I was playing around and it seems to work fine here. Let me know what you think.

 'Macro M3004 Auto Scale Start buttom
Dim Axis As String
Dim Size1 As Double
Dim Size2 As Double
Dim Size3 As Double
Dim Scale As Double
Dim XSize1 As String
Dim YSize1 As String
Dim SAxis As Double
XSize1 = cstr(Abs(GetOemDRO(10)) + Abs(GetOemDro(4))) 'Gets Calculated absolute values of GetOemDro(4) + GetOemDro(10) values in case of negative values
YSize1 = cstr(Abs(GetOemDro(11)) + Abs(GetOemDro(5))) 'Gets Calculated absolute values of GetOemDro(5) + GetOemDro(11) values in case of negative values

Size1 = (Abs(GetOemDro(10))+Abs(GetOemDro(4))) 'Calculates absolute values of GetOemDro(4) + GetOemDro(10) values in case of negative values
Size2 = (Abs(GetOemDro(11))+Abs(GetOemDro(5))) 'Calculates absolute values of GetOemDro(5) + GetOemDro(11) values in case of negative values

MsgBox "Current X Size is: " &XSize1  'Shows what the current Abssolute MaxX value for OemDro(10) + OemDro(4)
While Ismoving()
Wend
MsgBox "Current Y Size is: " &YSize1  'Shows what the current Absolute MaxY value for OemDro(11) + OemDro(5)
While Ismoving()
Wend
Axis = AskTextQuestion ("Which Axis do you want as Scaled Axis?")
Size3 = Question("New Size ?")  'Asks for the NEW scaled size
While Ismoving()
Wend
If Axis = "X" Then
  SAxis = Size1     'Selects absolute value
End If
While Ismoving()
Wend
If Axis = "Y" Then
  SAxis = Size2
End If
While Ismoving()
Wend
Scale = (Size3/SAxis)         '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


GL
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 05, 2012, 04:24:48 PM
Have you ever tried the OemDro(118) "Coordinate System Rotation Angle X/Y (G68) " ? Seems all you need to do is do a quick calculation of the angle offset with a protractor. I haven't tried yet, just asking. It is on the MDI page left lower side.

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 05, 2012, 04:43:14 PM
YEs the DRO works fine IF you know the angle. I let mach3 do the math and calculate and set the angle. No protractor needed(;-)  A loose protractor around teh shop would last about 30 secs before it dissappeared or was melted into a blob.

On your script what happens IF you have a home offset set or are using a fixture offset ?? (;-)

Looks like you have the nack for this (;-)  GET IT DONE

Now you need room for about a hundred buttons (;-) MY keyboard has 24 Fkeys and with Ctrl/Fkeys that is 48 function keys and with Ctrl/ALt/Fkeys that is 96 functions? 

(;-) TP

(;-) TP

Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 05, 2012, 04:49:44 PM
LOL, Things do have a habit of disappearing, especial if they are cool. I see what you mean about the offset and such, just messing around with stuff while I learn. "F" that kind of keyboard, lol I have enough problems with a standard on. More power to you. Like I said " You be the Guru" .

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 05, 2012, 05:18:06 PM
OH NO you have gotten started NOW.

It is all fun when you have time to play with it.  I am still working on a sure fire way to interact Gcode and VB with each other. THEN we will have the cat by the tail.

BUT I hope that MACH4 will cure most of those ills, maybe,hopefully, fingers crossed

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 05, 2012, 05:20:38 PM
OK It is coming up on tuesday again what do we work on next?

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 05, 2012, 05:20:50 PM
Would be nice. Is there any word on how it's coming or expect release date?

GL
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 05, 2012, 05:24:11 PM
Might have to wait till next Tuesday, have to drive up to NY for a wedding Friday and be back Sunday.
Wife's relatives.
You can send me anything you want anytime you want. LOL

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 05, 2012, 08:20:17 PM
OK since you are lally gagging next week think about this function.

MidProgram,  Stop torch, move off position to clean or replace consumabes then auto restart back at the same position, refire the torch and resume cutting.

You get 2 buttons for this one. 1 if you are clever and have the right Mach3 version/OS.

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 05, 2012, 09:09:09 PM
Oh, now your challenging me. That's not fair. lol But I'll give it a try. And think of a challenge for you. You should have begun this post by addressing me as "Grasshopper" lol

Thanks

GL
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 16, 2012, 02:55:16 PM
Ok TP,  I'm back. I had to replace my complete Z axis linear actuator. So I have been making brackets, drilling, tapping, testing and calibrating for the last couple of days. I have been thinking about the challenge. Do you want to stop mid-cut? I don't think that would work very well depending on what is being cut. I would think waiting until the next M5 (torch off) code is run would be more desirable. Although I could see the possible need to do it mid-cut. Either way is possible, I think. lol I have been looking through some of the commands in Mach, G-code and script, and it shouldn't be to difficult. I am going to start on it tonite. I had to get my system operating so I can test things. So how have you been doing? I am still thinking of something to challenge you with. LOL. Ok, I have to get busy, talk to you soon.

Thanks

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 16, 2012, 02:57:56 PM
Glad to see you back Grasshopper(;-).

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 16, 2012, 03:01:45 PM
Glad to be back. That was a trip from hell. Well it's over with so I can get back to interesting things.

Thank you Master,

GL
Title: Re: Plasma Consumable Tracking
Post by: scbrniddvl on November 16, 2012, 03:08:02 PM
I replaced my whole "P.O.S." Z axis with a KR33B 300mm unit and built a new floating head for it. It works so much better than the crap I had. In the past month or so I have re-done everything on this machine. I am just waiting for a motor coupler for the KR33. 1/4" X 6mm flex. Then full speed ahead.

Thanks

GL
Title: Re: Plasma Consumable Tracking
Post by: BR549 on November 16, 2012, 03:23:58 PM
The reason for stopping mid point is that when a tip starts going bad it can do so very fast from not bad to blowout in a wink. IF you stop soon enough most times you can save the cut. IF it is a 10cent item no problem but a 1 hour cut time piece gets expensive to replace 40 minutes into the cut.

The trick here is to KNOW what values you have to collect and WHEN to collect them. I'll help out. You will need to know .

Best to think it out then write down the order of events that HAVE to happen in your own words . Best to break it down to2 functions STOPPING and restarting.

Zpos
Ypos
line number.

(;-) TP
Title: Re: Plasma Consumable Tracking
Post by: Ya-Nvr-No on November 16, 2012, 06:00:47 PM
I do believe under these stop conditions it is best to have homing enabled with good limit switches.