600,839 active members*
2,907 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > PlanetCNC > START FROM SELECTED LINE, CREATE BUTTON
Results 1 to 4 of 4
  1. #1

    START FROM SELECTED LINE, CREATE BUTTON

    Hello,
    I have to create a "Start From Selected Line" button ,i used this code in program/planetCNC/Profiles/Default/Btn :

    cmd: "Machine.Start_Option.Start_From_Selected_Line " "" "image=/Icons/IMG_MyImage.svg" imagechange"true" stroke=1.1

    I noticed that this button work corretly only if before i started the program from the first line and then i stopped it, otherwise the button remains always inibited.
    The behavior work correctly if i use the command from "Machine -> Start Options -> Start From Selected Line" but i prefer create a dedicated button for speed up the process.
    This is my OnStart script that bring my machine in a home position before start and manages program if it start from first line or from a selected line.

    G21
    G90

    O<chk> if [#<line>]

    (print, program will start from selected line)
    G53 G00 Z-4
    G53 G00 X4 Y486
    G53 G00 X#<posstate_x> Y#<posstate_y>
    M3
    G53 G00 Z#<posstate_z>

    O<chk> else

    (print, program will start from first line)
    G53 G00 Z-4
    G53 G00 X4 Y486

    O<chk> endif

    I would be happy if you could help me, thankyou for any replace.
    (i'm new in this forum, so i'm sorry if i didn't comply any rule).

  2. #2
    Join Date
    Nov 2013
    Posts
    4961

    Re: START FROM SELECTED LINE, CREATE BUTTON

    Hi,
    in Mach3 and Mach4 that function is called Run-From-Here and has caused more crashes than any other feature.

    The problem is that Gcode is modal. For instance if the last motion instruction were G0 X...Y..., then all moves thereafter are in G0 or rapid mode until another say G1 instruction is
    called and thereafter the machine is in G1 mode.

    If you attempt to start a program from some midpoint then the machine has no 'history' and does not know what mode it is supposed to be in. For this reason there is a 'Dry Run' feature,
    where the machine runs through all the Gcode prior to the intended start point, but without motion, just so it can get that 'history' and be in the correct mode.

    The next issue is that at the intended start point the machine is supposed to be in a particular position, if you start the program running, even in the right mode, but from the wrong start
    position the first move will be from where the machine is to where the next terminal point is......irrespective of what's in the way! You guessed it CRASH!!!!!.

    In Mach there is a procedure called the 'Preparatory Move', where the machine goes to the correct start location, but it is this move that causes all the crashes as users do not anticipate
    the move required and either gouge the workpiece or hit a vise or toe clamp or whatever. The bottom line is that you must follow the procedure perfectly every time or risk collision.

    So, there is a lot to do if you are trying to generate a function that starts from some arbitrary line in a Gcode file.

    Craig

  3. #3
    Join Date
    Mar 2017
    Posts
    1390

    Re: START FROM SELECTED LINE, CREATE BUTTON

    PlanetCNC does not have this issue. "Start From" function has correct modal state. with "Start" script it is possible do program any specifics you might have (usually safe heights and/or spindle coolant stuff.Your toolbar button is not updating. Add update="true" to its line:cmd: "Machine.Start_Option.Start_From_Selected_Line " "" "image=/Icons/IMG_MyImage.svg" imagechange"true" stroke=1.1 update="true"

  4. #4
    Thank you all for information, fortunately i'm using PlanetCNC, i don't use Mach systems.
    I added update = "true" to my button code and now work correctly.
    Here the updated code:
    cmd: "Machine.Start_Option.Start_From_Selected_Line " "" image="Icons/IMG_MyImage.svg" imagechange="true" stroke=1.1 update="true"

Similar Threads

  1. Own "Start On Line" button do not work
    By tantemay in forum PlanetCNC
    Replies: 6
    Last Post: 03-02-2021, 07:11 AM
  2. Problem with "Start from Selected Line"
    By tantemay in forum PlanetCNC
    Replies: 2
    Last Post: 08-23-2020, 07:21 PM
  3. Start From Selected Line
    By yar20 in forum PlanetCNC
    Replies: 22
    Last Post: 12-07-2019, 02:46 AM
  4. Replies: 4
    Last Post: 02-10-2019, 10:24 AM
  5. Run From Selected Line- works
    By Dan Falck in forum LinuxCNC (formerly EMC2)
    Replies: 0
    Last Post: 01-28-2009, 05:16 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
  •