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
Portuguese (Brazil) Forum
Russian Forum (RSK CNCROUTER)
Thai Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 20, 2013, 01:16:24 AM
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
MACH3 Locks up in WHILE (IsMoving()) loop
Pages:
1
2
»
Go Down
« previous
next »
Author
Topic: MACH3 Locks up in WHILE (IsMoving()) loop (Read 1553 times)
0 Members and 1 Guest are viewing this topic.
snark
Active Member
Offline
Posts: 15
MACH3 Locks up in WHILE (IsMoving()) loop
«
on:
December 30, 2011, 02:33:23 AM »
MACH3 Locks up in WHILE (Is Moving()) loop.
I have a new MACRO FUNCTION which switches to incremental MODE, moves a requested short distance. Switches back to the MODE in which it was called (Incremental or absolute) and returns to the caller. When called it locks up in the WHILE loop used to sterilize the I/O and requires, and reboot is required to restore MACH3 to running state. I have other FUNCTIONs which use the WHILE (is moving()) loop, to sterilize, that don't have problems.
None of the working FUNCTION are incremental mode. I have no explanation for what is going on. Can anyone shed light on this one?
I use WINDOWS 7 32 BIT system with 3G processor that is Miltie path.
Logged
snark
Active Member
Offline
Posts: 15
Re: MACH3 Locks up in WHILE (IsMoving()) loop
«
Reply #1 on:
December 30, 2011, 02:37:36 AM »
That is serialize!!!!
Logged
stirling
Global Moderator
Offline
Posts: 1,403
UK
Re: MACH3 Locks up in WHILE (IsMoving()) loop
«
Reply #2 on:
December 30, 2011, 05:30:44 AM »
maybe post the code?
Logged
www.razordance.co.uk/THC.htm
ger21
Global Moderator
Offline
Posts: 2,997
Re: MACH3 Locks up in WHILE (IsMoving()) loop
«
Reply #3 on:
December 30, 2011, 12:59:50 PM »
If you're using 3.43.022, then try the development version.
Logged
Gerry
2010 Screenset
http://home.comcast.net/~cncwoodworker/2010.html
snark
Active Member
Offline
Posts: 15
Re: MACH3 Locks up in WHILE (IsMoving()) loop
«
Reply #4 on:
December 31, 2011, 01:43:01 AM »
I am using R3.043.056
Will run if I Comment out all WHILE LOOPS
Function Xincrement(Distance, FeedRate As Double) As Double
REM STEP X in Incremental mode
‘Current add mode will be retained and restored on exit
‘Distance sign determines direction +X -X
‘Distance greater than 1 will be rejected
' return: zero OK, -1 rejected
Dim contact As Double
Dim ABSadd As Integer
Dim CMD1, CMD2, CMD3, CMD4 as string 'COMMAND STRING BUILDIND VARS
'Set up fail value
contact =-1
IF Distance <= 1 AND Distance >= -1 then
ABSadd = GetOEMLED(48)
'Build Command
CMD1 = "G31 f" &FeedRate
CMD2 = " X" &Distance
CMD3 = CMD1 & CMD2
CODE ( "G91 ")
While (IsMoving())
sleep (100)
Wend
CODE (CMD3) 'move inch's
While (IsMoving())
sleep (100)
Wend
contact = 0
IF ABSadd = true then
CODE ( "G90 ")
While (IsMoving())
sleep (100)
Wend
end if
end if
Xincrement = contact ' Set return value
End Function
Logged
stirling
Global Moderator
Offline
Posts: 1,403
UK
Re: MACH3 Locks up in WHILE (IsMoving()) loop
«
Reply #5 on:
December 31, 2011, 05:56:25 AM »
where are you putting this code? button? macro file? other? and what actually calls it?
In general what is it you're trying to do?
Also your code has syntax errors as you've presented it, so it doesn't even run. hint: comment syntax.
Logged
www.razordance.co.uk/THC.htm
snark
Active Member
Offline
Posts: 15
Re: MACH3 Locks up in WHILE (IsMoving()) loop
«
Reply #6 on:
January 01, 2012, 04:37:56 AM »
Currently I am testing it using #expand in a test Macro called from the VB editor. I plan to use it in a couple of Macros for some special functions.
I would use the #expand to provide access to it as I have in the test bed. I don't see the syntax error nor does the editor. I see the funny looking ' but can't explane it.
Sub TESTER ()
Dim Address , one, two, tmp1, tmp2 As Double
Dim CPAccess , Cmd1 , Cmd2, Cmd3, INST As String
Dim I1, I2 As integer
'tmp1 = InputBox ("how far")
'tmp2 = inputbox ("how fast")
I1 = GetOEMled(48)
I2 = GetOEMled (49)
one = Xincrement(tmp1,tmp2)
two=two
End Sub
#expand "D:\MACH3\macros\MILL_PROFILE_2\Function\Xincrement" ' Item being tested *************
#expand "D:\MACH3\macros\MILL_PROFILE_2\Function\SETUL"
#expand "D:\MACH3\macros\MILL_PROFILE_2\Function\CmdCall"
#expand "D:\MACH3\macros\MILL_PROFILE_2\Function\RESET_LABELS"
Logged
ger21
Global Moderator
Offline
Posts: 2,997
Re: MACH3 Locks up in WHILE (IsMoving()) loop
«
Reply #7 on:
January 01, 2012, 07:56:26 AM »
You shouldn't need the Sleep(100) and the extra set of ()
so instead of
While (IsMoving())
sleep (100)
Wend
try
While IsMoving()
Wend
Also,
CODE ( "G90 ")
can be written as
Code "G90"
Everything after the ' is a comment
Logged
Gerry
2010 Screenset
http://home.comcast.net/~cncwoodworker/2010.html
snark
Active Member
Offline
Posts: 15
Re: MACH3 Locks up in WHILE (IsMoving()) loop
«
Reply #8 on:
January 01, 2012, 08:30:25 AM »
My script runs fine if I run it from a button script. It seems that I/O doesn't work well when executed from the VB editor, I am sure everybody but me knew that, but I really know it now and I will never forget it.
What I was doing may be confusing, After involving everybody I will share a little bit. When I feel I have need for a new function. I break it up into primitive functions. Debug the primitive functions, and then fit them together to form the complex. If all the small pieces work it is not hard to get rest to work together so, some complated function can be implemented quickly
usually
. The primitives are encapsulated and keep in libraries to be used in other projects, The simpler they are the more offten you can use them.
TX fer all the help.
Bill
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,777
Briceville, TN, USA
Re: MACH3 Locks up in WHILE (IsMoving()) loop
«
Reply #9 on:
January 01, 2012, 08:55:24 AM »
do this:
change: While(IsMoving()) to: While IsMoving() 'don't forget to put the WEnd
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
2
»
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach3 under Vista
=> 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
=> CS-Lab
=> dspMC/IP Motion Controller
=> HiCON Motion Controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Mach3 Wizards
=> Newfangled Mill Wizard
=> 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...