Hello Guest it is March 29, 2024, 06:38:24 AM

Author Topic: Are #100 thru #199 #vars safe for user functions?  (Read 2817 times)

0 Members and 1 Guest are viewing this topic.

Are #100 thru #199 #vars safe for user functions?
« on: June 20, 2018, 11:44:42 AM »
I've read conflicting information in the forums regarding the #vars .
Which #vars are safe for user functions?
Are any persistent (saved at Mach4 shutdown / reloaded at Mach4 startup)?   
Re: Are #100 thru #199 #vars safe for user functions?
« Reply #1 on: June 20, 2018, 12:00:43 PM »
I just did a quick test on this. 
I put a value of 5 (for no particular reason) in variables #50, #99, #100, and #110.
I restarted Mach4, #50 and #99 still maintained their value of 5.  #100 and #110 returned to a NIL.

When I am using #VARS I tend to start at #200. 
I was doing some testing on my desk computer a few months ago and was using #VARS #200-#215, these still have their values from when I was testing our Grinding Program.
Chad Byrd
Re: Are #100 thru #199 #vars safe for user functions?
« Reply #2 on: June 20, 2018, 03:08:25 PM »
Hi,
yes they are good:

Quote
Common vars (cleared on startup)
NAME: #Var Num
CMN1 START 100
CMN1 END 199

And:

Quote
Common vars (retained across startups)
NAME: #Var Num
CMN2 START 500
CMN2 END 599

This comes from poppabear, and there are some other important gems here as well:

http://www.machsupport.com/forum/index.php/topic,30323.0.html

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Are #100 thru #199 #vars safe for user functions?
« Reply #3 on: June 21, 2018, 08:27:43 AM »
And once again, thank you!
Re: Are #100 thru #199 #vars safe for user functions?
« Reply #4 on: June 22, 2018, 04:54:03 AM »
Also be aware if you use it that some of these vars are cleared and used within the Probing module.

Allan
Re: Are #100 thru #199 #vars safe for user functions?
« Reply #5 on: June 22, 2018, 05:50:02 AM »
Hi,
Allan is right, the problem with ANY of the pound variables is that NFS has NEVER guaranteed that they are not used for some internal purpose or that they maybe
in the future. Even those pound variables that we do know what they are may change at some future date and any code we have which depends on the variables
and/or their interpretation will fail, and it will be our fault!

Despite the seeming  inconvenience registers are still preferred from the point of view of reliability.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Are #100 thru #199 #vars safe for user functions?
« Reply #6 on: June 22, 2018, 08:37:07 AM »
Hey all,

#100 through #199 are safe for user functions but are not persistent, as others have pointed out. For a more thorough (and recent) list of what pound variables are being used in Mach4, check out the attachment below.

-Bryanna
Newfangled Solutions Helpdesk: http://support.machsupport.com
YouTube Support Channel: https://www.youtube.com/c/MachSupportOfficial
Re: Are #100 thru #199 #vars safe for user functions?
« Reply #7 on: June 23, 2018, 07:44:21 PM »
Hi Bryanna,
that the first time I've seen a file like that.

I guess its some sort of definitions file....kool.....will look through it with a fine tooth comb.
Many Thanks

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: Are #100 thru #199 #vars safe for user functions?
« Reply #8 on: June 25, 2018, 01:15:30 PM »
The system variables are also described in the Mill G code programming manual in the Docs folder.  Chapter 6.

Steve 
Re: Are #100 thru #199 #vars safe for user functions?
« Reply #9 on: June 25, 2018, 02:11:29 PM »
Steve,
Chapter 6 of the Mill G Code Manual is new correct?
This would have been a gold mine of information for me when I was writing our OD Grinder Macro!!
Very valuable information in that chapter!! Thanks for adding it!!
« Last Edit: June 25, 2018, 02:13:53 PM by Cbyrdtopper »
Chad Byrd