Problem Macro help please


Results 1 to 2 of 2

Thread: Macro help please

  1. #1
    *Registered User* Machine_just_went_crazy's Avatar
    Join Date
    Jun 2018
    Posts
    4
    Downloads
    0
    Uploads
    0

    Default Macro help please

    Our shop recently got 2 okuma 300series genos lathes. 1 is a l300m the other is a l300m-e. I am currently working on a main/sub program combo to do all the basic stuff to help take the load off of our very overworked mastercam programmer like I have done on the Haas lathes. Most of the fanuc b stuff can move over very easy it seems so far. I just have a couple of syntax questions. Can I combine an IF statement with a CALL? I.E "IF [V1 EQ 1] CALL OTHRD also Can I pass variables this way I.E. IF [V1 EQ 1] CALL OTHRD TPI=18 ZSTRT=0 ZEND=.735 so on? I am writing this as boolean 0= Off 1=ON type of program. This is so we can only turn on what we need on our more basic stuff. Thanks for any help in advance

    Similar Threads:


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

    Default Re: Macro help please

    hi classical available syntaxes are " IF [ V1 EQ 1 ] N1 " or " IF [ V1 EQ 1 ] GOTO N1 " ; is not possible to combine IF + CALL

    if you wish, check this out : https://www.cnczone.com/forums/okuma/304038-syntax.html

    try this :

    Code:
        IF [ V1 NE 1 ] NJUMP
             CALL OTHRD TPI = 18 ZSTRT = 0 ZEND = 0.735
        NJUMP
    
    or use brakets, so to avoid executing that operation " ( CALL OTHRD TPI = 18 ZSTRT = 0 ZEND = 0.735 ) "
    
    or use "block skip" : " / CALL OTHRD TPI = 18 ZSTRT = 0 ZEND = 0.735 "
    
    
    * there are other methods



    you may use also local variables to generate boolean behaviour; for example these 2 statements will both work : " CALL OSUB " and " CALL OSUB LV01 = whatever "

    Code:
    OSUB
    
        ...
        IF LV01 N1 ( check if local variable exists )
        ...
    
    RTS




    IF [ V1 EQ 1 ] CALL OTHRD
    why using "if" to call a threading operation ?

    ZSTRT=0
    where is the clearance ? also, use max 4 chars ...

    I am writing this as boolean 0= Off 1=ON type of program
    are you sure that is ok to use a boolean behaviour for a threading operation ?

    This is so we can only turn on what we need on our more basic stuff
    code versatility is a good thing to do; if you can describe more what you are after, i may suggest an approach

    sometimes i also have to enable / disable some operations, and i try to do it as fast as possible, thus with minimal edit time and with minimal code length

    at this moment, i don't know what you are after

    put some soubroutines on the machine, and teach the operators how to edit & run them; in the end, you wish for them to edit the parameters and create a chain of operations, and not to enable/disable individual operations, listed inside a rigid code

    I am currently working on a main/sub program combo to do all the basic stuff to help take the load off of our very overworked mastercam programmer
    lack of optimization ( including macros and cnc panel programers : conversational / g-code, etc ) will definitely lead to cam overwork : there are things that a cam can't deliver, or are requiring to much time to be generated by a cam; this may lead to downtime and more employees / cnc

    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 ...


  3. #3
    *Registered User* Machine_just_went_crazy's Avatar
    Join Date
    Jun 2018
    Posts
    4
    Downloads
    0
    Uploads
    0

    Default Re: Macro help please

    Thanks I have since discovered the NJUMP function and was thinking it would work. What I am doing is setting up a main program to select different operations to use on most of our basic stuff. What I am thinking is using common variables instead. It will work something like this.

    (0=OFF 1=ON)
    V1=1(Face)
    V2=0( STRAIGHT TURN OD)
    V3=1(TURN OD 90DEG SHOULDER)

    That would continue assigning variable to different operations I need to perform. I guess it would be more binary than Boolean. after all my variables are assigned I would decide what needs to be turned on for whatever particular part I am cutting. Thats where the CALL comes in.

    IF [V1EQ1] NJUMP
    CALL OFCE
    NJUMP
    The threading sub was just an generic example I should have been more specific. I know the OKUMA controller can do more so I fully expect to modify this program over time as I learn more about it. I am coming from fanuc/haas/winmax and semiens controller background. I have not messed with OKUMA in about 15 years and back then I did straight panel programming only.



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

    Default Re: Macro help please

    hi, even if you use a 0/1 value to toogle on/off some operations, you still need to edit the parameters of those operations

    editing the parameters, so to customize the operation, is a critical thing so focus only on it; that toogling behaviour is not needed

    create a file for each parametric operation : face.ssb, thread.ssb, drill.ssb, or join all those files inside a single one : operations.ssb

    now create the main program

    Code:
     
        CALL OFACE some parameters
        CALL ODRIL tool rpm feed clearance bottom_delay peck retreat ( set 1 )
        CALL ODRIL tool rpm feed clearance bottom_delay peck retreat ( set 2 )
        CALL OD ( od turning )
        CALL OTHRD
     
    what osp are you using ? what operations do you wish to parameterize ?

    i have some parametric operations, and, if you wish, i may share them and help you to create some

    I have since discovered the NJUMP function
    njump is not a function, but a block address; depending on your control generation, you may use max N+4 chars ( eq N1 NIF NEND N1234 ) or N+5 chars ( eq NOKUMA NWHILE NSTART NKITTY )

    IF [V1EQ1] NJUMP
    CALL OFCE
    NJUMP
    try this instead ( it should execute faster ) :
    Code:
     
        IF [ V1 EQ 1 ] NJUMP
             CALL OFCE
        NJUMP NOEX
     
    
    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 ...


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

Macro help please

Macro help please