585,902 active members*
5,073 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > Fanuc > can we read the current status of a parameter
Results 1 to 13 of 13
  1. #1
    Join Date
    Feb 2006
    Posts
    1792

    can we read the current status of a parameter

    G10 can be used to overwrite a parameter.
    Sometimes it may be desirable to store the current value of a parameter before changing it, so that it could be restored later on.
    System variables are available corresponding to certain parameters, so these can be read. What can be done if no system variable is available?
    Taking a backup is a different thing. I am wondering if it can be done through the program.

    The question in short is, can we read a parameter?

  2. #2
    Join Date
    Jun 2008
    Posts
    1511
    Sinha,
    What parameter are you trying to read and on what kind of control?

    Stevo

  3. #3
    Join Date
    Feb 2006
    Posts
    1792
    For the sake of discussion, I would just give a theoretical example which may not have any practical relevance:
    Let us say I have to execute a program on a machine which is new to me and it may have G-code system A, B or C. I can write the program in three parts, suitable for the three system. A conditional statement in the beginning of the program, based on parameters 3401#6 (GSB) and 3401#7 (GSC), would jump to the relevant portion of the program. For this, I should be able to read these bits inside the program.
    A different way would be to write the program in, say, system A, change parameter setting to system A in the beginning of the program (using G10 L50), and restore the original setting at the end of the program. For this also, one would need to know the original setting.

    Another example could be associated with DPI setting (3401#0). My program should run as expected, irrespective of this setting.

    Of course, one can always look into the parameter screen and find out the setting. I want to know if it is possible to read a parameter setting inside a program?

    With the limited knowledge I have, I believe the answer is NO. Please confirm.

  4. #4
    Join Date
    Nov 2006
    Posts
    175
    User program can not read parameters, only PMC and a program, executed by macro executor/C-executor can do that

  5. #5
    Join Date
    Jun 2008
    Posts
    1511
    Quote Originally Posted by sinha_nsit View Post
    Of course, one can always look into the parameter screen and find out the setting. I want to know if it is possible to read a parameter setting inside a program?

    With the limited knowledge I have, I believe the answer is NO. Please confirm.
    Not the parameters you are looking to read. Out of curiosity what is the reason that you would like to do this? Are you trying to setup some kind of standard programming database with maybe general programs that can run on any machine regardless of the settings in the control?

    Stevo

  6. #6
    Join Date
    Feb 2006
    Posts
    1792
    Many a time I try to explore certain things just for the sake of learning or out of curiosity, to find out what is possible and what is not.

    Some time back there was a discussion on how to undo G92. Thinking on a similar line, I wondered if it is possible to undo G10. In fact, it may be more desirable because the effect of G92 is temporary (in the current machining session only), whereas G10 changes data permanently.

    Possibly, in a future version, Fanuc would introduce "Programmable Data Output"! In fact, they have partially done this by defining system variables corresponding to some parameters.

  7. #7
    Join Date
    Jun 2008
    Posts
    1511
    I know what you mean. I love to test things just for gaining the knowledge of can it work.

    What do you mean by undo the G10??

    Stevo

  8. #8
    Join Date
    Feb 2006
    Posts
    1792
    By undoing G10, I mean restoring the values changed by G10 (at the end of the program), which is not possible because we do not know the original values. G10 simply overwrites.

  9. #9
    Join Date
    Jun 2008
    Posts
    1511
    Hmmmm….I disagree. Depends on what you want to change with your G10.

    If you were writing a program to say shift your workcoordinates many times throughout a program using the G10 it really doesn’t matter what the end result is. The important part is to know what it is before you started. You could do this by storing the coordinate in a variable or just knowing the hard number you want it to be.

    #500=#5221(stores current X of G54)
    G10L2P1X10

    …change the coordinate with G10 as many times as you want

    #5221=#500(sets G54 X back to original setting)
    M30

    If you were using incremental you could go as far as using a variable to keep tracking the total distance moved and reset it to that at the end.

    Stevo

  10. #10
    Join Date
    Feb 2006
    Posts
    1792
    OK.
    But this is possible because there is a system variable associated with offset values. What to do for those parameters for which there is no system variable defined?
    And If a system variable is available, why at all use G10!

  11. #11
    Join Date
    Jun 2008
    Posts
    1511

    Anyone else on G10 reasoning??

    Quote Originally Posted by sinha_nsit View Post
    OK.
    But this is possible because there is a system variable associated with offset values. What to do for those parameters for which there is no system variable defined?
    And If a system variable is available, why at all use G10!
    Sinha……good question.

    I would use the G10 for many reasons even though there is a system variable that I can use. I have a lot of extensive macros written for the guys but I leave them the option of what work coordinates they want to use for their setup. If I were to hard code the system variable for say G55 to go back to its original value they would not be able to use anything other than G55 for their setups.

    I have 2 ways I do this. 1. is the guys will plug in the coordinate they are using into say #100 and then store their current settings of the coordinate they are using. Say they set #100=58

    #500=#[5201+[[#100-53]*20]]----sets #500 = to current setting of G58 X
    #501=#[5202+[[#100-53]*20]]----sets Y
    #502=#[5203+[[#100-53]*20]]----sets Z


    G10L2P[#100-53]X#500Y#501Z#502

    Now can this be done without using the G10 function…absolutely. However if you are shifting a coordinate incrementally throughout 1 or multiple programs it is much easier to program:
    G10G91L2P[#100-53]X1.
    Rather then
    #[5201+[[#100-53]*20]]= #[5201+[[#100-53]*20]]+1.

    One other way I like to do it is by using the modal coordinate which is held in #4014 so I would replace the #100 with #4014. This I will commonly use when I have multiple macro and nested programs all running at the same time and that may use extended coordinates and are hard to keep track of. The program will just simply use whichever is modal. Basically the programs get so in depth that I can't keep track of everything and start to loose my place.

    G10 can simplify programming but if you want to set specific parameter bits while machining G10 is the only way you can do so.

    Ok after typing all of that I am starting to ask myself the same question as Sinha. For sake of simplifying the programming what other reason would G10 be used for if system variables are available?? Thoughts anyone? (group)
    I know there is a good reason but it's Friday and my mind is burned out so thats all I got.

    Stevo

  12. #12
    Join Date
    Feb 2006
    Posts
    1792
    Quote Originally Posted by stevo1 View Post
    I have 2 ways I do this. 1. is the guys will plug in the coordinate they are using into say #100 and then store their current settings of the coordinate they are using. Say they set #100=58

    #500=#[5201+[[#100-53]*20]]----sets #500 = to current setting of G58 X
    #501=#[5202+[[#100-53]*20]]----sets Y
    #502=#[5203+[[#100-53]*20]]----sets Z


    G10L2P[#100-53]X#500Y#501Z#502
    Stevo
    I have not used G10 much, so I have a confusion.
    For #100 = 58, #500 would store the current contents of the system variable corresponding to G58 X.
    When the same value is written into G58 X, through G10, what would change?

  13. #13
    Join Date
    Jun 2008
    Posts
    1511
    When using G10 it would be changing the value in the G58 registry. I was just using this example of capturing the current state of G58 in #500-#502 before any machining and adjustments would be made using G10. Then you can set G58 back to original state after machining is complete.

    Stevo

Similar Threads

  1. Replies: 1
    Last Post: 11-18-2009, 08:17 PM
  2. Read Current Position?
    By andypugh in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 4
    Last Post: 05-08-2009, 12:40 PM
  3. Current Tool Status
    By barbter in forum NCPlot G-Code editor / backplotter
    Replies: 5
    Last Post: 07-11-2008, 03:09 AM
  4. How can I read the running current?
    By rolveram in forum Gecko Drives
    Replies: 1
    Last Post: 07-03-2007, 07:22 PM
  5. Current Status
    By jabuffi in forum OpenSource Software
    Replies: 20
    Last Post: 11-02-2006, 09:08 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
  •