Part Count Help


Results 1 to 17 of 17

Thread: Part Count Help

  1. #1
    Member
    Join Date
    May 2018
    Location
    United States
    Posts
    74
    Downloads
    0
    Uploads
    0

    Default Part Count Help

    Hello,How to skip the part count when we have a sequence restart.I can count the part to increase 1 but I don't want to increase when we do a sequence restart.Can the variable VRSTT be used? I have tried this but does not work. IF[VRSTT NE 0] N101N100 V1=V1+1N101 V1=V1Thank for your help

    Similar Threads:


  2. #2
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4131
    Downloads
    0
    Uploads
    0

    Default Re: Part Count Help

    hi, i use something like this when machining many parts from a bar :


    presetting program
    Code:
     
    
        NOEX V28 =  0 ( counter )
        NOEX V29 = 30 ( parts   )
    
        M02
    main program
    Code:
        G50 S1234
    
        NN01   CALL OS01 ( tool description, operation, etc ) ( P comp quadrant ) LINK = turret_post
        NN02   CALL OS02 ( tool description, operation, etc ) ( P comp quadrant ) LINK = turret_post
        NN03   CALL OS03 ( tool description, operation, etc ) ( P comp quadrant ) LINK = turret_post
    
    
        IF [ VRSTT NE 0 ] NN99
             NOEX V29 = V29 + 1
        NN99 IF [ V29 EQ V28 ] NJUMP / NEXIT
    
        IF [ V29 LT V28 ] NN01
    
        NJUMP / NEXIT G00 safe_position
    
        M02
    
    i hope you find it useful do you wish a simpler code, or can you spot what you need ? it is there looook





    now your code : replace this " IF[VRSTT NE 0] N101N100 V1=V1+1N101 V1=V1 " with :
    Code:
     
        IF [ VRSTT NE 0 ] NJUMP
             NOEX V1 = V1 + 1
        NJUMP NOEX
    take it easy, get a beer


    ps : read your book ! or at least read the beer label ...

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  3. #3
    Member Algirdas's Avatar
    Join Date
    Mar 2009
    Location
    United Arab Emirates
    Posts
    1982
    Downloads
    2
    Uploads
    0

    Default Re: Part Count Help

    what about use schedule program for part count? It counts M02. It is designed for that.



  4. #4
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4131
    Downloads
    0
    Uploads
    0

    Default Re: Part Count Help

    hey mr bunny if a program is looped, than it will reach M02 only after a certain number of parts

    also, to create conditional code, based on machine default M02 counter, than is needed a system variable that stores the counted value; i don't know if it exists ...

    just saying / kindly

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  5. #5
    Member
    Join Date
    May 2018
    Location
    United States
    Posts
    74
    Downloads
    0
    Uploads
    0

    Default Re: Part Count Help

    with this code: IF [ VRSTT NE 0 ] NJUMP NOEX V1 = V1 + 1 NJUMP NOEX.I got the message 428 ALARM-B EQUAL IS NOT EXIST.So I just need to repace my code with the code IF [ VRSTT NE 0 ] NJUMP NOEX V1 = V1 + 1 NJUMP NOEX? or we need something else



  6. #6
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4131
    Downloads
    0
    Uploads
    0

    Default Re: Part Count Help

    that error may be because the controller believes NOEX is a local variable ... remove NOEX


    i don't advise you to replace your codes with mine, unless you are certain about what they are doing ... i tried to explain them, but pls ask whatever you wish

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  7. #7
    Member
    Join Date
    May 2018
    Location
    United States
    Posts
    74
    Downloads
    0
    Uploads
    0

    Default Re: Part Count Help

    Oh, No.Thanks for your response. I have no help here cause no one knows about okuma variables.Let me try again



  8. #8
    Member
    Join Date
    May 2018
    Location
    United States
    Posts
    74
    Downloads
    0
    Uploads
    0

    Default Re: Part Count Help

    Quote Originally Posted by deadlykitten View Post
    hey mr bunny if a program is looped, than it will reach M02 only after a certain number of partsalso, to create conditional code, based on machine default M02 counter, than is needed a system variable that stores the counted value; i don't know if it exists ...just saying / kindly
    So is there any way we count part by counting the cycle start instead of M02?Do you know the Cycle start variable for okuma lathe?Thanks



  9. #9
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4131
    Downloads
    0
    Uploads
    0

    Default Re: Part Count Help

    just put V1=V1+1 at the begining of the program; or at the end ... or anywhere inside the program

    the variable will increase with 1 each time the program performs

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  10. #10
    Member
    Join Date
    May 2018
    Location
    United States
    Posts
    74
    Downloads
    0
    Uploads
    0

    Default Re: Part Count Help

    But when you do a sequence restart then it will increase 1 even though you are not finish the part yet. That's what I am stuck.By counting the frequency of the cycle start is activated then you count the part doesn't matter how many times sequence restart button is activated.



  11. #11
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4131
    Downloads
    0
    Uploads
    0

    Default Re: Part Count Help

    use this to avoid counting during a restart sequence :

    Code:
     
        IF [ VRSTT NE 0 ] NJUMP
             V1 = V1 + 1
        NJUMP
    
    another way to do it is by putting V1=V1+1 before the end of the program : whenever you restart the program, you restart an operation, and only after all operations are executed counting will occur

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  12. #12
    Member
    Join Date
    May 2018
    Location
    United States
    Posts
    74
    Downloads
    0
    Uploads
    0

    Default Re: Part Count Help

    I did try that code and it does not work. It still increase 1. Since the counter count on M02 by default so when you restart the operation that means M02 will be read when you end the program.That is the problem.I thought the VRSTT SHOULD WORK BUT DON'T KNOW WHY IT DOES NOT WORK FOR ME OSP 500L



  13. #13
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4131
    Downloads
    0
    Uploads
    0

    Default Re: Part Count Help

    don't confuse the default M02 counter with V1=V1+1 : those are separate things ...

    what you need to deliver, thus automatic wear update, can not be done using the default_M02_counter ( at least i can't ); you need the common variable V1

    so, when you restart, don't check if the M02_counter is updated, but the common variable; try this simple program :

    Code:
        G50 S1234
        NN01
        NN02
        IF [ VRSTT NE 0 ] NJUMP
             V1 = V1 + 1
        NJUMP
        NN03
        M02
    if you restart on NN01 or NN02, V1 will be increased by 1, because 'V1 = V1 + 1' it is located after the restart position

    if you restart on NN03, V1 will remain unchanged, because 'V1 = V1 + 1' it is located before the restart position




    VRSTT does not mean that a restart has occured; it is a restart flag : for example, if you don't restart the program, than VRSTT will be 0; if you restart the program, than VRSTT will be 128 during the restart procedure, and it will be 0 after you press cycle-start ( in other words : if you restart at line NN02, VRSTT will be 128 until NN02 inclusive, and 0 after NN02 ... )

    VRSTT value is dynamically changed, and it reflects the actual cnc state; it is like a watch : always showing the current time it is like a beer bottle : if you see it empty, this does not mean that it was full actually, this is not true think of a glass : if you see it empty, this does not mean that it was full / does this makes s
    sense ?

    so VRSTT does not mean that a restart has occured ; VRSTT shows only if a restart is in progress, or not ( flag behaviour )

    sometimes it helps to know how the VRSTT changes its value when executing the restart line : for example, the restarted line is executed with the flag on, or off ? does VRSTT changes it's value before or after the execution of the restarted line ?





    it is possible to avoid updating V1 even if the restart was at line NN01, thus it is possible to know if a program was restarted but i don't believe that you need this now ...

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  14. #14
    Member
    Join Date
    May 2018
    Location
    United States
    Posts
    74
    Downloads
    0
    Uploads
    0

    Default Re: Part Count Help

    Oh No. It is just for the part counter. The automatic wear update is not done yet. I am still waiting for the machine is free.This is the problem people here are stuck too. Since I have read the macro B and okuma variables and found out the VRSTT.Let say you start the first part and the v1 will be 1. run the second part and v1=2 but you have to restart the 2nd part at N0150 to the end of the program in other to fix the dia. It means that the M02 will be read again then v1 at this time will be 3 not 2. I have tried your code but it still increase 1 after I restart.



  15. #15
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4131
    Downloads
    0
    Uploads
    0

    Default Re: Part Count Help

    Quote Originally Posted by deadlykitten View Post
    it is possible to avoid updating V1 even if the restart was at line NN01, thus it is possible to know if a program was restarted but i don't believe that you need this now ...
    duuh, it seems i just had a negative premonition ... this is why i never win when gambling

    here :

    Code:
        G50 S1234
        LVRF = 0                 ( local variable for recording if the restart flag was on )
    
    
        NN01 CALL OSUB
        // operation 1 here
    
    
        NN02 CALL OSUB
        // operation 2 here
    
    
        NN03 CALL OSUB
        // operation 3 here
    
    
        IF [ LVRF EQ 1 ] NJUMP
             V1 = V1 + 1
        NJUMP
    
    
        M02
    
    
    OSUB
    
    
        IF [ VRSTT EQ 0 ] NJUMP
      ( IF [ LVRF  EQ 1 ] NJUMP )
             LVRF =  +1
        NJUMP
    
    
    RTS
    i will test this soon it should deliver what you need ...

    pls be aware that i don't test the program on a similar machine as yours, and compatibility issues may appear

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  16. #16
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4131
    Downloads
    0
    Uploads
    0

    Default Re: Part Count Help

    program from previous post is too complicated for what you need

    try this one, where vrstt is right at the begining :

    Code:
        
        IF [ VRSTT NE 0 ] NJUMP
             V1 = V1 + 1
        NJUMP
        
        G50 S1234
        
        NN01
        // operation 1 here
        
        NN02
        // operation 2 here 
        
        NN03
        // operation 3 here
        
        M02
        
    
    each time you restart on NN01, NN02 or NN03, V1 will remain unchanged

    if you start the program normally, than V1 will update; pls test it

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  17. #17
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4131
    Downloads
    0
    Uploads
    0

    Default Re: Part Count Help

    program from post 15 updates the variable ( counter ) at the end, after all operations occured

    program from post 16 updates the variable at the begining, before any operation

    in both cases, the variable won't be updated in case of a restart, but only in continuous mode


    so pick one i would go with the program from post 15, because the counter is located at the end / seems more natural to have the counter after the last operation i recomand you test & understand the simpler program from post 16, and only after that, if you wish, move to other

    again, take your time, don't rush, and if you need something, i am here / kindly

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  18. #18
    Member OkumaWiz's Avatar
    Join Date
    Apr 2009
    Location
    United States
    Posts
    1262
    Downloads
    0
    Uploads
    0

    Default Re: Part Count Help

    Get rid of V1=V1 on N101 it should cure it.

    Experience is what you get just after you needed it.


  19. #19
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4131
    Downloads
    0
    Uploads
    0

    Default Re: Part Count Help

    hi there are 2 codes in this post, which had been tested ; both codes count only in continous mode; counting is not executed in restart mode

    there are 4 operations, each one inside a soubroutine OS0*; each operation can be restarted by the address NN0*

    i recomand you the 1st code; don't use it unless you have no doubts about it


    2nd code has more optimisations ( involving the vrstt ), so to reduce the restart duration; requires more time to be understood; is ok if you use a single-safe-position for all your operations; it can be adapted for multiple-safe-positions; i recomand you to look over this 2nd code not now, but after a while; 1st code delivers what you need; 2nd code delivers what you need + more



    pls feel free to ask whatever you wish / kindly

    Code:
    
    
        G50 S2000
    
    
        LVRF = 0      ( local variable restart flag )
    
    
        IF [  VRSTT EQ 0 ] NSKIP
              LVRF = +1
        NSKIP
    
    
        NN01 CALL OS01 ( operation 1 : brief )
        NN02 CALL OS02 ( operation 2 : brief )
        NN03 CALL OS03 ( operation 3 : brief )
        NN04 CALL OS04 ( operation 4 : brief )
    
    
        IF [  VRSTT NE 0 ] NJUMP
        IF [  LVRF  EQ 1 ] NJUMP
              V10 = V10 + 1
        NJUMP
    
    
    M02
    
    
    OS01
    
    
        G00 X400 Z(150)30
        T010101
        G97 S100 M03 M42 ( M08 )
        G00 X300 Z2.5
        G01      Z-10 ( F0.15 G95 ) F4500 G94
        G00 X400 Z(150)30
    
    
    RTS ( . . . . . . . . . . . . . . . . . . . . . . )
    
    
    OS02
    
    
        G00 X400 Z(150)30
        T020202
        G97 S100 M03 M42 ( M08 )
        G00 X300 Z2.5
        G01      Z-10 ( F0.15 G95 ) F4500 G94
        G00 X400 Z(150)30
    
    
    RTS ( . . . . . . . . . . . . . . . . . . . . . . )
    
    
    OS03
    
    
        G00 X400 Z(150)30
        T030303
        G97 S100 M03 M42 ( M08 )
        G00 X300 Z2.5
        G01      Z-10 ( F0.15 G95 ) F4500 G94
        G00 X400 Z(150)30
    
    
    RTS ( . . . . . . . . . . . . . . . . . . . . . . )
    
    
    OS04
    
    
        G00 X400 Z(150)30
        T040404
        G97 S100 M03 M42 ( M08 )
        G00 X300 Z2.5
        G01      Z-10 ( F0.15 G95 ) F4500 G94
        G00 X400 Z(150)30
    
    
    RTS ( . . . . . . . . . . . . . . . . . . . . . . )
    
    Code:
    
    
        G50 S2000
    
    
        LVRF = 0      ( local variable restart flag )
    
    
        IF [  VRSTT EQ 0 ] NSKIP
              LVRF = +1
        NSKIP
    
    
        NN01 CALL OS01 ( operation 1 : brief ) LINK = 01
        NN02 CALL OS02 ( operation 2 : brief ) LINK = 02
        NN03 CALL OS03 ( operation 3 : brief ) LINK = 03
        NN04 CALL OS04 ( operation 4 : brief ) LINK = 04
    
    
        IF [  VRSTT NE 0 ] NJUMP
        IF [  LVRF  EQ 1 ] NJUMP
              V10 = V10 + 1
        NJUMP
    
    
    M02
    
    
    OS01
    
    
        NGHOST
        IF [ VRSTT NE 0 ] NEND
    
    
        G00 X400 Z(150)30
        T+LINK*101
        G97 S100 M03 M42 ( M08 )
        G00 X300 Z2.5
        G01      Z-10 ( F0.15 G95 ) F4500 G94
    
    
        NEND
    
    
    RTS ( . . . . . . . . . . . . . . . . . . . . . . )
    
    
    OS02
    
    
        NGHOST
        IF [ VRSTT NE 0 ] NEND
    
    
        G00 X400 Z(150)30
        T+LINK*101
        G97 S100 M03 M42 ( M08 )
        G00 X300 Z2.5
        G01      Z-10 ( F0.15 G95 ) F4500 G94
    
    
        NEND
    
    
    RTS ( . . . . . . . . . . . . . . . . . . . . . . )
    
    
    OS03
    
    
        NGHOST
        IF [ VRSTT NE 0 ] NEND
    
    
        G00 X400 Z(150)30
        T+LINK*101
        G97 S100 M03 M42 ( M08 )
        G00 X300 Z2.5
        G01      Z-10 ( F0.15 G95 ) F4500 G94
    
    
        NEND
    
    
    RTS ( . . . . . . . . . . . . . . . . . . . . . . )
    
    
    OS04
    
    
        NGHOST
        IF [ VRSTT NE 0 ] NEND
    
    
        G00 X400 Z(150)30
        T+LINK*101
        G97 S100 M03 M42 ( M08 )
        G00 X300 Z2.5
        G01      Z-10 ( F0.15 G95 ) F4500 G94
    
    
        NEND
    
    
    RTS ( . . . . . . . . . . . . . . . . . . . . . . )
    


    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  20. #20
    Member
    Join Date
    May 2018
    Location
    United States
    Posts
    74
    Downloads
    0
    Uploads
    0

    Default Re: Part Count Help

    Thanks a lotI will try to test it today if there is no CMM jobs.
    Quote Originally Posted by deadlykitten View Post
    hi there are 2 codes in this post, which had been tested ; both codes count only in continous mode; counting is not executed in restart modethere are 4 operations, each one inside a soubroutine OS0*; each operation can be restarted by the address NN0*i recomand you the 1st code; don't use it unless you have no doubts about it2nd code has more optimisations ( involving the vrstt ), so to reduce the restart duration; requires more time to be understood; is ok if you use a single-safe-position for all your operations; it can be adapted for multiple-safe-positions; i recomand you to look over this 2nd code not now, but after a while; 1st code delivers what you need; 2nd code delivers what you need + more pls feel free to ask whatever you wish / kindly
    Code:
        G50 S2000    LVRF = 0      ( local variable restart flag )    IF [  VRSTT EQ 0 ] NSKIP          LVRF = +1    NSKIP    NN01 CALL OS01 ( operation 1 : brief )    NN02 CALL OS02 ( operation 2 : brief )    NN03 CALL OS03 ( operation 3 : brief )    NN04 CALL OS04 ( operation 4 : brief )    IF [  VRSTT NE 0 ] NJUMP    IF [  LVRF  EQ 1 ] NJUMP          V10 = V10 + 1    NJUMPM02OS01    G00 X400 Z(150)30    T010101    G97 S100 M03 M42 ( M08 )    G00 X300 Z2.5    G01      Z-10 ( F0.15 G95 ) F4500 G94    G00 X400 Z(150)30RTS ( . . . . . . . . . . . . . . . . . . . . . . )OS02    G00 X400 Z(150)30    T020202    G97 S100 M03 M42 ( M08 )    G00 X300 Z2.5    G01      Z-10 ( F0.15 G95 ) F4500 G94    G00 X400 Z(150)30RTS ( . . . . . . . . . . . . . . . . . . . . . . )OS03    G00 X400 Z(150)30    T030303    G97 S100 M03 M42 ( M08 )    G00 X300 Z2.5    G01      Z-10 ( F0.15 G95 ) F4500 G94    G00 X400 Z(150)30RTS ( . . . . . . . . . . . . . . . . . . . . . . )OS04    G00 X400 Z(150)30    T040404    G97 S100 M03 M42 ( M08 )    G00 X300 Z2.5    G01      Z-10 ( F0.15 G95 ) F4500 G94    G00 X400 Z(150)30RTS ( . . . . . . . . . . . . . . . . . . . . . . )
    Code:
        G50 S2000    LVRF = 0      ( local variable restart flag )    IF [  VRSTT EQ 0 ] NSKIP          LVRF = +1    NSKIP    NN01 CALL OS01 ( operation 1 : brief ) LINK = 01    NN02 CALL OS02 ( operation 2 : brief ) LINK = 02    NN03 CALL OS03 ( operation 3 : brief ) LINK = 03    NN04 CALL OS04 ( operation 4 : brief ) LINK = 04    IF [  VRSTT NE 0 ] NJUMP    IF [  LVRF  EQ 1 ] NJUMP          V10 = V10 + 1    NJUMPM02OS01    NGHOST    IF [ VRSTT NE 0 ] NEND    G00 X400 Z(150)30    T+LINK*101    G97 S100 M03 M42 ( M08 )    G00 X300 Z2.5    G01      Z-10 ( F0.15 G95 ) F4500 G94    NENDRTS ( . . . . . . . . . . . . . . . . . . . . . . )OS02    NGHOST    IF [ VRSTT NE 0 ] NEND    G00 X400 Z(150)30    T+LINK*101    G97 S100 M03 M42 ( M08 )    G00 X300 Z2.5    G01      Z-10 ( F0.15 G95 ) F4500 G94    NENDRTS ( . . . . . . . . . . . . . . . . . . . . . . )OS03    NGHOST    IF [ VRSTT NE 0 ] NEND    G00 X400 Z(150)30    T+LINK*101    G97 S100 M03 M42 ( M08 )    G00 X300 Z2.5    G01      Z-10 ( F0.15 G95 ) F4500 G94    NENDRTS ( . . . . . . . . . . . . . . . . . . . . . . )OS04    NGHOST    IF [ VRSTT NE 0 ] NEND    G00 X400 Z(150)30    T+LINK*101    G97 S100 M03 M42 ( M08 )    G00 X300 Z2.5    G01      Z-10 ( F0.15 G95 ) F4500 G94    NENDRTS ( . . . . . . . . . . . . . . . . . . . . . . )




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
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Part Count Help

Part Count Help