585,712 active members*
4,297 visitors online*
Register for free
Login
IndustryArena Forum > MetalWorking Machines > Okuma > please, help with local variables
Page 2 of 2 12
Results 21 to 30 of 30
  1. #21
    Join Date
    Jun 2015
    Posts
    4154

    Re: please, help with local variables

    hy teahole ! i just received some pretios infos, it seems that VDIN[1001] returns the duration in seconds since the cnc was turned on

    ... like there is a tick-tock timer which starts when machine starts

    of course, like you said, there may be other things related to VDIN[1001]; kindly !
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  2. #22
    Join Date
    Jun 2015
    Posts
    4154

    Re: please, help with local variables

    Quote Originally Posted by tea hole View Post
    Let me see if I can get a mill for a minute to create a demonstration of what i'm trying to explain here.

    There's a difference between reading a program and executing a program. NC operation doesn't count a complete part until you run a part WITHOUT machine lock on, for example.
    I'm not sure how to explain this without a machine to do it on, if I can think of a way to do it.
    hi i know that i am not in the position to rush you, but please, maybe you will share some better examples

    i am still curios about what you mean ... kindly !
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  3. #23
    Join Date
    Jun 2015
    Posts
    4154

    how to check if a local variable is "EMPTY" ?

    hello, please, how to check if a local variable is "EMPTY" ?

    for example, if a soubroutine requires a parameter, and if that parameter is not specified at the CALL statement, how to check if the parameter is missing ( inside the soubroutine ) ?


    the soubroutine from the shared code should perform well at block N1, and raise an error at block N2, because there is no LV01 at N2

    ... but in reality i receive an error the 1st time i call the soubroutine, at the line inside the soubroutine : "IF [ LV01 NE EMPTY ] NJUMP"

    lathe :
    ... images 1, 2
    ... seems like the controller considers EMPTY as a local variable, and gives an error because it has more than 4 chars

    mill :
    ... images 3, 4
    ... controller sais that the local variable used is not registered; i guess it is refering to EMPTY as being a not-registered local variable

    please, how to handle this case ? kindly

    Code:
    
        N1 CALL OS01 LV01 = 1
        N2 CALL OS01
    
    
        M02
    
    
    OS01
    
    
        IF [ LV01 NE EMPTY ] NJUMP
             NLOOP M0 ( missing parameter )
             GOTO NLOOP
        NJUMP LV01 = LV01 + 1
    
    
    RTS
    Attached Thumbnails Attached Thumbnails untitled.jpg   01.jpg   02.png   03.jpg  

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

  4. #24
    Join Date
    Jul 2010
    Posts
    287
    Quote Originally Posted by deadlykitten View Post
    hello, please, how to check if a local variable is "EMPTY" ?

    for example, if a soubroutine requires a parameter, and if that parameter is not specified at the CALL statement, how to check if the parameter is missing ( inside the soubroutine ) ?



    the soubroutine from the shared code should perform well at block N1, and raise an error at block N2, because there is no LV01 at N2

    ... but in reality i receive an error the 1st time i call the soubroutine, at the line inside the soubroutine : "IF [ LV01 NE EMPTY ] NJUMP"

    lathe :
    ... images 1, 2
    ... seems like the controller considers EMPTY as a local variable, and gives an error because it has more than 4 chars

    mill :
    ... images 3, 4
    ... controller sais that the local variable used is not registered; i guess it is refering to EMPTY as being a not-registered local variable

    please, how to handle this case ? kindly

    Code:
    
        N1 CALL OS01 LV01 = 1
        N2 CALL OS01
    
    
        M02
    
    
    OS01
    
    
        IF [ LV01 NE EMPTY ] NJUMP
             NLOOP M0 ( missing parameter )
             GOTO NLOOP
        NJUMP LV01 = LV01 + 1
    
    
    RTS
    Yes with an if statement you can check if a local variable exists.

    Ex:

    TIME=45

    IF TIME N1

    TIME=17

    N1
    v1=TIME
    M2

  5. #25
    Join Date
    Jun 2015
    Posts
    4154

    Re: please, help with local variables

    giiiiiiiiz, thx teahole !! it works ... nice, thank you !!!


    pls, i have some extra-questions :


    ... " IF TIME " checks if the variable "exists"; i need to check if the variable does "not exist", so to shorten the code something like " IF [ TIME EQ EMPTY ]" or like " IF NOT TIME "; unfortunately, those syntaxes do not work


    ... broby uses " IF [ PD EQ EMPTY ] NALM2 " inside a helix macro
    ... mr wizard said that adding P to a letter makes it readable; makes it readable where ?

    Code:
        CALL OSUB PD = 12
        M02
    
    OSUB
    
        V1 = D     ( does not work / error, etc )
        V1 = PD    ( works )
    
    RTS
    what exactly is behind these P* variables ? they are not local ... are they reseved only for macros ? also can be used P** / P*** / P**** like PA / PAB / PABC ?


    i know that there are some "extended adress chars" that should not be used : " PA PW PX PXD PXE PXF PZ PZD PZE PZF "
    what happens if someone uses one of them ? kindly
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  6. #26
    Join Date
    Jun 2015
    Posts
    4154

    Re: please, help with local variables

    please, how to destroy a local variable ?

    Code:
        NA1 LV01 = 55
        NA2 CALL OSUB
        NA3 V1   = LV01
        M02
    
    OSUB
    
        NB1 LV01 = LV01 + 1 ( LV01 will be 56 )
        NB2 LV01 = EMPTY / nill / kaput , vanish in space ...
        NB3 V1   = LV01
    
    RTS
    i wish to destroy the variable at block NB2, so at NB3 ( and at NA3 perhaps ) to have an error / kindly
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  7. #27
    Join Date
    Jun 2015
    Posts
    4154

    Re: please, help with local variables

    Quote Originally Posted by deadlykitten View Post
    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
    Quote Originally Posted by Superman View Post
    You probably saw the list for "Reserved Local Variables" in the appendix section of the programming manual ( last section most likely )
    hey ( mr ) superman ( sir marvel ), what's up ? i found it :

    lathe :
    ... #20.5, or para\easy op\local variable display ( image 1 )
    ... a local variable table, with names and values will appear ( image 2 )
    ... there isn't a lot of infos inside lathe manuals about this

    mill :
    ... there is some infos about this inside the operation manual ( image 3 ) wtf was i doing 2 years ago at that random page ?
    ... to activate it, press pg_up/down in the area shown in image 4

    this option helps debugging subroutines; fog is gone / kindly
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  8. #28
    Join Date
    Jun 2015
    Posts
    4154

    Re: please, help with local variables

    hello all, about the local variable table, shared in previous post, i don't use it ...

    when i discovered it, i thought that it is really interesting, but now, actually is slow, for me, when it comes to debugging subroutines

    using that table requires to run the subroutine in step-by-step, and inspecting each value as the execution evolves

    i use "write" function to create a file with local variables, and all "write" functions are inside a conditional code, thus i can toggle them to be used or not; if i don't need to inspect the values, i turn it off, so to avoid cycle downtime

    inside that file i can see all the values at once; sometimes i open several such files, and i simply alt+tab between them, so to visualy locate fast the values that changed ( if you wish, check attached )

    this helps to create a larger view, when developing subroutines that are too complex too follow

    well, just saying / kindly
    Attached Thumbnails Attached Thumbnails 01.jpg   02.jpg  
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  9. #29
    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

  10. #30
    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
    please check attached
    Attached Thumbnails Attached Thumbnails Untitled.png  
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

Page 2 of 2 12

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
  •