549,941 active members*
2,393 visitors online*
Register for free
Login

Thread: on start up

Results 1 to 6 of 6
  1. #1
    Registered
    Join Date
    Feb 2011
    Posts
    104

    on start up

    question: iz it possible to make one time event, when machine start first time some program and the stays ON?
    F.e.: my code for "on start"

    M62 P1 Q1
    G04 P10
    (print,OnStart script @ Line: #<line,0>)

    but, I don' like it because it delays 10 sec everytime I start new program. Is there some solution that will skip delay if P1 is ON?

  2. #2
    Moderator
    Join Date
    Mar 2017
    Posts
    918

    Re: on start up

    Check #OnInit section of Expr.txt
    https://www.cnczone.com/forums/plane...-expr-txt.html

  3. #3
    Registered
    Join Date
    Feb 2011
    Posts
    104

    Re: on start up

    Thank you, but this exceed my knowledge...

  4. #4
    Moderator
    Join Date
    Mar 2017
    Posts
    918

    Re: on start up

    If I understand correctly there are two questions here.

    1. How can I turn output on when TNG starts?
    2. How can I skip wait if output is already on?

    1:
    - Open or create "Expr.txt" file in you profile folder.
    - Find or create new "#OnInit" section
    - Add comand that will turn output on,. For examle:
    Code:
    #OnInit
    print('Expr: OnInit');
    cmd("Machine.Output", 4 ,1);
    This will turn output 5 on (note that first output has number 0).
    Message will also be printed to output window.

    2.
    Do this in your Onstart script.
    Code:
    #<out1>  = #<_hw_output_num|1>
    M62 P1 Q1
    o<chk> if [#<out1> EQ 0]
      (print, Waiting 10s)
      G04 P10
    o<chk> endif

    .

  5. #5
    Registered
    Join Date
    Feb 2011
    Posts
    104

    Re: on start up

    THANK YOU !!
    Works like a charm!
    Didn't know that 2 files neded adjusting - coding.
    Why I need that? Because the fuse is on edge and some delay neded when machine starts first time to VFD goes to ON, delay for VFD is recomended before spindle starts. When ewerything is ON, works perfect.
    I am driwing that on IO 1 port with SSR.

  6. #6
    Registered
    Join Date
    Feb 2011
    Posts
    104

    Re: on start up

    THANK YOU !!
    Works like a charm!
    Didn't know that 2 files neded adjusting - coding.
    Why I need that? Because the fuse is on edge and some delay neded when machine starts first time to VFD goes to ON, delay for VFD is recomended before spindle starts. When ewerything is ON, works perfect.
    I am driwing that on IO 1 port with SSR.

Similar Threads

  1. Replies: 1
    Last Post: 08-21-2018, 11:13 PM
  2. Replies: 3
    Last Post: 12-19-2015, 02:29 AM
  3. 1 start or 2 start anti-backlash nuts?
    By SpeedyDad in forum Momus Design CNC plans
    Replies: 5
    Last Post: 08-29-2011, 06:00 PM
  4. ACME rods - normal start and multi-start
    By shaffin in forum Canadian Club House
    Replies: 0
    Last Post: 12-20-2010, 02:19 PM
  5. Replies: 4
    Last Post: 01-06-2009, 05:20 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
  •