586,075 active members*
4,018 visitors online*
Register for free
Login
IndustryArena Forum > MetalWorking Machines > Okuma > please, help with local variables
Results 1 to 20 of 30

Hybrid View

  1. #1
    Join Date
    Jun 2015
    Posts
    4154

    please, help with local variables

    hello, there is a program, delivering different result on mill vs lathe .

    please, is there a way to make machines behave the same ? kindly !

    Code:
    [lathe]
    DIA1=10
    DIA2=20
    
    
    CALL OS02
    
    
    V3=DIA1
    V4=DIA2
    
    
    M02
    
    
    OS02
    
    
    DIA1=100
    DIA2=200
    
    
    V1=DIA1
    V2=DIA2
    
    
    RTS
    
    
     ( V1=100 )
     ( V2=200 )
     ( V3=100 )
     ( V4=200 )
    Code:
    [ mill ]
    DIA1=10
    DIA2=20
    
    
    CALL OS02
    
    
    VC3=DIA1
    VC4=DIA2
    
    
    M02
    
    
    OS02
    
    
    DIA1=100
    DIA2=200
    
    
    VC1=DIA1
    VC2=DIA2
    
    
    RTS
    
    
     ( V1=100 )
     ( V2=200 )
     ( V3=10  )
     ( V4=20  )
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  2. #2
    Join Date
    Jun 2015
    Posts
    4154

    Re: please, help with local variables

    can i use global variables on mill, as on lathe ?
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  3. #3
    Join Date
    Jun 2015
    Posts
    4154

    Re: please, help with local variables

    Code:
    LV = 100
    CALL OSUB
    VC1 = LV
    M02
    
     ( . . . . . . . . . . . )
    
    OSUB
        LV = LV + 1
    RTS
    when a local variable(=lv) is created before the CALL OSUB, and is edited inside the OSUB :
    ... lathes pass the "new value" to the lv, thus VC1 will be 101
    ... mills do not, thus VC1 will be 100

    question is which case is correct ? if you ask me, i would say the lathe, but there is no example inside the manuals to sustain mill or lathe behaviour. lv's are presented differently in mill and lathe manual.

    all examples from manuals are like a "lv" may be passes from the main to the sub, and again to other sub, but there is nothing about "coming back"

    by "coming back" i mean to perform some calculations inside a soubrutine, and after to pass the final result back to main program

    since i can not do it by using a local variable, i used instead other variable type, as shown in previous post, but still, this behaviour of local variables makes things safer for a "single way" usage, so only when passing arguments/values futher, to another soubrutine; there is no feedback ...
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  4. #4
    Join Date
    Jun 2015
    Posts
    4154

    Re: please, help with local variables

    hello, is it possible to visualize what local variables are registered, and with what values ?

    something like a "local variables list" ? kindly !
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  5. #5
    Join Date
    Aug 2011
    Posts
    419

    Re: please, help with local variables

    Quote Originally Posted by deadlykitten View Post
    hello, is it possible to visualize what local variables are registered, and with what values ?

    something like a "local variables list" ? kindly !
    I think it is not possible.
    "Imagination is more important than knowledge."

  6. #6
    Join Date
    Dec 2008
    Posts
    3109

    Re: please, help with local variables

    Quote Originally Posted by deadlykitten View Post
    hello, is it possible to visualize what local variables are registered, and with what values ?

    something like a "local variables list" ? kindly !
    You need to parse them back to the "user variables"
    ie VC1=lv
    then look at the "user variable" page

    Basically, you tend to only use the user variables ( V# or VC# ) for the reason that it is easier to trace faults

  7. #7
    Join Date
    Jun 2015
    Posts
    4154

    Re: please, help with local variables

    hello this days, while i was searching for something, i saw a table with local variables, like a printscreen from the cnc monitor ... i can not find that page again, and i wonder what was it about
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  8. #8
    Join Date
    Jun 2008
    Posts
    372

    Re: please, help with local variables

    Lathe is V100 mill is VC100

  9. #9
    Join Date
    Jun 2015
    Posts
    4154

    Re: please, help with local variables

    Lathe is V100 mill is VC100
    hy, this thread is about local variables, not common variables, like the ones from your post if you wish, please check attached file ...
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  10. #10
    Join Date
    Jul 2010
    Posts
    287

    Re: please, help with local variables

    Quote Originally Posted by budgieW View Post
    Lathe is V100 mill is VC100
    You can also use:
    Mill: VC[100]
    or
    Lathe: VC[100]

    The lathe iteration is the correct result, but you are having read ahead issues.
    Run the mill in single block, check your result. I'd wager it'd match the lathe.

    Add:
    TIME=VDIN[1001]

    As the first line in the mill sub program OS02

    Advise

  11. #11
    Join Date
    Jun 2015
    Posts
    4154

    Re: please, help with local variables

    hy teahole

    You can also use: Mill: VC[100] or Lathe: VC[100]
    ok ?!

    The lathe iteration is the correct result, but you are having read ahead issues
    so the lathe is slower on read ahead ? after latest trials, i can say that "lathe team" is delivering better stuff than "mill team"

    Run the mill in single block, check your result. I'd wager it'd match the lathe
    i will compare read ahead on bought cnc's, and also i will run the mill in single-block; if you are right, than i will .....

    TIME=VDIN[1001]
    you really have some stile with variables what does this one ? kindly !
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  12. #12
    Join Date
    Jun 2015
    Posts
    4154

    Re: please, help with local variables

    Mill: VC[100] or Lathe: VC[100]
    hy, VC[...] works on bought; also, i scanned my lathe documents, and there is no information about this; only a reference about "VC1" from where do you have all this tricks ? well, this one is not so huge, but still ....

    The lathe iteration is the correct result
    maybe the mill is the correct result ? i run the mill like this :
    ... single block
    ... buffer off
    ... TIME=VDIN[1001], but nothing changed ...

    on "single block", i had to press green button only 2..3 times to run the program, and thus, machine did not stop at each line; i think it is looking for a G code, and if there is nothing, than it jumps over more than 1 line

    however, thx for your suggestions
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  13. #13
    Join Date
    Jul 2010
    Posts
    287

    Re: please, help with local variables

    Quote Originally Posted by deadlykitten View Post
    hy, VC[...] works on bought; also, i scanned my lathe documents, and there is no information about this; only a reference about "VC1" from where do you have all this tricks ? well, this one is not so huge, but still ....

    maybe the mill is the correct result ? i run the mill like this :
    ... single block
    ... buffer off
    ... TIME=VDIN[1001], but nothing changed ...

    on "single block", i had to press green button only 2..3 times to run the program, and thus, machine did not stop at each line; i think it is looking for a G code, and if there is nothing, than it jumps over more than 1 line

    however, thx for your suggestions
    First, scanning your documents will not yield you what you're looking for. Most of my tidbits came from deep reading into manuals, old and new. It's amazing how much stuff existed on the old controls that never got used because nobody knew how/why you would and are detailed in older manuals, but not in newer ones. Usually i'm searching for a solution to some problem i'm having, and read about something and think: "that may be damn useful someday. I'll write it down". Then i write it down, what it does and keep an active running list. That's where i discovered how to do things like read current position on a mill in reference to current work offset, not machine position. How to reset mill common variables to "empty". How to do most of the things I now do without thinking that save a boat load of time. Can I get a hell yeah yee haw for same t call as current is made alarm D?

    Second, regarding the VDIN[1001], it was something that was given to me by an Okuma engineer some months ago. It will not stop on every line in single block with nothing but variables and as a result the program will keep reading them until it finds something else. TIME is setting a local variable to be named "TIME", and you're setting the value to VDIN[24]. Whatever that is at that moment. Id wager the addition of a G code would be correct. However, as another solution, to prove the lathe is correct or the mill is, add an M331 to the lathe before and after the CALL statement. Then, add, and I forget the exact number needed, so we'll guess high, 20 lines that read: G4F.01 before and after the call statement. I think if you were to add the VDIN[1001] with a single G4 it may do the same, but i don't have a mill available for quite a while to do any testing on myself. Sorry.

    As for "lathe team" vs "mill team", i disagree entirely.
    Frankly, I need a lathe and mill to do different things.
    I think the mills need to look ahead further and faster especially for things like HI-CUT PRO to work. It's following a shape, so there are thousands of little lines making that shape. NURBS if you will.
    On a lathe, typically you have a shape being cut, but one line may take 14 seconds to cut. Or more. So I may not want it to read ahead so far, so fast.

    But which ever.

    Lastly:
    VC[1]=3
    VC[VC1]=6
    Will yield values of 3 and 6 in V1, AND V3 respectively.
    In a mill it does the same thing for VC1 AND VC3.
    Makes it easier to use lathe and mill macros across the 2 controls. Been around for a long time. Nobody uses it.

  14. #14
    Join Date
    Jun 2015
    Posts
    4154

    Re: please, help with local variables

    hy teahole glad to see you ... please, i did not get it :

    It will not stop on every line in single block with nothing but variables and as a result the program will keep reading them until it finds something else >so by using "TIME=VDIN[1001]", than when running in single block machine will stop only on lines with variables ? and if this is true, than what is the purpose for this ?

    TIME is setting a local variable to be named "TIME", and you're setting the value to VDIN[24] > i am lost ... so lost : so a local variable may be initialized with VDIN[1001], and that local variable may be called TIME or LV01 ? and what happens next with the local variable ? this variable stores a value = VDIN[1001], but why does it store it, and for how long ?

    Id wager the addition of a G code would be correct > why would i add a G code ? when i input "TIME=VDIN[1001]", machine was jumping more than a "single line" in "single block", and i just supposed that it was looking for some G codes

    However, as another solution, to prove the lathe is correct or the mill is, add an M331 to the lathe before and after the CALL statement. Then, add, and I forget the exact number needed, so we'll guess high, 20 lines that read: G4F.01 before and after the call statement. I think if you were to add the VDIN[1001] with a single G4 it may do the same > so using "TIME=VDIN[1001]" has the same effect like :

    Code:
    M331
    CALL Oxyz
    M331
    G04 F 0.01 ( ~20 times ? )
    and the "effect" is ? you mean to delay the buffer ? to avoid the "read ahead" ? i remember you said this before here : http://www.cnczone.com/forums/okuma/...tructures.html

    i have allready disabled the "buffer reading" from machine parameters, and nothing changed ... thus, why would i try other techniques to disable "buffer / read ahead" ?
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  15. #15
    Join Date
    Jun 2015
    Posts
    4154

    Re: please, help with local variables

    Quote Originally Posted by tea hole View Post
    As for "lathe team" vs "mill team", i disagree entirely. Frankly ... So I may not want it to read ahead so far, so fast.
    i agree with you / when i said something about "lathe team" and "mill team" i was not reffering only to the situation described in this thread ( sorry for the confusion )

    in recent threads had been discussed some differences, more or less important, but is obvious that this differences exist and "lathe guys" should talk more with "mill girls"

    a major difference, for example. that i wrote in last post here : http://www.cnczone.com/forums/okuma/...tor-stuff.html, is that mill reaction time on "load monitor" is slow compared to lathe

    i think it would be a good idea to open a thread only for differences between these teams
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  16. #16
    Join Date
    Jun 2015
    Posts
    4154

    Re: please, help with local variables

    First, scanning your documents will not yield you what you're looking for
    i totally agree : this is way i don't read manuals when i search something, i select "inside files search" and choose all lathe or mill manuals, so i can scan pretty fast through all documentation with 1 click

    Most of my tidbits came from deep reading into manuals, old and new. It's amazing how much stuff existed on the old controls that never got used because nobody knew how/why you would and are detailed in older manuals, but not in newer ones. Usually i'm searching for a solution to some problem i'm having, and read about something and think: "that may be damn useful someday. I'll write it down"
    you know, one of us should RTFM yeah, i know, i know ...

    Then i write it down, what it does and keep an active running list.
    i have 3 main lists :
    ... one with issues about parts that i must craft
    ... one with Okuma cnc's issues
    ... one with issues about a more organized shop

    i need a programmer to handle 1st and 2nd lists, so i would focus on 3rd

    That's where i discovered ... how to reset mill common variables to "empty"..
    i have never reset a variable in this way; at this moment i don't even know why i would do so ...

    Can I get a hell yeah yee haw for same t call as current is made alarm D?
    i don't know what a D alarm does, but i can say that i handle this case with my tool change procedure : http://www.cnczone.com/forums/okuma/316654-forum.html

    ps : if you listen, you will hear me cheering for this / if you''ll keep it this way, you will get ( soon ) another Nobel prize



    .
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  17. #17
    Join Date
    Jun 2015
    Posts
    4154

    Re: please, help with local variables

    Quote Originally Posted by tea hole View Post
    You can also use:
    Mill: VC[100]
    or
    Lathe: VC[100]
    hy teahole i had some simple counting variables V1=V1+1, and V2=V2+2, and i just remembered your post, so i finally wrote it like this :

    Code:
    OPP
    
     VC [ LV04 ] = VC [ LV04 ] + 1
    
    RTS
    so i increment those by CALL OPP LV04 =argument

    Makes it easier to use lathe and mill macros across the 2 controls. Been around for a long time. Nobody uses it.
    please, what type of macros / procedures do you use ? particular for a cnc or across ?

    i mean, if u have time, please ? i will create a thread about this; thank you
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  18. #18
    Join Date
    Jun 2015
    Posts
    4154

    Re: please, help with local variables

    Can I get a hell yeah yee haw for same t call as current is made alarm D?
    hey teahole, how did you do this ? pleasssssssse .... yes, i realized that this is cool only a few seconds ago

    can you remap alarm's type ? can you help me with this : https://www.cnczone.com/forums/okuma/377282-cnc.html ? if i only could remap the alarm for G22, i guess i could deliver adaptive drilling / kindly
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

Similar Threads

  1. Local variables
    By underthetire in forum Haas Mills
    Replies: 3
    Last Post: 07-02-2012, 09:36 PM
  2. Local Variables?
    By TURNER in forum NCPlot G-Code editor / backplotter
    Replies: 2
    Last Post: 03-03-2008, 01:25 PM
  3. local variables of a macro
    By sinha_nsit in forum Fanuc
    Replies: 8
    Last Post: 01-16-2008, 01:19 PM
  4. Local variables
    By jorgehrr in forum G-Code Programing
    Replies: 4
    Last Post: 02-19-2007, 10:03 PM
  5. G65 local variables help
    By FanukRC in forum G-Code Programing
    Replies: 7
    Last Post: 07-26-2006, 12:00 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
  •