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 28, 2012, 02:23:58 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
Problem with Do Until Loop
Pages:
1
Go Down
« previous
next »
Author
Topic: Problem with Do Until Loop (Read 1499 times)
0 Members and 2 Guests are viewing this topic.
sunmix
Active Member
Offline
Posts: 35
Problem with Do Until Loop
«
on:
October 21, 2008, 05:22:47 PM »
Hi guys,
I have written a untrue Timer System for my Oxy Dwell. Oxy is critical during dwelling and I need to Extend the delay times if its not enough. So I have written a macro here, which is used in M03:
Sub Main()
Dim Delay, RT, ET, TStop, TSet, TExtend
TStop = 0.2
TSet = getUserLED(821)
TExtend = getUserLED(822)
Delay = getUserDRO(1051)
RT = Delay
ET = 0
ActivateSignal(Output1)
Do Until (RT <= (TStop)) Or (TSet = 1)
RT = RT - 0.2
ET = ET + 0.2
Call SetUserDRO( 1055, RT )
Call SetUserDRO( 1056, ET )
code "G4 P0.1"
While IsMoving()
Wend
Loop
If (TExtend = 1 And TStop = 0.2)Then
ET = ET + 0.2
Call SetUserDRO( 1055, 0 )
Call SetUserDRO( 1056, ET )
code "G4 P0.1"
While IsMoving()
Wend
End If
If (TSet = 1)Then
ET = ET + 0.2
Call SetUserDRO( 1056, ET )
End If
End Sub
1051 Recieves a Delay Value from a Custom DRO.
RT stands for Remaining Time, which is used on Custom DRO 1055.
ET stands for Elapsed Time, which is used on Custom DRO 1056.
getUserLED(821) represents Input #1.
getUserLED(822) represents Input #2.
What it does:
TStop is a value that I should Stop Counting from.
TSet is hooked up to Input 1.
TExtend is hooked up to Input 2.
Ive configured a time delay, for instance - 10 seconds, on DRO 1051.
When the M03 runs, Remaining Time will start displaying 10 seconds, Elapsed will display 0 seconds.
As it goes, RT will be minus by 0.2, and ET will be added by 0.2.
SetUserDRO 1055 and 1056 will put a new figure unto Elapsed and Remaining Time.
To make it more realistic, a 100ms delay is added unto the script.
The whole script repeats until TStop reaches 0.2, or Tset = 1(Input1 is triggered).
Set and Extend features is:
While the Timer is counting, If I press Set, the value on the Elapsed Time counted halfway will replace the old Delay Time.
If the Timer has finished counting, If I press Extend, Elapsed Time will continue to count Until I press set and the New Elapsed Time will replace the Old Delay Time.
If the Timer has finished counting, and a second delay has passed, the VB will ignore the signals from Elapsed Time and continue the next VB instruction.
I have been experimenting for weeks, argh, I still fail. Anyone can help me out?
I say thank you a zillion times in advance.
Charles
Logged
tripleblack
Active Member
Offline
Posts: 97
Re: Problem with Do Until Loop
«
Reply #1 on:
October 31, 2008, 07:02:45 PM »
hi, i flame cut as well as plasma cut.while i do not have such a complex macro as yours , this works for me.
i call it m777
SystemWaitFor(1005) ' lets the z axis be jogged down manually for preheat and start height
code"g92z0" 'zeros the z so that the top of plate is known
While ismoving()
Wend
code"g0z.2" 'jog up .2 inch quickly for the pierce
ActivateSignal(OUTPUT1) 'oxy pierce valve turned on.
While ismoving()
Wend
code"g0z0" ' jog back down for return to part file
While ismoving()
Wend
i have a manual button that triggers oem code for resume.
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: Problem with Do Until Loop
«
Reply #2 on:
November 23, 2008, 11:10:00 AM »
there is no
getUserLED(821) represents Input #1.
getUserLED(822) represents Input #2.
in mach ULed range is from 1000-2255, same for Udros.
you 821,822 will not error out in a script, but they just dont exist, you cant set them.
scott
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
Pages:
1
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...