work shift program


Results 1 to 15 of 15

Thread: work shift program

  1. #1
    Member
    Join Date
    Jan 2010
    Location
    Norway
    Posts
    171
    Downloads
    0
    Uploads
    0

    Default work shift program

    Since fanuc only has work shift G54-G59 i want to create a program where i can store my work shift coordinates, would this be possible and how would it look like?
    I need this because i have many part's that uses the same work shift's and if i need to change one i would need to manually change them all.
    So let's say work shift program has 20 lines of different work shift's how would i read work shift 4 from main program?

    Similar Threads:


  2. #2
    Member dcoupar's Avatar
    Join Date
    Mar 2003
    Location
    USA
    Posts
    2932
    Downloads
    0
    Uploads
    0

    Default

    What model Fanuc do you have?

    Does your control have the Custom Macro B option? You could write a custom macro to do this.

    An easier method would be to set the Work Coordinates at the beginning of each program with a G10 command. An example for a Model 21M-B:

    G90
    G10 L2 P1 X-12.437 Y-6.562 (G54)
    G10 L2 P2 x-10.375 Y-6.531 (G55)
    G10 L2 P3 X-8.903 Y-6.533 (G56)



  3. #3
    Member
    Join Date
    Jan 2010
    Location
    Norway
    Posts
    171
    Downloads
    0
    Uploads
    0

    Default

    I think it has it, might upgrade if not.
    How would such a code look like?
    G10 would work but since i have 5-6 part's using the same work shift i would have 5-6 programs to change for each work shift.



  4. #4
    Member
    Join Date
    Jan 2010
    Location
    Norway
    Posts
    171
    Downloads
    0
    Uploads
    0

    Default

    Obs forgot model. Fanuc 18i-TB.



  5. #5
    Member
    Join Date
    Sep 2010
    Location
    Australia
    Posts
    1230
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by ProToZyKo View Post
    I think it has it, might upgrade if not.
    How would such a code look like?
    G10 would work but since i have 5-6 part's using the same work shift i would have 5-6 programs to change for each work shift.
    User Macro system variables for G54 - G59 start at #5221 through to #5324. They are allocated in groups of four and increment by 20 for the next Work Shift number as explained in the following example:

    #5221 = G54 X
    #5222 = G54 Y
    #5223 = G54 Z
    #5224 = G54 4TH

    #5241 = G55 X
    #5242 = G55 Y
    #5243 = G55 Z
    #5244 = G55 4TH

    and so it goes on by adding 20 to get the address of the next Work Shift number.

    The approach would be to use Common Variables that are not reset when the power is turned off; these are in the range of #500 to #531 as standard and #532 to #999 are available as an option. You would need to make sure that the Common variables you use are not used by other Macro programs that may be being used by the machine, such as a Tool Change Macro program. Because the variables are common, it means that as well as the variable being able to be read by all programs that use it, it can also be altered by any of the programs that access it.

    You will have sufficient common, nonvolatile, variables to be able to record the values for X,Y and Z for your Work Shifts G54 through to G59 and at the beginning of each program you could have something like the following:
    For G54
    #5221 = #500
    #5222 = #501
    #5223 = #502

    For G55
    #5241 = #503
    #5242 = #504
    #5243 = #505

    The actual values for the respective Work Shifts are recorded in the Macro Variable Table, similar to how you register a value into the tool offset table. When the program executes, these values will by read and allocated to the system variables that correspond to the respective Work Shift numbers. If a Work Shift value needs to be altered, then it is altered in the Macro Variable Table, and the changed variable is read by each of your various programs when they execute.

    Regards,

    Bill



  6. #6
    Member dcoupar's Avatar
    Join Date
    Mar 2003
    Location
    USA
    Posts
    2932
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by ProToZyKo View Post
    Obs forgot model. Fanuc 18i-TB.
    18i-TB? What are you using all those work shifts for on a lathe? How many spindles does it have, anyway?



  7. #7
    Member
    Join Date
    Sep 2010
    Location
    Australia
    Posts
    1230
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by dcoupar View Post
    18i-TB? What are you using all those work shifts for on a lathe? How many spindles does it have, anyway?
    Good point, I didn't pick up on the control model.

    Regards,

    Bill



  8. #8
    Member
    Join Date
    Jan 2010
    Location
    Norway
    Posts
    171
    Downloads
    0
    Uploads
    0

    Default

    Will try to explain this the best i can. (not that good on english)
    This is a big lathe, and we produce allot of similar parts, what i do is setting up different axles on the table to put my part's on, so when i go from one part to another i don't have to think about setting my work shift wrong since i have already done in the past.
    I could write all of theese down but i can't risk setting wrong value.
    I only need different work shift's in Z direction.
    Hope you understand better, would be similar to what you would do on a mill with multiple tables.

    Quote Originally Posted by angelw View Post
    Good point, I didn't pick up on the control model.

    Regards,

    Bill




  9. #9
    Member dcoupar's Avatar
    Join Date
    Mar 2003
    Location
    USA
    Posts
    2932
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by ProToZyKo View Post
    Will try to explain this the best i can. (not that good on english)
    This is a big lathe, and we produce allot of similar parts, what i do is setting up different axles on the table to put my part's on, so when i go from one part to another i don't have to think about setting my work shift wrong since i have already done in the past.
    I could write all of theese down but i can't risk setting wrong value.
    I only need different work shift's in Z direction.
    Hope you understand better, would be similar to what you would do on a mill with multiple tables.
    I would add a G10 L2 P1 Znnn.nnnn at the beginning of each program.

    O1234(PART NO. 1)
    G10 L2 P1 Z10.437 (SET G54 Z OFFSET VALUE)
    N1 G0 G40 G97 G99
    ...
    ...
    ...
    M30



  10. #10
    Member
    Join Date
    Jan 2010
    Location
    Norway
    Posts
    171
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by dcoupar View Post
    I would add a G10 L2 P1 Znnn.nnnn at the beginning of each program.

    O1234(PART NO. 1)
    G10 L2 P1 Z10.437 (SET G54 Z OFFSET VALUE)
    N1 G0 G40 G97 G99
    ...
    ...
    ...
    M30
    Problem here is that if i change my axle stands due to mark's or something else i would need to change the G10 line in every program. As of now that would be around 10 program's, in a few month's maybe 30.



  11. #11
    Member
    Join Date
    Sep 2010
    Location
    Australia
    Posts
    1230
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by ProToZyKo View Post
    Problem here is that if i change my axle stands due to mark's or something else i would need to change the G10 line in every program. As of now that would be around 10 program's, in a few month's maybe 30.
    The Series 18 Control is an easy control to use to touch off a tool and reset the coordinate system for Z when each job it put up.

    However, if you still want to have all previously set Work Shifts globally changed for programs using the same Work Shift number, you could still use the User Macro approach described earlier.

    Because only Z has to be catered for, it will allow you, in some degree, to associate the variable number with the Work Shift number. This would allow 18 distinct different Work Shift job groups to be used and still retain some semblance of association, and no limit to how many programs use that same Work Shift (macro variable) value. Of course good record keeping would have to be in place so that if and when Work Shift had to be altered, the value of the correct, corresponding variable is altered.

    As explained before, the work Shift values would be registered with each corresponding variable and altering the variable would alter the associated Work Shift of programs using that variable.

    You could expand the User Macro approach further by creating a coordinate setting Macro program, so that when you touched off a tool to set, say, G55, then the associated #502, #512, or #522, or whatever variable numbers you use, is automatically set. User Macro programming is limited only by your imagination.

    Regards,

    Bill

    For G54(1)
    #5223 = #501, #511, #521
    For G55(2)
    #5243 = #502, #512, #522
    For G56(3)
    #5263 = #503, #513, #523
    For G57(4)
    #5283 = #504, #514, #524
    For G58(5)
    #5303 = #505, #515, #525
    For G59(6)
    #5323 = #506, #516, #526

    O1111(PART NO. ? USING G54-1)
    #5223 = #501 (SET G54 Z OFFSET VALUE)
    N1 G0 G40 G97 G99
    ...
    G54...
    ...
    M30

    O222(PART NO. ? USING G54-2)
    #5223 = #511 (SET G54 Z OFFSET VALUE)
    N1 G0 G40 G97 G99
    ...
    G54...
    ...
    M30

    O5555(PART NO. ? USING G55-1)
    #5243 = #502 (SET G55 Z OFFSET VALUE)
    N1 G0 G40 G97 G99
    ...
    G55...
    ...
    M30

    O6666(PART NO. ? USING G55-2)
    #5243 = #512 (SET G55 Z OFFSET VALUE)
    N1 G0 G40 G97 G99
    ...
    G55...
    ...
    M30



  12. #12
    Member
    Join Date
    Jan 2010
    Location
    Norway
    Posts
    171
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by angelw View Post
    This would allow 18 distinct different Work Shift job groups to be used and still retain some semblance of association,
    For G54(1)
    #5223 = #501, #511, #521
    For G55(2)
    #5243 = #502, #512, #522
    For G56(3)
    #5263 = #503, #513, #523
    For G57(4)
    #5283 = #504, #514, #524
    For G58(5)
    #5303 = #505, #515, #525
    For G59(6)
    #5323 = #506, #516, #526
    Gues that i can create 100's of work shift by doing this? No reason to jump 10 variables each time? G54 can use variable 501,502,503,504,505,506 etc etc right?
    Haven't started learning macro yet, good way to start i gues

    Would there be possible todo it like this?
    O5000(WORK SHIFT)
    (PART 1);
    N1G10L2P1Z123;
    (PART 2);
    N2G10L2P1Z234;
    (PART 3);
    N3G10L2P1Z345;
    (PART 4);
    N4G10L2P1Z456;
    etc

    O4000(MAINPROGRAM1)
    GOTO N1 O5000(READ Z ZERO)
    G00G54
    ..........
    M30



  13. #13
    Member
    Join Date
    Sep 2010
    Location
    Australia
    Posts
    1230
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by ProToZyKo View Post
    Gues that i can create 100's of work shift by doing this? No reason to jump 10 variables each time? G54 can use variable 501,502,503,504,505,506 etc etc right?
    Haven't started learning macro yet, good way to start i gues

    Would there be possible todo it like this?
    O5000(WORK SHIFT)
    (PART 1);
    N1G10L2P1Z123;
    (PART 2);
    N2G10L2P1Z234;
    (PART 3);
    N3G10L2P1Z345;
    (PART 4);
    N4G10L2P1Z456;
    etc

    O4000(MAINPROGRAM1)
    GOTO N1 O5000(READ Z ZERO)
    G00G54
    ..........
    M30
    The only reason for the jump was to retain some association between the variable number and the Work Shift offset group. Using the standard, nonvolatile, common variables you could have a max of 32 different Work Shift Groups and then an unlimited number of programs using each group.

    The approach using G10 will work, but GOTO N1 O5000(READ Z ZERO) from your main program will not.

    Alpha characters, excluding GLNOP, have Local Variable numbers allocated to them and can be used to pass a value to a Macro program. Accordingly you could have something like the following and maintain the Work Shift for each of your part programs from within program O5000:

    That will work.

    Regards,

    Bill

    O4000(MAINPROGRAM1)
    G65 P5000 H3 (WHERE H REPRESENTS THE N NUMBER IN THE MACRO TO GO TO)
    N1 G0 G40 G97 G99;
    ...;
    G00 G54...;
    ...;
    ...;
    M30;
    %

    O5000(WORK SHIFT)
    GOTO#11 (#11 EQUALS THE VALUE PASSED BY H, #11=3 IN THIS EXAMPLE)
    (PART 1);
    N1G10L2P1Z123;
    GOTO999;
    (PART 2);
    N2G10L2P1Z234;
    GOTO999;
    (PART 3);
    N3G10L2P1Z345;
    GOTO999;
    (PART 4);
    N4G10L2P1Z456;
    GOTO999;
    ...
    ...
    ...
    ...
    ...
    (PART 20);
    N20G10L2P1Zxxx.xxx;
    GOTO999;
    (PART 21);
    N21G10L2P1Zxxx.xxx;
    N999;
    M99; (RETURN TO MAIN PROGRAM)
    %

    Last edited by angelw; 03-14-2011 at 07:36 PM.


  14. #14
    Member
    Join Date
    Jan 2010
    Location
    Norway
    Posts
    171
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by angelw View Post
    O4000(MAINPROGRAM1)
    G65 P5000 H3 (WHERE H REPRESENTS THE N NUMBER IN THE MACRO TO GO TO)
    N1 G0 G40 G97 G99;
    ...;
    G00 G54...;
    ...;
    ...;
    M30;
    %

    O5000(WORK SHIFT)
    GOTO#11 (#11 EQUALS THE VALUE PASSED BY H, #11=3 IN THIS EXAMPLE)
    (PART 1);
    N1G10L2P1Z123;
    GOTO999;
    (PART 2);
    N2G10L2P1Z234;
    GOTO999;
    (PART 3);
    N3G10L2P1Z345;
    GOTO999;
    (PART 4);
    N4G10L2P1Z456;
    GOTO999;
    ...
    ...
    ...
    ...
    ...
    (PART 20);
    N20G10L2P1Zxxx.xxx;
    GOTO999;
    (PART 21);
    N21G10L2P1Zxxx.xxx;
    N999;
    M99; (RETURN TO MAIN PROGRAM)
    %
    Perfect In my option's list i have custom macro b but i can't find any macro screen, how can i be sure that i have it? Would need to find it too figure out wich variable i can use for my program...



  15. #15
    Member
    Join Date
    Sep 2010
    Location
    Australia
    Posts
    1230
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by ProToZyKo View Post
    Perfect In my option's list i have custom macro b but i can't find any macro screen, how can i be sure that i have it? Would need to find it too figure out wich variable i can use for my program...
    1. Press the OFFSET-SETTING button
    2. Below the screen and at the extreme right corner, press the Right Arrow button; this button will take you to the next page where a [MACRO] soft key at the bottom of the screen should be displayed.
    3. If you have this soft key you have the User Macro option.

    Or

    Via MDI mode, input and execute the following:
    #1=1;
    If no alarm then you have the option. You will have to navigate to the Macro Registry screen, using the above method, to confirm if #1=1.

    If you use the G10 approach, there will be no figuring out which variable to use. When a Macro is called, arguments are assigned to local variables. Accordingly, just use whatever alpha character you like to pass the N value you want to GOTO in the Macro program. "N" would be the most logical character to use, but it's not available. It does not matter if the same Local variable associated with the alpha character you use is used by another Macro program. It does matter if you use a Common variable.

    There is no hard and fast convention as to what Character to use to pass the value with, other than what seems logical. The characters "D" and "H" are often used in conventional CNC programs to hold integer numbers such as offset numbers. Accordingly, either of these would be a reasonable choice. The Local variables associated with "D" and "H" are #7 and #11 respectively.

    Regards,

    Bill



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

work shift program

work shift program