586,594 active members*
3,081 visitors online*
Register for free
Login
Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2008
    Posts
    17

    Unhappy Loop/variable Problems

    Hi, so i have been trying to make a "loop" for milling a cone like thing, but that's not so important. But the thing is I want to use variables for different things. I have tried using variables in a single program and it works perfect.

    Example:

    O6000
    N1 ( ----- START BLOCK ----- )
    N5 G80 G40 G90
    N6 G53
    N10 M6 T3
    N15 S1000 F350
    N20 G00 X0 Y0 Z100
    N21 ( ---- PROGRAM ---- )
    N25 #1 =-90
    N26 G01 Z#1
    N30 M30

    This works without problems, but I don't know how too create a loop in this. I normaly use sub programs too loop but since they can't pass variables as far as i know it won't work. And yes, i have tried macros too. But im not sure if it is my NC "emulator" that doesn't support this or if im doing something wrong. Using "EMCO WinNC".

  2. #2
    Join Date
    Mar 2006
    Posts
    61

    wHILE DO LOOP

    O6000
    N1 ( ----- START BLOCK ----- )
    N5 G80 G40 G90
    N6 G53
    N10 M6 T3
    N15 S1000 F350
    N20 G00 X0 Y0 Z100
    N21 ( ---- PROGRAM ---- )
    #100= 5.0 (NO OF LOOPS)
    WHILE[#100 GT O.O]DO1
    #100=#100-1.0
    N25 #1 =-90
    N26 G01 Z#1
    END1
    N30 M30

  3. #3
    Join Date
    Oct 2008
    Posts
    17
    Thanks, trying it now.
    By the way, got any better NC simulator to suggest?

    Tried it, and it didn't work. My guess is that EMCO WinNC sucks.

  4. #4
    Join Date
    May 2007
    Posts
    1003
    Quote Originally Posted by tonper View Post
    I normaly use sub programs too loop but since they can't pass variables as far as i know it won't work. And yes, i have tried macros too. But im not sure if it is my NC "emulator" that doesn't support this or if im doing something wrong. Using "EMCO WinNC".
    Not exactly sure what you mean. Are you trying to pass values to a subprogram? Or are you trying to pass variables from a subprogram? Also it seems you are concerned with an "emulator" software program showing what the machine would do with your program. Is that correct? You are trying to get WinNC to show a subprogram looping?

    Sorry for being dense. If you are trying to pass values to a subprogram, then use the G65 Macro call. You can set variables in a subprogram that will be used by another sub or the main program.

    If you are strictly asking about the WinNC software, then I can't help you. Never used this type of software. However I might be able to help you if we are talking about the machine running your programs.

  5. #5
    Join Date
    Mar 2006
    Posts
    107
    Try NCPlot, it has good support for macro/variables
    Sorry for bad english

  6. #6
    Join Date
    Oct 2008
    Posts
    17
    Quote Originally Posted by g-codeguy View Post
    Not exactly sure what you mean. Are you trying to pass values to a subprogram? Or are you trying to pass variables from a subprogram? Also it seems you are concerned with an "emulator" software program showing what the machine would do with your program. Is that correct? You are trying to get WinNC to show a subprogram looping?

    Sorry for being dense. If you are trying to pass values to a subprogram, then use the G65 Macro call. You can set variables in a subprogram that will be used by another sub or the main program.

    If you are strictly asking about the WinNC software, then I can't help you. Never used this type of software. However I might be able to help you if we are talking about the machine running your programs.
    Well, im pretty sure that WinNC doesn't support G65 macro calls. Since that is what i need to pass variables to a subprogram. But what im onto now is to basicaly have the "loop" in the main program. And use "GOTO" but i don't know how it works (or WinNC doesn't support this either). Know this might sound stupid only working in the damn WinNC simulator but can't try these things in the real machine :\

    Does all Fanuc systems support G65 / GOTO and so on or is this something you will have too pay extra for to get unlocked (if not already unlocked)?

  7. #7
    Join Date
    May 2007
    Posts
    1003
    Quote Originally Posted by tonper View Post
    Does all Fanuc systems support G65 / GOTO and so on or is this something you will have too pay extra for to get unlocked (if not already unlocked)?
    They are part of what is known as Macro B. You will have to pay extra if they aren't already on, tho older controls can be illegally (per Fanuc rules) turned on by parameter changes. My understanding is that the new controls need someone from Fanuc to turn them on.

  8. #8
    Join Date
    Oct 2008
    Posts
    17
    Quote Originally Posted by padobranac View Post
    Try NCPlot, it has good support for macro/variables
    Thanks will try it.

Similar Threads

  1. Open Loop to Closed Loop Stepper Conversion
    By beamhome in forum Stepper Motors / Drives
    Replies: 11
    Last Post: 03-09-2014, 11:27 PM
  2. EMC2 variable pitch / variable diameter threading.
    By samco in forum MetalWork Discussion
    Replies: 0
    Last Post: 03-09-2008, 07:40 PM
  3. question on closed loop vs open loop (servo systems)
    By boonie in forum Servo Motors / Drives
    Replies: 20
    Last Post: 11-09-2007, 07:30 PM
  4. Lathe conversion - open loop vs closed loop
    By bhowden in forum Uncategorised MetalWorking Machines
    Replies: 7
    Last Post: 03-21-2006, 10:56 PM
  5. Closed loop....open loop?
    By DAB_Design in forum CNC Machine Related Electronics
    Replies: 10
    Last Post: 06-26-2004, 10:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •