550,298 active members*
2,384 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > Dynomotion/Kflop/Kanalog > Code for Init File to Halt all other running threads?
Results 1 to 3 of 3
  1. #1
    Registered
    Join Date
    May 2012
    Posts
    521

    Code for Init File to Halt all other running threads?

    Hi Tom,

    Im running into an occasional mechanical issue with my toolchanger and its triggering an Estop. My toolchange program is still running and In order to recover I need to open up kmotion and halt that thread.

    I would like to be able to recover the machine just by restarting init file. Have the beginning of the init file stop all running threads. Looks like I need to use the Kill command for whatever threads Im using? Like this:

    Kill4
    Kill6

    Or would it be

    Kill4;
    Kill6;

    Or something else? Should I add a delay after this to be sure those threads are stopped before clearing bits to be sure all the toolchanger outputs are off? Thanks.

    Mark

  2. #2
    Junior Member
    Join Date
    May 2006
    Posts
    3919

    Re: Code for Init File to Halt all other running threads?

    Hi Mark,

    You can use:

    PauseThread(4);
    PauseThread(6);

    No delay should be required. Once those routines return the corresponding Thread will not execute further.

    Another approach would be to have the Threads detect the error, do any cleanup, and terminate itself (exit). Probably not in your case, but killing Threads sometimes has a possibility of leaving things in a partially changed invalid state.
    TK
    http://dynomotion.com

  3. #3
    Registered
    Join Date
    May 2012
    Posts
    521

    Re: Code for Init File to Halt all other running threads?

    Quote Originally Posted by TomKerekes View Post
    Hi Mark,

    You can use:

    PauseThread(4);
    PauseThread(6);

    No delay should be required. Once those routines return the corresponding Thread will not execute further.

    Another approach would be to have the Threads detect the error, do any cleanup, and terminate itself (exit). Probably not in your case, but killing Threads sometimes has a possibility of leaving things in a partially changed invalid state.
    Thank you Tom I will try that. I think it would be much trickier to get the toolchange program to detect the error and set everything properly. The e stop actually comes from a switch being watched in my init file, not a specific step of toolchange program.

    My machine has a sensor to trigger Estop if somehow the whole toolchanger mechanism gets pulled up or down. Say the tool fails to release, and drawbar sensor also fails and the machine starts to pull the whole toolchanger assembly up, it will detect this and shut things down. Same if the toolchanger happend to get bumped on the way down somehow.

    The problem Im having is toolholders sticking in the spindle from heavy cutting and when they finally let go, they have so much force behind them that the shock is tripping this sensor. This should work fine for what im doing.

Similar Threads

  1. No Init File
    By aumran in forum Controller & Computer Solutions
    Replies: 0
    Last Post: 08-01-2018, 03:18 PM
  2. No Init File
    By aumran in forum SERVICE FOR CNC-MACHINES
    Replies: 0
    Last Post: 08-01-2018, 03:15 PM
  3. No Init File
    By aumran in forum Questions or Problems
    Replies: 0
    Last Post: 08-01-2018, 02:56 PM
  4. How to Merge Init file with external buttons file.
    By amitkumar171 in forum Dynomotion/Kflop/Kanalog
    Replies: 5
    Last Post: 11-19-2017, 07:14 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
  •