592,504 active members*
4,663 visitors online*
Register for free
Login
Results 1 to 19 of 19
  1. #1
    Join Date
    Aug 2020
    Posts
    140

    is there a OnEStop script?

    Planet CNC currently offers customizable OnStart OnEnd and OnStop scripts. I was wondering if there is a similar option for the E-Stop event.

    Best Regards,
    Klaus

  2. #2
    Join Date
    Mar 2017
    Posts
    1375

    Re: is there a OnEStop script?

    Problem is that in E-Stop controller can not execute any commands. Therefore it can not execute scripts.
    What do you want to do in this event?

  3. #3
    Join Date
    Aug 2020
    Posts
    140

    Re: is there a OnEStop script?

    I'm currently implementing a tool spindle runtime routine. basically staving the timestamp a the spindle was startet with a tool (in M3 and M4) and calculating the difference when the spindle gets stopped with M5. This works fine for me. However if the Spindle gets stop due to a E-Stop this time would be missed.
    Its not a big deal as it should not happen on a regular basis, however it got me thinking if there is some way that is not mentioned in the documentation.

  4. #4
    Join Date
    Mar 2017
    Posts
    1375

    Re: is there a OnEStop script?

    OnEStop will be available in Expr.txt in next version.

  5. #5
    Join Date
    Aug 2020
    Posts
    140

    Re: is there a OnEStop script?

    sounds great.
    Thanks.

  6. #6
    Join Date
    Jun 2017
    Posts
    143

    Re: is there a OnEStop script?

    Quote Originally Posted by PlanetCNC View Post
    OnEStop will be available in Expr.txt in next version.
    This is great news. Now I will hopefully be able to stop my spindle and cooling on estop. In my case I need to send a couple of I2C commands.

  7. #7
    Join Date
    Mar 2023
    Posts
    12

    Re: is there a OnEStop script?

    Hi PlanetCNC,

    I also would be very happy to use an OnEStop Script. Is this meanwhile available?
    I would like to reset all PWM outputs with estop, which is not the case with my current version from Feb.2023.
    Using Estop script I would be able to realize this. Or is there any other solution?

    Best regards Armin

  8. #8
    Join Date
    Mar 2023
    Posts
    12

    Re: is there a OnEStop script?

    ...found it be myself:
    https://planet-cnc.com/cnc-machine-s...pr-txt-part-4/
    Amazing what functions PlanetCNC/TNG offers, but difficult to get all the necessary documentations!
    BR Sailnsea

  9. #9
    Join Date
    Mar 2017
    Posts
    1375

    Re: is there a OnEStop script?

    Additional info:

    https://cnc.zone/expr/expr

    https://cnc.zone/expr/events/events

    https://cnc.zone/expr/events/event-onestop


    For any future info, project or user manual requests, I recommend that you visit our page cnc.zone:
    https://cnc.zone/home

  10. #10
    Join Date
    Mar 2023
    Posts
    12

    Re: is there a OnEStop script?

    Thanks for this links! Very helpful to solve some ideas on my machine.

    But still one problem open: How could I reset PWM-outputs after a EStop-Event. Problem is that the TNG-dutycycle-parameters for PWM-outputs are R-only and cannot be changed for example in the expr.txt Event-handling.
    I need to reset them, same behaviour as for the normal outputs after an EStop. They keep in off-state after restart and must be set again. PWM keeps working.

    Thankyou for any advice to this. BR SailnSea

  11. #11
    Join Date
    Mar 2017
    Posts
    1375

  12. #12
    Join Date
    Mar 2023
    Posts
    12

    Re: is there a OnEStop script?

    Thankyou PlanetCNC!

    I testet the event-handling of func-outpwm() in expr.txt:
    Result: It does not switsch off the PWM-output when using in #OnEstop
    Expr.txt see below. The print-commands in #OnEStop are working, I got the info on the output window, but PWM-out still keeps in on-state. no reaction there.

    To be sure that I use the correct output number, I also tested outpwm() in event #OnJog.
    There it works as expected.

    Hope of any hint????

    Other idea to solve the problem: Is it possible to make somehow a controller reset in #OnEStop. Because making this manually will reset the PWM-outputs.

    contents of my expr.txt:
    #OnEStop
    print('EXPRtxt PWMout Channel2');
    outpwm(1, 0);
    print('EXPRtxt PWMoutoff');

    #OnStop
    print('EXPRtxt OnStop');

    #OnEnd
    print('EXPRtxt OnEnd');

    #OnJog
    print('EXPRtxt OnJog');
    ;outpwm(1, 0);

  13. #13
    Join Date
    Mar 2023
    Posts
    12

    Re: is there a OnEStop script?

    Hi PlanetCNC,

    the func outpwm() does not work in event handlerexpr.txt on #OnEstop???
    (See commet above)
    I want/must swich off the PWM-Output in case of an EStop.
    Any suggestion how to reach this would be very helpful?

    BR SailnSea

  14. #14
    Join Date
    Mar 2017
    Posts
    1375

    Re: is there a OnEStop script?

    With Estop activated, any "live" output, either digital output pin or output pin with PWM functionality, will be automatically set to 0

  15. #15
    Join Date
    Mar 2023
    Posts
    12

    Re: is there a OnEStop script?

    Thanks for response!
    Yes, any "live" output is set to 0 with Estop, that works fine, but my problem: after cancelling an Estop, the PWM-functionalloty still works as before the Estop, where as any digital output remains 0 (those must be set again).
    In my application, the PWM-signal feeds an additional spindle axis which starts moving after cancelling an Estop and that might become dangerous. I would be happy to reset PWM totally with Estop and after Estop.
    Any suggestion to solve this by software would be helpfull.
    BR Ssailnsea

  16. #16
    Join Date
    Mar 2017
    Posts
    1375

    Re: is there a OnEStop script?

    New version will have option to turn off PWM pins on e-Stop
    Attached Thumbnails Attached Thumbnails OqTDmwTuBk.png  

  17. #17
    Join Date
    Mar 2023
    Posts
    12

    Re: is there a OnEStop script?

    Hi Planet-CNC,

    thank you!
    This looks great!
    Best machine control and support I know :-)
    BR SailnSea

  18. #18
    Join Date
    May 2023
    Posts
    20

    Re: is there a OnEStop script?

    Hei there, how can I switch off on E-Stop the ext-out ports? I have spindle coolant pump and mist on that board and they stay on when I press the E-stop button...

  19. #19
    Join Date
    May 2023
    Posts
    20

    Re: is there a OnEStop script?

    Ok, I found a way: create expr.txt under default profile folder and put
    #OnEStop
    extout1(X, 0)

Similar Threads

  1. cad script
    By jeroend in forum Uncategorised CAM Discussion
    Replies: 0
    Last Post: 08-30-2020, 03:23 PM
  2. VB Script
    By Montabelli in forum Mastercam
    Replies: 0
    Last Post: 08-20-2015, 12:11 AM
  3. how do i save script?
    By kjl-pdx in forum Mach Wizards, Macros, & Addons
    Replies: 1
    Last Post: 01-22-2014, 10:54 PM
  4. VB6,VB.net,VB script,What one???
    By hydrospin01 in forum Visual Basic
    Replies: 11
    Last Post: 05-25-2008, 02:09 AM

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
  •