585,556 active members*
3,588 visitors online*
Register for free
Login
IndustryArena Forum > MetalWorking Machines > Okuma > simplifying call statements with variables
Results 1 to 12 of 12
  1. #1
    Join Date
    Jun 2015
    Posts
    4154

    simplifying call statements with variables

    [ CALL Oname ] + [ [ V1 =... V2 =... ] or [ LV01=... LV02=... ], etc ]

    in some/most cases, a chain of variables may be reduced to only one

    instead of V1=25 V2=1, may be used V1=251 or V1=2501 or V1=025001

    the effect is a more aerated code; simplistic ; yet complicated

    the soubroutine should extract each variable

    the extraction proces should be tested to compute fast, thus to don't input dead times

    i will be back with examples for this ; it just hit me few seconds ago
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  2. #2
    Join Date
    Jun 2015
    Posts
    4154

    Re: simplifying call statements with variables

    done please consider V1 = 2015638 as combining 3 numbers 201 & 56 & 38

    extraction process will output :

    Code:
        V2 = 38
        V2 = 56
        V2 = 201
    extracting them by using the folowing call statement, where i specify in V2 how many digits i wish to extract, will require ~0.40 seconds / extraction

    Code:
        CALL OEXTR V2 = 2
        CALL OEXTR V2 = 2
        CALL OEXTR V2 = 3
    extraction time may be reduced by optimizations to ~0.15 seconds, thus less system load
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  3. #3
    Join Date
    Jun 2015
    Posts
    4154

    Re: simplifying call statements with variables

    this code extracts 201 & 56 & 38 from V1 = 2015638, and is looped 50 times, with a data stamp before and after the loop, so to compute time / extraction

    this extraction procedure requires 0.40 seconds as it is, or 0.74 when data is written to the hdd

    Code:
     
        CALL OSTRT
    
        V3 = 0
        NHERE
            V3 = V3 + 1
            CALL OMAIN
        IF [ V3 LT 50 ] NHERE
    
        CALL OEND
    
    M02
    
     ( . . . . . . . . . . . . . . . . . . . . . . )
    
    OMAIN
    
        V1 = 2015638
        V2 = 0
    
      ( * )
    
        CALL ODATA
    
        CALL OEXTR V2 = 2
        CALL OEXTR V2 = 2
        CALL OEXTR V2 = 3
    
    RTS
    
     ( . . . . . . . . . . . . . . . . . . . . . . )
    
    OEXTR
    
        LV01 = 0
        LV02 = 1
        NHERE
            LV01 = LV01 + 1
            LV02 = LV02 * 10
        IF [ LV01 LT V2 ] NHERE
    
        V2 = MOD [ V1 , LV02 ]
        V1 = [ V1 - V2 ] / LV02
        V1 = DROUND [ V1 ]
        V1 = FIX [ V1 ]
    
        CALL ODATA
    
    RTS
    
     ( . . . . . . . . . . . . . . . . . . . . . . )
    
    ODATA
    
        PUT '    '
        PUT 'V1'
        PUT '    '
        PUT V1
        PUT '    '
        PUT 'V2'
        PUT '    '
        PUT V2
    
        WRITE C
    
    RTS
    
     ( . . . . . . . . . . . . . . . . . . . . . . )
    
    OSTRT
    
        FWRITC data.txt;A
        CALL OSTMP
    
    RTS
    
     ( . . . . . . . . . . . . . . . . . . . . . . )
    
    OEND
    
        CALL OSTMP
        CLOSE C
    
    RTS
    
     ( . . . . . . . . . . . . . . . . . . . . . . )
    
    OSTMP
    
        CALL OTIME
        WRITE C
    
    RTS
    
     ( . . . . . . . . . . . . . . . . . . . . . . )
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  4. #4
    Join Date
    Jun 2015
    Posts
    4154

    Re: simplifying call statements with variables

    example of call statements simplifying, starting with this thread : http://www.cnczone.com/forums/okuma/...ock-codes.html

    original :
    Code:
    from outside, is all quiet; this are the lines from a program that goes automatically, in a loop:
    ... CALL OPNL LV01=0 LV02=0 LV03=1 ( W @ safe before begining )
    ... CALL OPNL LV01=1 LV02=0 LV03=1 ( W comes after the 3rd operation )
    ... CALL OPNL LV01=0 LV02=1 LV03=1 ( W @ safe after almost cutting the part; turret does not go X_max )
    
    when the program is finished, i send the tailstock to W_max, because i put the bar inside from the chuck, not from the back of the cnc
    ... CALL OPNL LV01=0 LV02=0 LV03=3 ( W @ safe position from line 3 )
    simplified
    Code:
    from outside, is all quiet; this are the lines from a program that goes automatically, in a loop:
    ... CALL OPNL LV01 = 001 ( W @ safe before begining )
    ... CALL OPNL LV01 = 101 ( W comes after the 3rd operation )
    ... CALL OPNL LV01 = 011 ( W @ safe after almost cutting the part; turret does not go X_max )
    
    when the program is finished, i send the tailstock to W_max, because i put the bar inside from the chuck, not from the back of the cnc
    ... CALL OPNL LV01 = 003 ( W @ safe position from line 3 )
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  5. #5
    Join Date
    Jun 2015
    Posts
    4154

    Re: simplifying call statements with variables

    example of other simplifications, with procedure shared anytime, if requested

    Code:
        V21 = 0101       (   0 )
        V22 = 0110       ( 180 )
        V23 = 1011       ( 270 )
        V24 = 1110       (  90 )
    each variable manages holes in a line, at a specific angle

    think of a cilinder, with 4 holes / section, and 4 such sections, thus 16 holes / clamp, so to say; or consider 4 holes in a line, and this operation repetead at different C axis values

    nice part in this story is that on real setup were 6 holes in a line, and holes were not on same section this procedure is only for restart sequence

    V21 = 0101 means that only 2nd and 4th holes will be cut
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  6. #6
    Join Date
    Jun 2015
    Posts
    4154

    Re: simplifying call statements with variables

    i also work on an enhanced parts counter, starting from this thread http://www.cnczone.com/forums/okuma/...variables.html

    that was how i discovered cnc zone, and at that moment codes from "YoDoug" seemed alien to me

    i started developing this after a chat with "tea hole" in this thread http://www.cnczone.com/forums/okuma/...-sequence.html

    i can say that some procedures i wrote because of seing other people asking about solutions ..

    consider a preview in attached image, where :
    ... each chart represent an individual operation
    ... top chart is overall part / cycle duration
    ... t represent duration variation
    ... cv is a statistical value https://en.wikipedia.org/wiki/Coefficient_of_variation

    once such data is exported from the cnc, is easy to see how stable a process is i still work on the "export" part, and i will share it when it will be ready

    where is the optimization in this ? starting from this thread, by combining more variables in a single one, i thought of futher data "compressing" methods so to say, to reduce system load, by minimizing call to procedures that write data to the hdd ... i hope to share this soon

    i had some conversation about manual resetting common variables values when counting parts, which i was and still am against; i consider that operators / process control can be wiser, thus less invasive is not like i am on the operators side, so to say, or on anyother side ... what i do is only technical, and you can never know were life will take you, so maybe tomorow i will be just an operator knowing that i can do stuff better, but if i say so i will be fired all the best
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  7. #7
    Join Date
    Jun 2015
    Posts
    4154

    Re: simplifying call statements with variables

    Quote Originally Posted by deadlykitten View Post
    this code extracts 201 & 56 & 38 from V1 = 2015638, and is looped 50 times, with a data stamp before and after the loop, so to compute time / extraction

    this extraction procedure requires 0.40 seconds as it is, or 0.74 when data is written to the hdd
    code from post #3 has been updated: requires only 0.00027sec/extraction, thus minimal impact into cycle time

    i have inserted this into the tailstock soubroutine, so to call it just like how is shown at post #4

    how the syntax uses only 3 digits, extraction time is even more reduced : 0.000185sec/extraction

    kindly

    Code:
    
              NOEX V10 = VDIN [ 1000 ]
              NOEX V3 = 0
        NHERE NOEX V3 = V3 + 1
              CALL OSUB
        IF [ V3 LT 1000 ] NHERE
              NOEX V10 = VDIN [ 1000 ] - V10
    
    
     ( 824 818 825 829 820 > 0.00082sec/cycle > 0.00027sec/extraction )
    
    
    M02 ( . . . . . . . . . . . . . . . . . . . . . . )
    
    
    OSUB
    
    
        NOEX V1 = 2015638
        NOEX V2 = 0
    
    
      ( * )
    
    
        CALL OEXTR V2 = 2
         NOEX V4 = V2
        CALL OEXTR V2 = 2
         NOEX V5 = V2
        CALL OEXTR V2 = 3
         NOEX V6 = V2
    
    
    RTS ( . . . . . . . . . . . . . . . . . . . . . . )
    
    
    OEXTR
    
    
              NOEX LV01 = 0
              NOEX LV02 = 1
        NHERE NOEX LV01 = LV01 + 1
              NOEX LV02 = LV02 * 10
        IF [ LV01 LT V2 ] NHERE
    
    
        NOEX V2 = MOD [ V1 , LV02 ]
        NOEX V1 = [ V1 - V2 ] / LV02
        NOEX V1 = DROUND [ V1 ]
        NOEX V1 = FIX    [ V1 ]
    
    
    RTS ( . . . . . . . . . . . . . . . . . . . . . . )
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  8. #8
    Join Date
    Apr 2006
    Posts
    822

    Re: simplifying call statements with variables

    At the rate you are going, you will be needing to work for years to pay back the resulting development time in time saved on the machine.
    Sometimes just setting a value is all that is required.
    Set and move on...

  9. #9
    Join Date
    Jun 2015
    Posts
    4154

    Re: simplifying call statements with variables

    hi, for this instance, you are right

    but there are the allready running soubroutines, that simply are there all the time :
    ... most important time gain comes from the dynamic indexing, which is always there time between 2 tools is drastically reduced
    ... most important safety feeling comes from :
    ...... offset value checking, which stops the machine in case of a wrong input ( saved me many times, especially when unexperienced operators are there ) this is my CAS equivalent : it takes a while to setup, but not as long as setting the normal CAS
    ...... alternative load monitor codes + active background load monitor, which limits the efforts to 80% ( saved me allready 3 times : a drill broke, and the id threading insert stopped without a scracth )

    what i do targets 3 zones of time scale :
    ... seconds ( like cutting specs management, and setup statistics, etc )
    ... tens of a second ( like CTR + improved soubroutines, that are better than machine default cycles )
    ... hundres or less ( code optimizations, just like this example ) : these last ones i do because i like to do them, but i am aware of the paypack

    recently, after the NOEX trials, many soubroutines started to perfom even faster : going from tens to hundreds, or however, signifiantly lower execution time

    only these add-on, goes into the tailstock soubroutine, which shaves 1.5 seconds at each M56+M55

    so yes, you are right, but there is a bigger picture in which i see all these connected
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  10. #10
    Join Date
    Jun 2015
    Posts
    4154

    Re: simplifying call statements with variables

    hey broby, i just remembered one thing : when using low clerances + dinamic indexing soubroutine + turret posts close to each other + specific offset values : the cutting begins right after the turret is clamping

    there is a sound like bang + vvvvvvvv ( turret clamping + cutting begins )

    this happens with turret rotation speed at 60% and the production key on rapids 25%

    it happened yesterday, while i was crafting a zero-series of a simple part x 20 bucs; there is a bit of instability when the cutting begins, but that happened during a roughing operation, so is ok ; check attached part : does it deserve special treatment? it does not even need a techincal drawing; quick indexing codes ( and others ) are default

    i don't wanna leave the impression that i focus a lot at a tiny scale ... no; tiny scale i do only because i can my goal is fast & stable setups

    just saing, that's all
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  11. #11
    Join Date
    Jun 2015
    Posts
    4154

    Re: simplifying call statements with variables

    Quote Originally Posted by deadlykitten View Post
    hey broby, i just remembered one thing : when using low clerances + dinamic indexing soubroutine + turret posts close to each other + specific offset values : the cutting begins right after the turret is clamping
    hello again broby, my previous post was about a particular case, during which my soubroutine for dynamic indexing delivered a really short indexing, where the tool got really closed to the part, thus the approach movement was drastically reduced


    a while after i posted that, i thought of why should i just sit and wait for such a particular case to happen, instead of coding it ?

    so, it took me some time, some trials ( done after my shift ended, during weekend, etc ), i blast-off 2 carbide drills + 2 inserts .... and i have succeded : since than i have delivered 2 setups with real-close indexing behaviour, without setup time at the cnc panel; i can deliver a ' point blank shot ' : 1.25mm


    it all started since your last post in this thread, so i guess i should say thank you somehow, because of you, i got the idea ...
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  12. #12
    Join Date
    Jun 2015
    Posts
    4154

    Re: simplifying call statements with variables

    Quote Originally Posted by broby View Post
    At the rate you are going, you will be needing to work for years to pay back the resulting development time in time saved on the machine.
    Sometimes just setting a value is all that is required.
    Set and move on...
    depends what you are after ... how many hours do some machinist spend to develop some custom codes ?

    sometimes reading a manual page which is translated in a really messed up manner, requires time to be understood ... does it matter ?

    recently i shaved a lot of time from a cycle time, comparing to a CAM alternative which used higher cutting specs, but it was not optimized; and it does not matter, because no one arround here understoods what i have done

    your words are still hanging somewhere in my head, and there is a bit of truth inside them, but i won't quit developing stuff; i wish to achieve a certain level ...

    Quote Originally Posted by deadlykitten View Post
    so, it took me some time, some trials ... i can deliver a ' point blank shot ' : 1.25mm
    since then i developed my code ... turret is driving in circles arround the part i will share this soon ...
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

Similar Threads

  1. if statements...
    By deadlykitten in forum Okuma
    Replies: 10
    Last Post: 11-07-2015, 01:46 AM
  2. Okuma OSP-100M subprogram call and variables
    By MoriSeikiNoob in forum Okuma
    Replies: 3
    Last Post: 10-23-2015, 02:35 PM
  3. Help simplifying a Dyna Myte 4400
    By Shea al'Thor in forum Knee Vertical Mills
    Replies: 4
    Last Post: 09-17-2011, 03:56 PM
  4. The Cartesian Robotics System: Simplifying Automation Control
    By Pacific Bearing in forum News Announcements
    Replies: 0
    Last Post: 02-23-2010, 10:16 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
  •