Results 1 to 4 of 4

Thread: System variable #4113 for M-code

  1. #1
    Registered
    Join Date
    Feb 2006
    Location
    india
    Posts
    1,273
    Downloads
    0
    Uploads
    0

    System variable #4113 for M-code

    I wish to insert an error trap in a macro, to detect whether or not the spindle is rotating.
    I thought to check the value of #4113, which would store 3 if M03 is active.
    But the problem is that it would store (I believe) only the last commanded M-code. So, if M08 is commanded after M03, #4113 would contain 8.
    Then, how to check if M03 has been commanded in the calling program?
    Or, is it not possible?


  2. #2
    Registered
    Join Date
    Jun 2008
    Location
    United States
    Posts
    1,509
    Downloads
    0
    Uploads
    0
    You care correct you would not be able to use #4113 because it will change based on the M-code programmed at the time.

    Just an idea but you could use the #4119 for the S() command. This is not exactly what you want but at least you can turn the spindle on if it is not running. But this would bring up another issue of was there an S() command programmed. If there was then you could write in your macro a M3S#4119. This would turn the spindle on to the programmed S value. Now if you were worried about no spindle speed being commanded then you could write a condition before that line with a minimum spindle speed setting. If the spindle speed is less then that then alarm out. So if it was never programmed then it would be 0. Example would be anything less then S10 alarm out. If not then start spindle rotation at programmed S().

    IF[#4119LT10]GOTO1000
    MSS#4119

    N1000
    #3000=1(NO SPINDLE SPEED COMMANDED)

    Stevo


  3. #3
    Registered
    Join Date
    Feb 2006
    Location
    india
    Posts
    1,273
    Downloads
    0
    Uploads
    0
    Thanks.
    This appears to be the only way.

    Is it not sufficient to just write M03 instead of M03 S#4119?

    Also, if S is not programmed, we can detect it by just comparing #4119 with #0.


  4. #4
    Registered
    Join Date
    Jun 2008
    Location
    United States
    Posts
    1,509
    Downloads
    0
    Uploads
    0
    I don’t know if you will need a S() with the M3 or will it take the modal #4113 no matter what. I think you will find that even though a S() was given in the main program that the M3 alone in the macro will not turn it on. You will have to try it and see.

    Yes you can compare to #0 providing that the state of #4113 is null. I used a number only because if someone did program a S0 then comparing it to #0 will not make the function. IIRC the state of #4113 is null when no S is programmed. I am not 100% so you may want to try it.

    Stevo


Similar Threads

  1. New Machine Build- variable speed pulley system (variator)
    By acourtjester in forum General Metal Working Machines
    Replies: 8
    Last Post: 07-20-2009, 12:23 PM
  2. Dry-run system variable?
    By machzero in forum Okuma
    Replies: 3
    Last Post: 06-12-2009, 10:08 AM
  3. Replies: 6
    Last Post: 11-18-2007, 02:05 AM
  4. System Variable for Pallet location
    By Jason812 in forum Fanuc
    Replies: 7
    Last Post: 11-05-2007, 08:23 AM
  5. System variable for spindle tool Fanuc 15m
    By pieface in forum Fanuc
    Replies: 8
    Last Post: 06-01-2006, 07:37 AM

Posting Permissions


 


About CNCzone.com

    We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

Follow us on

Facebook Dribbble RSS Feed


Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.