585,575 active members*
3,960 visitors online*
Register for free
Login
Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2015
    Posts
    11

    Question Stopping macro Issue

    Hello! :wave:

    I´m writing a macro that have several steps and inform the user with a message on the status window on each step of the process.
    If the macro is stopped with the ESC key or the STOP button, the movement stops but the macro still writing the messages on the status windows and keep running without movement.
    My issue here is that every step of the macro it have a variable that is changing while its running so if the macro is stopped that variable will serve as a reference to tell the user where the macro was stopped.

    I have the

    if(!exec.Ismacrostopped())

    but the ELSE statement only run after the whole macro finish running and give the message that the macro was stopped but only after all the routines went thru.

    It isn't suppose that if you stop a macro it will go to the if(!exec.Ismacrostopped()) directly???

    I´m running the macro from a button BTW.

    Any help would be appreciated.

    Thank you in advance!

  2. #2
    Join Date
    Jun 2015
    Posts
    943

    Re: Stopping macro Issue

    C# do ordinal code execution just like most other programming languages.
    I think you don't fully understand how to code in C#, but maybe we can help if you post your code and describe the issue a bit more detailed.

  3. #3
    Join Date
    Jul 2015
    Posts
    11

    Re: Stopping macro Issue

    Quote Originally Posted by OlfCNC View Post
    C# do ordinal code execution just like most other programming languages.
    I think you don't fully understand how to code in C#, but maybe we can help if you post your code and describe the issue a bit more detailed.
    I do understand how C# works, what I don´t understand is why when i press stop or the esc key the macro only stops the axis movements but the macro is still running all the way thru the end instead of just stopping.

    All the macro runs fine, all the routines and variables (its very extensive) my only problem is that the macro wont stop.

  4. #4
    Join Date
    Mar 2010
    Posts
    813

    Re: Stopping macro Issue

    ESC will stop all movement but macro will continue...Try

    if(exec.Ismacrostopped()){return;}

    else{MessageBox.Show("????");}

  5. #5
    Join Date
    Jul 2015
    Posts
    11

    Re: Stopping macro Issue

    I found someone with a similar issue as me and here are some possible solutions in case anyone needs them

    https://forum.cncdrive.com/viewtopic.php?f=4&t=1197

    Thank you!!!

  6. #6
    Join Date
    Jul 2015
    Posts
    11

    Re: Stopping macro Issue

    Quote Originally Posted by Dan911 View Post
    if(exec.Ismacrostopped()){return;}

    else{MessageBox.Show("????");}
    Yep I´m using that solution now Thank you Dan911 , lots of IFs on the code until they fix the Stop issue. =)

  7. #7
    Join Date
    Mar 2010
    Posts
    813

    Re: Stopping macro Issue

    There really wasn't a fix issue, a macro is a thread and shouldn't be canceled while running. That's why the functions ismacrostopped and ismacrorunning was added.

Similar Threads

  1. Issue with macro variable #3002
    By grweldon in forum Fanuc
    Replies: 15
    Last Post: 01-18-2018, 06:58 PM
  2. Possible issue with Mach3 Mill losing axis zero when stopping during arc moves
    By qbit in forum Mach Software (ArtSoft software)
    Replies: 0
    Last Post: 04-23-2016, 04:43 PM
  3. Infuriating issue with Mach 3 is stopping CNC joy...
    By Farasien in forum Charter Oak Automation Support Forum
    Replies: 16
    Last Post: 02-08-2015, 04:34 AM
  4. Set G30 macro issue
    By dcrace in forum Daewoo/Doosan
    Replies: 2
    Last Post: 05-13-2013, 01:16 PM
  5. Random Stopping - E-Stop Issue
    By EvanZ in forum DIY CNC Router Table Machines
    Replies: 6
    Last Post: 11-07-2008, 08:57 PM

Tags for this Thread

Posting Permissions

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