586,076 active members*
3,779 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > Fanuc > Fanuc - NC code to read a parameter status??
Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2008
    Posts
    7

    Fanuc - NC code to read a parameter status??

    Controllers: Fanuc 18iMB.
    I have a lot of programs that I would like to be able to run on 2 similar but not identical machines. Rather than writing 2 programs, is it possible to maybe set a parameter on machine A to "1" & machine B to "0" then have the code read the parameter status? If so, what parameter number? and how do I call it in a program?

    example of logic would be.

    If parameter *** = 1 goto block N100
    If parameter *** = 0 goto block N120

    I hope this makes sense to someone.
    Any suggestions would be greatly appreciated.
    Thank you.
    Kenn.

  2. #2
    Join Date
    Aug 2011
    Posts
    2517
    G10 allows you to write parameters but I don't think there's any 'code' to read them.
    'checking the machine' type questions have come up a few times in the past. one solution is if the machines have macro you can pre-set a variable to a unique number for each machine then read that variable at the top of the program.

  3. #3
    Join Date
    Mar 2008
    Posts
    7

    Fanuc - NC code to read a parameter status??

    Hi Fordav11,

    I have never used macro, & I don't have a lot of programming experience. If it's available I will try to use it.
    Does that mean that the preset variable is stored permanently in the controller?
    Thank you
    Ken

  4. #4
    Join Date
    Aug 2011
    Posts
    2517
    yes its permanent if you use the variable #'s that don't clear when the machine is powered off.
    to check the variable using variable #500....

    IF #500 =0 GOTO N100
    IF #500 =1 GOTO N120

    you can check for the existence of macro.
    in MDI type #100 = 1 EOB then press INSERT then start. if you don't get an alarm then you have Macro B.

  5. #5
    Join Date
    Mar 2008
    Posts
    7

    Fanuc - NC code to read a parameter status??

    Thanks a lot Fordav11.
    Really appreciate your help. I will check it out.
    Ken

  6. #6
    Join Date
    Aug 2011
    Posts
    2517
    also check for macro A just in case....
    in MDI ....
    G65 H01 P#500 Q1 EOB then press INSERT then start

  7. #7
    Join Date
    Mar 2008
    Posts
    7

    Fanuc - NC code to read a parameter status??

    Just checked
    #100=1 EOB. no alarm. Looks like I got macro B. I will check for macro A later. Looks like I've got some work to do.
    Thanks again for your help.
    Ken

  8. #8
    Join Date
    Aug 2011
    Posts
    2517
    and cycle start too?
    you can find the macro variable list on the offset page then page right until it comes up.
    #100 should be 1 if it worked.

Similar Threads

  1. Read D-parameter in CNC-programme
    By Ingmar Trobäck in forum Fanuc
    Replies: 9
    Last Post: 07-26-2012, 01:18 PM
  2. Replies: 1
    Last Post: 11-19-2010, 03:05 PM
  3. can we read the current status of a parameter
    By sinha_nsit in forum Fanuc
    Replies: 12
    Last Post: 12-07-2009, 01:44 PM
  4. Replies: 1
    Last Post: 11-18-2009, 08:17 PM
  5. How do I read the value of an F-type parameter into a macro variable?
    By Jan d. in forum Mazak, Mitsubishi, Mazatrol
    Replies: 24
    Last Post: 02-18-2009, 05:47 AM

Posting Permissions

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