585,927 active members*
3,258 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > CamSoft Products > tracking down MDI "hang" with loops & macros
Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2005
    Posts
    67

    tracking down MDI "hang" with loops & macros

    ssooo.. really didn't feel like doing any "work" this morning, so i decided to see if i couldnt' track down more info on the issue i've had with the MDI window "hanging"

    wrote the following m-code

    :CHANGERWAIT
    TIME RESETMS
    :TLOOP
    TIME MS;\32
    IF \32 < 2000 THEN GOTO :TLOOP
    MESSAGE LOOP
    \16= {\16+1}
    IF \13 <> 20 THEN GOTO :CHANGERWAIT
    ---M15

    opened an MDI window, and ran this. it did just what it was supposed to do, i was happy

    then, i modified it by doing a macro call in the 1st line [LOGGING]

    internals of the [LOGGING] macro are below
    'THIS MACRO IS USED TO LOG VARIABLE CHANGES AND STATES.
    'IT IS CALLED FROM WITHIN M143

    LOGWRITE \9: LOGWRITE \11: LOGWRITE \300: \12=t: LOGWRITE \12: LOGWRITE \8: \13=s: LOGWRITE \13


    now, using the MDI window to call M15, resulted in the window "hanging" and never actually getting to the mcode call! the top of the camsoft interface window says "please wait while is being verified", and this is as far as she'll go.

    so, my guess is there is a conflict somewhere within the system in how a macro is called/used. even if there is, the system is far more capable than anything i could ever write, so i'm not trying to bash you guys, i just couldn't stand not having tracked the issue down.


    if someone else could do this test, to verify that it's not just my control, that would be great, thanks!

    -nate

  2. #2
    Join Date
    Apr 2003
    Posts
    332
    Nate,

    Take a closer look at what you wrote. A real close look...

    It is stuck in a infinite loop.

    In the Macro named [Logging] you change the variable \13 to equal the lower case s

    s is usually used for spindle speed in a G code program.

    In your M15 logic you made a mistake.

    Change:

    IF \13 <> 20 THEN GOTO :CHANGERWAIT

    To:

    IF \16 <> 20 THEN GOTO :CHANGERWAIT

    Because now \13 will never equal \20 and she keeps on with GOTO :CHANGERWAIT

    Tech Support
    CamSoft Corp.
    (951) 674-8100
    [email protected]
    www.cnccontrols.com
    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  3. #3
    Join Date
    Apr 2003
    Posts
    332
    Nate,

    As a piece of related advise.

    One easy but cleaver command to make use of is LOADING

    Look into this since it has too many variations to describe here but one main use is to EXIT out of any routine that doesn't need to run or waste time while the file is loading.

    Tech Support
    CamSoft Corp.
    (951) 674-8100
    [email protected]
    www.cnccontrols.com
    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  4. #4
    Join Date
    Sep 2005
    Posts
    67
    Quote Originally Posted by camsoft
    Nate,

    Take a closer look at what you wrote. A real close look...

    It is stuck in a infinite loop.

    In the Macro named [Logging] you change the variable \13 to equal the lower case s

    s is usually used for spindle speed in a G code program.

    In your M15 logic you made a mistake.

    Change:

    IF \13 <> 20 THEN GOTO :CHANGERWAIT

    To:

    IF \16 <> 20 THEN GOTO :CHANGERWAIT

    Because now \13 will never equal \20 and she keeps on with GOTO :CHANGERWAIT

    i actually had caught that mistake when i originally wrote the post, altered it in the m-code/logging call.. thought i updated it here..

    i make use of varb 13 to keep track of my commanded spindle speed, back when i was troubleshooting some other stuff..

    but, anyway, with the correct loop, it has the same issue.

    I will take a look @ the "loading" command. most likely another one that i read, but buzzed right by due to other things on the mind.

    -nate

  5. #5
    Join Date
    Apr 2003
    Posts
    332
    Nate,

    We tried it here.

    LOADING does work but even without it the actual M15 logic waits for 2*20 seconds. 40 seconds total then continues on.

    Tech Support
    CamSoft Corp.
    (951) 674-8100
    [email protected]
    www.cnccontrols.com
    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  6. #6
    Join Date
    Sep 2005
    Posts
    67
    the execution of the M15? i would expect that to run for 40 seconds 2sec/cycle 20 cycles.. or the loading of the M15 call? if the mdi takes 40 seconds to "close" and then perform the actual logic in the m15, well.. i'd still be confused.

    -nate

  7. #7
    Join Date
    Apr 2003
    Posts
    332
    Nate,

    Use LOADING it works. No delay, hang or pause. LOADING takes 1 millisecond to execute.

    Put this at the top of M15

    LOADING \4
    IF \4=0 THEN EXIT

    When MDI runs and it hits M15. It will still take 40 seconds to finish. As programmed.

    Tech Support
    CamSoft Corp.
    (951) 674-8100
    [email protected]
    www.cnccontrols.com
    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  8. #8
    Join Date
    Sep 2005
    Posts
    67
    Quote Originally Posted by camsoft
    Nate,

    Use LOADING it works. No delay, hang or pause. LOADING takes 1 millisecond to execute.

    Put this at the top of M15

    LOADING \4
    IF \4=0 THEN EXIT

    When MDI runs and it hits M15. It will still take 40 seconds to finish. As programmed.
    cool i just hadn't had a chance to try out "loading" yet, and so didn't know exactly what you meant. I appreciate the insight!

    -nate

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •