585,735 active members*
4,797 visitors online*
Register for free
Login

Thread: Time counter

Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2009
    Posts
    146

    Time counter

    I have the program for the heating mashine.

    This is the example for fanuc:

    %
    O7999(WARMING UP)
    G0G17G90G80G49
    G10L20P40X0Y0Z0
    G54.1P40
    (RPM ON BEGINNING)
    #511=1000
    (INCREASING THE VALUE OF RPM)
    #512=2000
    (MINIMUM DURATION IN MIN)
    #513=5
    (RPM UPER LIMMIT)
    #516=6000

    #3001=0(RESET OF COUNTER)
    #514=#513*60(MIN TIME IN S)
    S#511M3(RPM ON)
    #515=#514
    N11G1X0Y0Z0F3000
    G4P500
    X500Y600Z-200
    G4P500
    IF[#511GE#516]GOTO11
    #611=#3001(TIME 2)
    #614=#611/1000
    IF[#614LT#514]GOTO11
    #3001=0(RESET COUNTER)
    IF[[#511+#512]GT#516]GOTO12
    #511=#511+#512(INCREASE RPM)
    S#511(NEW VALUE OF RPM)
    GOTO11
    N12S#516
    GOTO11
    M30
    %


    How should I do this in Siemens 840D?

    I know, how to programming with parameters, but I dont know, how to record the value of time and then compare?

  2. #2
    Join Date
    Jun 2009
    Posts
    146

    Re: Time counter

    Maybe someone knows how to realize the counter to control sinumeric 840D?

    Or, for example, how do I do that the program will compare the two correction of ools, and if, for example. H1 of tool1 is greater than H2 of tool 1, displayed an error?

  3. #3
    Join Date
    May 2013
    Posts
    37

    Re: Time counter

    F O7999(WARMING UP)
    S ;
    F G0G17G90G80G49
    S G0G17G90 MCALL D0
    F G10L20P40X0Y0Z0
    S $P_UIFR[40]=CTRANS(X,0,Y,0,Z,0)
    S $P_UIFR[40]=CFINE(X,0,Y,0,Z,0)

    S G540
    F (RPM ON BEGINNING)
    F #511=1000
    S R1=1000
    F (INCREASING THE VALUE OF RPM)
    F #512=2000
    S R2=2000
    F (MINIMUM DURATION IN MIN)
    F #513=5
    S R3=5
    F (RPM UPER LIMMIT)
    F #516=6000
    S R6=6000
    S R11=0 ;NEED FOR 840D


    F #3001=0(RESET OF COUNTER)
    S $AC_PROG_NET_TIME_TRIGGER=2;START COUNTER AND SET "$AC_ACT_PROG_NET_TIME"TO"0"$AC_OLD_PROG_NET_T IME NOT CHANGE
    F #514=#513*60(MIN TIME IN S)
    S R4=R3*60;(MIN TIME IN S)
    F S#511M3(RPM ON)
    S S=R1M3;(RPM ON)
    F #515=#514
    S R5=R4
    F N11G1X0Y0Z0F3000
    S _N11:G1X0Y0Z0F3000
    F G4P500
    S G4F0.5
    F X500Y600Z-200
    S X500Y600Z-200
    F G4P500
    S G4F0.5
    F IF[#511GE#516]GOTO11
    S IF(R1>=R6) GOTOB _N11
    F #611=#3001(TIME 2)
    S $AC_PROG_NET_TIME_TRIGGER=1;STOP COUNTER AND COPY $AC_ACT_PROG_NET_TIME TO $AC_OLD_PROG_NET_TIME AND SET $AC_ACT_PROG_NET_TIME TO 0
    S STOPRE
    S $AC_PROG_NET_TIME_TRIGGER=2 ;START
    S R30=$AC_OLD_PROG_NET_TIME;(TIME 2)
    S R11=R11+R30;(TIME 2) SUMARY TIME
    S STOPRE

    F #614=#611/1000
    S R14=R11;TIME IN S
    F IF[#614LT#514]GOTO11
    S IF R14<R4 GOTOB _N11
    F #3001=0(RESET COUNTER)
    S $AC_PROG_NET_TIME_TRIGGER=1;(STOP)
    S STOPRE
    S R11=0

    S $AC_PROG_NET_TIME_TRIGGER=2;(START)
    F IF[[#511+#512]GT#516]GOTO12
    S IF((R1+R2)>=R6) GOTOF _N12
    F #511=#511+#512(INCREASE RPM)
    S R1=R1+R2(INCREASE RPM)
    F S#511(NEW VALUE OF RPM)
    S S=R1(NEW VALUE OF RPM)
    F GOTO11
    S GOTOB _N11
    F N12S#516
    S _N12:S=R6
    F GOTO11
    S GOTOB _N11
    FS M30
    %

    S-SINUMERIK
    F-FANUC

  4. #4
    Join Date
    Jun 2009
    Posts
    146

    Re: Time counter

    Thank you for your comprehensive reply.

    I am interested in something, or maybe you know (you probably know) how the value of the parameter R (R5 = 103) stores, for example on 9th tool offset lenght compensation current (currently active) tools?
    For example.:
    T4
    M6

    I want now to save the value of r-parameter, and this is the 9th lenght offset tools from T4.
    So tool lenght offset D9 of the tool 4, There should be subscribed value from R-parameter (velue 103)...

    Sorry for bad english...

  5. #5
    Join Date
    May 2013
    Posts
    37

    Re: Time counter

    I understand that you want to save the value of the variable "R" to some of the current number of the correction. Well I think? (my English is poor).

    Well here we go:
    I see it like this:

    Code:
    ;ISO G-Code Program
    ;G90 G00 G94 G17 G64
    
    T4 D9 M6;CALL TOOLS, CALLING THE CORRECTION NUMBER AND TOOL CHANGE
    
    ; $TC_DP6[m,n] - RADIUS GEOMETRY; m-tool number in whole mag table, n-"D" Number
    ; $TC_DP15[m,n] - RADIUS FINE; m-tool number in whole mag table, n-"D" Number
    
    ; $TC_DP3[m,n] - LENGTH GEOMETRY; m-tool number in whole mag table, n-"D" Number
    ; $TC_DP12[m,n] - FINE LENGTH; m-tool number in whole mag table, n-"D" Number
    
    ; $TC_MPP6[9998,1]-Table number actual tools (T4-not necessarily 4)
    ; $SP_TOOL - actual tools "D" number (should be 9)
    
    ; if
    ; r3 = 100; r4 =-0.1; r5 =-0.1
    ; when
    ; r3 = r3 + r4 + r5
    ; r3 = 99.8
    ; r4 = 0
    ;Logical? :)
    
    ;And so:
    ;Example for RADIUS
    $TC_DP6[$TC_MPP6[9998,1], $SP_TOOL] = $TC_DP6[$TC_MPP6[9998,1], $SP_TOOL] + $TC_DP15 [$TC_MPP6[9998,1], $SP_TOOL] + R5
    $TC_DP15[$TC_MPP6[9998,1], $SP_TOOL] = 0
    
    ;Example for length.
    $TC_DP3[$TC_MPP6[9998,1], $SP_TOOL] = $TC_DP3[$TC_MPP6 [9998,1], $SP_TOOL] + $TC_DP12 [$TC_MPP6[9998,1], $SP_TOOL] + R5
    $TC_DP12[$TC_MPP6[9998,1], $SP_TOOL] = 0
    
    ; After you make changes you will need to call again.
    
    D9
    or
    G1 G41 D9 X 10
    .....
    .....
    ....
    M17

  6. #6
    Join Date
    Jun 2009
    Posts
    146

    Re: Time counter

    I really thank you for your comprehensive answer, I think this is what I want ... I tested how it works ...

  7. #7
    Join Date
    Jun 2009
    Posts
    146

    Re: Time counter

    I really thank you for your comprehensive answer, I think this is what I want ... I tested how it works ...

  8. #8
    Join Date
    Jun 2009
    Posts
    146

    Re: Time counter

    I have tested on the machine. This works perfectly.

    I have another question, I do not know how I define "GUD". Where should I define it and how to use it inside the program?

    I have to do special file, or define it in the program?

    If I use "GUD" variables probably do not need more R-parameters?

Similar Threads

  1. Replies: 1
    Last Post: 06-11-2014, 02:53 AM
  2. Replies: 76
    Last Post: 04-24-2014, 01:42 PM
  3. Replies: 0
    Last Post: 04-24-2012, 01:46 PM
  4. long time reader first time poster
    By blu333 in forum MetalWork Discussion
    Replies: 0
    Last Post: 02-21-2010, 12:30 PM
  5. milling time (not to be confused with hammer time)
    By barefoot0 in forum G-Code Programing
    Replies: 4
    Last Post: 05-03-2007, 12:18 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
  •