Machsupport Forum

Mach Discussion => Feature Requests => Topic started by: enzed on August 07, 2017, 06:01:59 AM

Title: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: enzed on August 07, 2017, 06:01:59 AM
On 15 August 2014, DaveK0974 and BLM enquired about the possibility of having 'arc-on timer' and 'pierce counter' functions in Mach3. But I do not see any answers or follow-ups to their queries. Is it possible to have these functions added or activated in Mach3? It would be very useful to obtain information on these parameters whenever plasma cuts are made so as to be better able to calculate cutting and general operating costs. enzed
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: Tweakie.CNC on August 07, 2017, 06:08:31 AM
Hi Enzed,

Development of Mach3 has ended in favor of Mach4 so it is extremely unlikely that any additional functions will ever be added to Mach3 in the future. However, this should not stop enterprising Mach3 users from developing additional functions within the scope of the Screen Designer, Brains, etc.

Tweakie.
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: enzed on August 07, 2017, 07:28:04 AM
Hi Tweakie,

Thanks for the fast response. Developing additional functions for some of us, is easier said than done, especially those of us who, like myself, are beginners with the Mach software, or are not computer and programming wizards! Regards, enzed
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: Tweakie.CNC on August 07, 2017, 07:37:05 AM
Hi Enzed,

I fully understand - I have been using Mach2/3 for 10 years now and I still don't know the half of it. But, learning can be fun so please take a look at the videos and other documentation http://www.machsupport.com/videos/ - if you really need it you will be able to do it and we are all here to help if we can.

Tweakie.
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: enzed on August 07, 2017, 08:06:07 AM
Thanks for the encouragement, guidance and the offer of assistance and support Tweakie, it is is much appreciated. Yes, perhaps it is not as difficult as I imagine it to be, if I look at the videos and also try and work out something myself. Thanks again and best wishes. Enzed.
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: DWalls on October 23, 2019, 08:18:33 PM
Thanks for the encouragement, guidance and the offer of assistance and support Tweakie, it is is much appreciated. Yes, perhaps it is not as difficult as I imagine it to be, if I look at the videos and also try and work out something myself. Thanks again and best wishes. Enzed.

so did you ever get a counter working that shows you the pierce count and cut timer? If so I would like to add that to my screen but I am just now learning how to add buttons and change my screens.


Thank you
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: TPS on October 24, 2019, 02:51:14 AM
as far i know there is no functionality in Mach3 for this, but you can add some code to M3 and M5 and do it by your own.

M3 code
Code: [Select]
'Save the starttime in seconds
Dim starttime As Double
starttime = (Hour(Time(Now))*3600)+(Minute(Time(Now))*60)+Second(Time(Now))
SetUserDro(1600, starttime)

'increment the piercecounter
SetUserDro(1602,GetUserDro(1602)+1)


M5 code
Code: [Select]
'Calculate the enddtime
Dim endtime As Double
endtime = (Hour(Time(Now))*3600)+(Minute(Time(Now))*60)+Second(Time(Now))
'save the cuttime
SetUserDro(1601 , endtime - GetUserDro(1600))

code is not tested, just written down
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: DWalls on October 24, 2019, 03:12:52 AM
Thank you I'll give it a try but I'm still having problems and i'm not sure that I am getting my buttons right.
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: DWalls on October 24, 2019, 03:25:39 AM
Thank you for your help, I've been working on getting my reset button to change the counter and after looking at what you provided, I finally got it to change the counter, now I'll try the rest when I get home and am able to hook it up to the controller and run a file.

Thanks again
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: TPS on October 24, 2019, 03:44:41 AM
this M5 code will only measure the cuttime of one cut

Code: [Select]
'Calculate the enddtime
Dim endtime As Double
endtime = (Hour(Time(Now))*3600)+(Minute(Time(Now))*60)+Second(Time(Now))
'save the cuttime
SetUserDro(1601 , endtime - GetUserDro(1600))

this M5 code will measure the total cuttime

Code: [Select]
'Calculate the enddtime
Dim endtime As Double
endtime = (Hour(Time(Now))*3600)+(Minute(Time(Now))*60)+Second(Time(Now))
'save the cuttime
SetUserDro(1601 , GetUserDro(1601) + ( endtime - GetUserDro(1600)))

Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: DWalls on October 24, 2019, 03:48:20 AM
Awesome, so I will just cut and paste that into my M5 file and create the DRO for it and it should work?

I have been trying to get my pierce counter and reset working all night and I think that it should now but I won't know for sure until I hook it up in the morning.

Thanks again.
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: TPS on October 24, 2019, 03:54:40 AM
yes i thinks it should work.

piercecounter will be in DRO 1602
cuttime in DRO 1601
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: DWalls on October 24, 2019, 04:07:54 AM
I made my DRO "User Defined:950" and it wouldn't work until I tried the 1602 like you suggested and it worked. I have since found out that whenever I label it below 1000 it doesn't work and as long as I'm above 1000 then it works.

Thanks again
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: TPS on October 24, 2019, 04:18:58 AM
UserDro's start at 1000, i allways use them above 1100 because some at the 1000 aeria are used by Standard Screen set.
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: TPS on October 24, 2019, 04:34:06 AM
here is a easier Version:

M3 code
Code: [Select]
'Save the starttime in seconds
SetUserDro(1600, Timer)

'increment the piercecounter
SetUserDro(1602,GetUserDro(1602)+1)

M5 code
Code: [Select]
'save the cuttime
SetUserDro(1601 , GetUserDro(1601) + ( Timer - GetUserDro(1600)))
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: DWalls on October 24, 2019, 04:38:57 AM
UserDro's start at 1000, i allways use them above 1100 because some at the 1000 aeria are used by Standard Screen set.

That explains why it was giving me fits, I was going off of an old post on another forum from over 4 years ago maybe longer so maybe user dro's were less back then.
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: DWalls on October 25, 2019, 01:24:25 AM
Is there any way to protect the DRO so that you can't change the number, read only if you will? it doesn't really matter because the way that it is now eliminates the need for a reset button, just wondering?

Thanks again for your help, the counter is working fine, I'll work on the timer next.
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: TPS on October 25, 2019, 04:37:56 AM
i don't know a "direct" way to make a dro read only, but you can put a transparent button (witch has no functionality) over the DRO
to "protect" it for Input.
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: DWalls on October 25, 2019, 04:46:00 AM
Man, you are awesome, what don't you know about setting this up. I'll try that

Thank you again.
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: DWalls on October 25, 2019, 05:16:03 AM
I placed a transparent button over the DRO but I am still able to enter a value in the DRO, what am I missing to make sure that the transparent button is  on top?
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: TPS on October 25, 2019, 05:55:06 AM
if you use machscreen just click on the button, than you will see a selection list, where the button and the DRO is shown, then click
(left mouse button) and hold the button to 'move' the transparent button upwards in the list. hope you understand my bad bavarian english.
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: DWalls on October 25, 2019, 06:05:26 AM
Understood, I was trying to cover 2 DRO buttons with 1 transparent button and I think that is where my problems were coming from, when I tried to click on one of the buttons to check then the whole transparent button was turning blue and getting darker with each click of the button. I'll try a small transparent button over each of the DRO's and see if that fixes it.

Thank you
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: DWalls on October 25, 2019, 08:32:31 PM
Where can I find a list of codes that can be used for changing things?

For example I would like for the button or an led to start flashing yellow at a certain number and maybe go red after a higher number?

Thank you
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: TPS on October 26, 2019, 01:50:06 AM
Manuals:

https://www.machsupport.com/wp-content/uploads/2013/02/Mach3_V3.x_Macro_Prog_Ref.pdf

http://www.machsupport.com/wp-content/uploads/2013/02/VBScript_Commands.pdf
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: DWalls on October 26, 2019, 02:48:19 AM
Thank you again
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: DWalls on October 28, 2019, 10:41:02 AM
Ok, not sure what I am doing wrong but I tried both of your timers and on a cut where the torch fires for @20 seconds the timer shows 66 I have tried different ways to show the number but it seems to be off or I am one.

I copied both of your suggestions in the M3 and M5 but it gives me the same numbers?

Any Ideas?
On mach3 the total elapsed time was showing 24 sec and the timer shows 66

Ideally I would like it to display in minutes on the screen.

Thanks(http://)
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: DWalls on October 28, 2019, 11:37:00 AM
Ok, I found the culprit and it has nothing to do with your code, you already knew that but I didn't haha
it appears that my post processor is adding an extra line after the M05 and it has another M05 and M30 and for whatever reason the time multiplies for each of those commands, it is easy enough to edit my post and delete the last line but not sure why sheetcam is adding that extra line, also don't understand why the M30 is effecting the time counter?

N0010 (Filename: circle.tap)
N0020 (Post processor: Mach3 plasma no Z.scpost)
N0030 (Date: 28/10/2019)
N0040 G20 (Units: Inches)
N0050 G53 G90 G91.1 G40
N0060 F1
N0070 S500
N0080 (Part: circle)
N0090 (Operation: Outside Offset, LAYER_1, T1: Plasma, 0.04 in kerf)
N0100 G00 X-0.0590 Y4.9645
N0110 M03
N0120 G04 P150
N0130 G01 X-0.0200 Y5.1607 F100.0
N0140 G02 X-0.0200 Y5.1607 I5.1807 J-0.0000
N0150 G03 X-0.1480 Y5.2887 I-0.1280 J0.0000
N0160 M05
N0170 M05 M30




Thanks again
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: TPS on October 29, 2019, 11:53:16 AM
ok, this M5 code should work even if M5 is called twice


M5 code
Code: [Select]
'check that endtime has not been calculated allready
If GetUserDro(1600) <> 99999 Then
'save the cuttime
SetUserDro(1601 , GetUserDro(1601) + ( Timer - GetUserDro(1600)))
'set calculation allready done
SetUserDro(1600,99999)
End If



it is not the M30 witch is acting the Problem, it is the double cáll of M5, then cuttime was calculated (added) twice.
the new code should help.

Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: DWalls on October 30, 2019, 08:41:14 AM
Should this go before or after the other code that calculates the time?

Maybe I will get a chance to try this in the next few days.

Thank you for your help
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: TPS on October 30, 2019, 02:52:04 PM
no, instead of pls replace


M5 code
Code: [Select]
'save the cuttime
SetUserDro(1601 , GetUserDro(1601) + ( Timer - GetUserDro(1600)))

by

M5 code
Code: [Select]
'check that endtime has not been calculated allready
If GetUserDro(1600) <> 99999 Then
'save the cuttime
SetUserDro(1601 , GetUserDro(1601) + ( Timer - GetUserDro(1600)))
'set calculation allready done
SetUserDro(1600,99999)
End If




Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: DWalls on October 30, 2019, 03:07:50 PM
Got it

Is there a way to have it show in minutes and seconds?

Thank you again for your help
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: DWalls on November 01, 2019, 12:20:24 PM
Is there a way to have it show in minutes and seconds?

Thank you
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: TPS on November 01, 2019, 12:29:28 PM
just a bit of calculation

Code: [Select]
'check that endtime has not been calculated allready
If GetUserDro(1600) <> 99999 Then
'save the cuttime
SetUserDro(1601 , GetUserDro(1601) + ( Timer - GetUserDro(1600)))
'set calculation allready done
SetUserDro(1600,99999)
'UserDro 1602 for seconds
SetUserDro(1602 , GetUserDro(1601) Mod 60)
'UserDro 1603 for minutes
SetUserDro(1603 , (GetUserDro(1601)-GetUserDro(1602))/60)
End If
Title: Re: ARC-ON TIMER AND PIERCE COUNTER IN MACH3
Post by: DWalls on November 01, 2019, 12:53:04 PM
I can't wait to try this in a few days. This has proven to be exciting, I have now spent more time on the screen editor and learning how to make the buttons do what I want than I have actually spend cutting on the table.
Is this all that you do or are you just really good with the script?

Thank you for your help once again.