Home
Downloads
Mach3
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
Resources
Contact Us
Links
CNCZone
German Forum
Italian Forum
Korean Forum
Portugese (Brazil) Forum
Russian Forum (RSK CNCROUTER)
Thai Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 27, 2012, 11:52:38 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Select from and to languages
Chinese-simp to English
Chinese-trad to English
English to Chinese-simp
English to Chinese-trad
English to Dutch
English to French
English to German
English to Greek
English to Italian
English to Japanese
English to Korean
English to Portuguese
English to Russian
English to Spanish
Dutch to English
Dutch to French
French to English
French to German
French to Greek
French to Italian
French to Portuguese
French to Dutch
French to Spanish
German to English
German to French
Greek to English
Greek to French
Italian to English
Italian to French
Japanese to English
Korean to English
Portuguese to English
Portuguese to French
Russian to English
Spanish to English
Spanish to French
Machsupport Forum
Mach Discussion
VB and the development of wizards
Oxy Fuel Safety timer
Pages:
1
2
»
Go Down
« previous
next »
Author
Topic: Oxy Fuel Safety timer (Read 718 times)
0 Members and 1 Guest are viewing this topic.
sinkyster
Active Member
Offline
Posts: 22
Oxy Fuel Safety timer
«
on:
June 30, 2011, 01:09:46 AM »
Hi all,
I am setting up Mach3 to run with a Oxy Fuel process. I have searched everywhere but can't seem to find any info.
I want to put a simple safety feature in place that cuts off the gas supply if auto ignition haven't been confirmed by the operator within a certain time frame. Since I don't know too much about VB it is a bit difficult... I have read through a lot of posts but I still can't get something. The basic process would be something like this:
Timer countdown 25s (a visible counter would be best)
If "operator have confirmed ignition before " then "resume cycle"
else
STOP
or maybe on different approach:
Timer countdown 25s (a visible counter would be best)
if counter = 0 and confirm = 0 then stop
if counter >= 0 and confirm = 1 then Resume
Any help would be much appreciated.... I've spend many hours trying to work it out but to no avail.
Sinkyster
Logged
BR549
Active Member
Offline
Posts: 2,557
Re: Oxy Fuel Safety timer
«
Reply #1 on:
June 30, 2011, 08:02:16 AM »
A very simple start would be this: Not knowing the method you use to turn on the torch it is a start. It simply counts down and sendstheount to the message bar.
'Countdown timer for AutoTorch light
'(turn on torch)
Message "26"
Sleep(1000)
Message "25"
Sleep(1000)
Message "24"
Sleep(1000)
Message "23"
Sleep(1000)
Message "22"
Sleep(1000)
Message "21"
Sleep(1000)
Message "20"
Sleep(1000)
Message "19"
Sleep(1000)
Message "18"
Sleep(1000)
Message "17"
Sleep(1000)
Message "16"
Sleep(1000)
Message "15"
Sleep(1000)
Message "14"
Sleep(1000)
Message "13"
Sleep(1000)
Message "12"
Sleep(1000)
Message "11"
Sleep(1000)
Message "18"
Sleep(1000)
Message "17"
Sleep(1000)
Message "16"
Sleep(1000)
Message "15"
Sleep(1000)
Message "14"
Sleep(1000)
Message "13"
Sleep(1000)
Message "12"
Sleep(1000)
Message "11"
Sleep(1000)
Message "10"
Sleep(1000)
Message "9"
Sleep(1000)
Message "8"
Sleep(1000)
Message "7"
Sleep(1000)
Message "6"
Sleep(1000)
Message "5"
Sleep(1000)
Message "4"
Sleep(1000)
Message "3"
Sleep(1000)
Message "2"
Sleep(1000)
Message "1"
Sleep(1000)
Message "0"
Sleep(1000)
'(IF signal yes then end)
'(ELSE Shut off torch)
'(END IF)
LET US KNOW if you need further help, (;-)TP
Logged
Sargon
Active Member
Offline
Posts: 99
Re: Oxy Fuel Safety timer
«
Reply #2 on:
June 30, 2011, 08:12:22 AM »
We need a little bit more information. When does the ignition need to be confirmed: at the beginning of a cycle, and/or periodically throughout the cycle?
Would a messagebox asking for confirmation be appropriate in your situation? How should the confirmation be initiated, do you want it executed from a macro called from the GCode (ie M1001)? Or would it be safer/more desirable to have it run every time you click cycle start so it is executed every time no matter what?
Any other considerations.
Once this info has been provided a suitable solution for your circumstances can be given!
I could just throw out a few possible answers/scripts, but it sounds like you've had enough pain on this one! Let's just get it right the first time.
A dialog must be used to give you control while the box is displayed so you can close the box when the countdown reaches 0 and decrement the counter every second. We'll get something put together for you pretty quickly I think.
Thanks,
Chris
Logged
sinkyster
Active Member
Offline
Posts: 22
Re: Oxy Fuel Safety timer
«
Reply #3 on:
June 30, 2011, 10:22:41 AM »
OK. My idea is to start the cycle. Then torch moves to start coordinates, and start the ignition process. The ignition process will first open the LP gas and then the timer must start. Right after it has started i want to start the auto ignition. But as it happens, it doesn't always start and i want to manually confirm that the torch is on. Then when it comes on, it stays on for the whole cycle. I want to ignite only at the beginning of each job.
The steps must be something like this:
Torch on
Timer on
Igniter on
The Operator must confirm [torch OK] before the timer hits 0 or the machine will go to STOP or RESET state. And if the Operator did confirm, the G-Code must continue...
I would prefer a macro being called for that, yes! See image for how I pictured it to be in mach3.
Just a BTN with Yellow LED flashing(while not confirmed) and green LED that comes on when confirmed. At the btm is the counter in a DRO.
Maybe a MSG popup only when operator did not confirm? That way thay i can leave a small message to tel the operator what he did wrong...
I think it can't be too difficult, I just don't know how exactly..
Thanks for you replies!
Logged
sinkyster
Active Member
Offline
Posts: 22
Re: Oxy Fuel Safety timer
«
Reply #4 on:
July 01, 2011, 04:39:16 AM »
...here is the image
ConfirmTimer.jpg
(20.4 KB, 222x196 - viewed 21 times.)
Logged
Sargon
Active Member
Offline
Posts: 99
Re: Oxy Fuel Safety timer
«
Reply #5 on:
July 01, 2011, 10:46:04 AM »
Heres the script to replace the cycle start button!
Note that cycle start can also be run from other screens, so you might want to direct them to this script as well.
********** CODE **********
Const CR = 13
Const LF = 10
Const msgboxBtnOK = 0
Const msgboxBtnOkCancel = 1
Const msgboxBtnAbortRetryIgnore = 2
Const msgboxBtnYesNoCancel = 3
Const msgboxBtnYesNo = 4
Const msgboxBtnRetryCancel = 5
Const msgboxIconStop = 16
Const msgboxIconQuestion = 32
Const msgboxIconExclamation = 48
Const msgboxIconInformation = 64
Const msgboxDefaultbtnFirst = 0
Const msgboxDefaultbtnSecond = 256
Const msgboxDefaultbtnThird = 512
Const msgboxDefaultbtnFourth = 768
Const msgboxApplicationModal = 0
Const msgboxSystemModal = 4096
Const btnCycleStart = 1000
Const ConfirmedLED = 1001 'change to your LED number
Sub Main
Dim TimerStart, TimerNow As Long
Dim Confirmed As Boolean
Dim NewLine, Message, Title As String
Dim Answer As Integer
Dim Timeout As Integer
NewLine = Chr(13) & Chr(10)
Timeout = 25 'set timout time in seconds
SetUserLED(ConfirmedLED, 0)
DoOEMButton(btnCycleStart)
TimerStart = Timer
Do
Confirmed = CBool(GetUserLED(ConfirmedLED))
Sleep(250) 'check about 4 times per second to reduce CPU load
TimerNow = Timer
Loop While Not Confirmed And TimerNow - TimerStart < Timeout
If Not Confirmed Then
Message = "Operator failed to confirm ignition." & NewLine & NewLine & "Operation Aborted!"
Title = "Error"
Answer = MsgBox(Message, msgboxBtnOK + msgboxIconStop, Title)
End If
End Sub
********** CODE **********
Logged
Sargon
Active Member
Offline
Posts: 99
Re: Oxy Fuel Safety timer
«
Reply #6 on:
July 03, 2011, 05:21:01 PM »
I didn't put in the countdown, but you can output TimerNow - TimerStart to a DRO or UserLabel.
Also at the end of the If Not Confirmed block you should add a command to stop or feedhold or other applicable actions if you don't get confirmation.
If you need more information or you want some clarification on the code let me know. I didn't have much time when I did it so it's not commented very well.
Chris
Logged
sinkyster
Active Member
Offline
Posts: 22
Re: Oxy Fuel Safety timer
«
Reply #7 on:
July 04, 2011, 01:53:10 AM »
Thnx Chris, I'll take a look today!
Logged
sinkyster
Active Member
Offline
Posts: 22
Re: Oxy Fuel Safety timer
«
Reply #8 on:
July 04, 2011, 08:03:59 AM »
Sargon,
Maybe it's better if you could clarify it... I'm still learning...
apart from that, i have 3 qstns:
1. how would the code for the countdown look like? Something like this?
timeleft = Timernow - Timerstart
setUSERDRO(1056, timeleft) ? '1056 is my userDRO ID
2. Where should that code be put in?
3. You say I need to replace the cycle start button script. I use Machscreen for editing, can I just change the cycle start button with all these script in there?
Cheers!
Logged
Sargon
Active Member
Offline
Posts: 99
Re: Oxy Fuel Safety timer
«
Reply #9 on:
July 04, 2011, 05:28:37 PM »
Sinkyster:
1) See code below. Much easier to decipher when it has comments!
2) Also see code below!
3) In machscreen click the button and change it's function from Cycle Start to the Execute VBScript function. Paste in the code and change it to fit your needs. The code is now embedded into the CycleStart button.
Enjoy!
**********CODE**********
Option Explicit 'Require variables to be defined by DIM before using. Reduces typing mistakes and headaches dramatically.
Const CR = 13 'Carriage Return
Const LF = 10 'Line Feed
'message box constants
Const msgboxBtnOK = 0
Const msgboxBtnOkCancel = 1
Const msgboxBtnAbortRetryIgnore = 2
Const msgboxBtnYesNoCancel = 3
Const msgboxBtnYesNo = 4
Const msgboxBtnRetryCancel = 5
Const msgboxIconStop = 16
Const msgboxIconQuestion = 32
Const msgboxIconExclamation = 48
Const msgboxIconInformation = 64
Const msgboxDefaultbtnFirst = 0
Const msgboxDefaultbtnSecond = 256
Const msgboxDefaultbtnThird = 512
Const msgboxDefaultbtnFourth = 768
Const msgboxApplicationModal = 0
Const msgboxSystemModal = 4096
'mach3 OEM button constants
Const btnCycleStart = 1000
Const btnFeedHold = 1001
Const btnRewind = 1002
Const btnStop = 1003
'user defined interfaces
Const ConfirmedLED = 1001 'change to your LED number
Const CountdownDRO = 1056
Sub Main
Dim TimerStart, TimerNow As Long
Dim Confirmed As Boolean
Dim NewLine, Message, Title As String 'variables for msgbox
Dim Answer As Integer
Dim TimeElapsed, TimeRemaining, Timeout As Integer
NewLine = Chr(CR) & Chr(LF) '<CR><LF>
Timeout = 25 'set confirmation timout time in seconds
SetUserLED(ConfirmedLED, 0) 'reset LED to off state
DoOEMButton(btnCycleStart) 'initiate cycle start
TimerStart = Timer 'set starting timer. Timer is elapsed seconds since midnight.
'loop through this block until we get confirmation or timeout
Do
Confirmed = CBool(GetUserLED(ConfirmedLED)) 'Retrieve LED status and convert to boolean
Sleep(250) 'check about 4 times per second to reduce CPU load
TimerNow = Timer 'set current timer value
TimeElapsed = TimerNow - TimerStart 'calculations have been broken down into small steps to
TimeRemaining = Timeout - TimeElapsed 'make it easy to follow
SetUserDRO(CountdownDRO, TimeRemaining) 'display countdown
Loop While Not Confirmed And TimeRemaining > 0
'If we didn't get confirmation in time then do the following
If Not Confirmed Then
'set variables for message box
Message = "Operator failed to confirm ignition." & NewLine & NewLine & "Operation Aborted!"
Title = "Error"
'display message box. Answer will be the position of the button that was clicked (ie 1 for first button, 2 for second.)
Answer = MsgBox(Message, msgboxBtnOK + msgboxIconStop, Title)
'perform shutdown operations.
DoOEMButton(btnFeedhold) 'Feedhold to stop machine nicely
Sleep(500) 'Wait for half second to ensure we came to a smooth stop. Reduce if it's too much.
DoOEMButton(btnStop) 'Full Stop.
DoOEMButton(btnRewind) 'Rewind code ready to retry
'Add anything else you need to do (like maybe torch off, LP off, etc)
Exit Sub 'Exit script
End If
'add anything you want to do if we do get confirmation before timeout
End Sub
**********CODE**********
Logged
Pages:
1
2
»
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach3 under Vista
=> Quantum
=> Mach SDK plugin questions and answers.
===> Finished Plugins for Download
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*i*n*g
=> Mach Screens
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Machscreen Screen Designer
===> CVI MachStdMill (MSM)
=> Feature Requests
=> Non English Forums
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
=> FAQs
-----------------------------
*****VIDEOS*****
-----------------------------
=> *****VIDEOS*****
-----------------------------
General CNC Chat
-----------------------------
=> Share Your GCode
=> Show"N"Tell ( What you have made with your CNC machine.)
=> Building or Buying a Wood routing table.. Beginnners guide..
=> Show"N"Tell ( Your Machines)
-----------------------------
G-Code, CAD, and CAM
-----------------------------
=> G-Code, CAD, and CAM discussions
=> LazyCam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> GearoticMotion Preliminary testing
=> Tempest Trajectory Planner
=> Contec
=> dspMC/IP Motion Controller
=> HiCON Motion Controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Mesa
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Sieg Machines
=> Promote and discuss your product
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
=> One on one phone support.
=> Forum suggestions and report forum problems.
-----------------------------
Mach4
-----------------------------
=> Mach4 pre-Alpha Testing
Loading...