Hello Guest it is April 24, 2024, 03:37:23 AM

Author Topic: Need Help with #[Var] in Mach3  (Read 858 times)

0 Members and 1 Guest are viewing this topic.

Need Help with #[Var] in Mach3
« on: January 29, 2023, 07:05:59 PM »
General Variables #101-199 should be cleared (Set to Null) when the controller is restarted; Correct?  I have several programs that use the same variables but they do not seem to be clearing after a reboot.  Is there a way to force them to reset without a reboot?  Alternatively(Preferred) is there a line of code or command that I can add to my programs at the beginning to ensure they are cleared before the program runs and new variable values are defined/declared?
Re: Need Help with #[Var] in Mach3
« Reply #1 on: January 29, 2023, 07:10:42 PM »
General Variables #101-199 should be cleared (Set to Null) when the controller is restarted; Correct?  I have several programs that use the same variables but they do not seem to be clearing after a reboot.  Is there a way to force them to reset without a reboot?  Alternatively(Preferred) is there a line of code or command that I can add to my programs at the beginning to ensure they are cleared before the program runs and new variable values are defined/declared?

Offline Graham Waterworth

*
  • *
  •  2,673 2,673
  • Yorkshire Dales, England
    • View Profile
Re: Need Help with #[Var] in Mach3
« Reply #2 on: January 29, 2023, 09:33:07 PM »
You can write a Macro to set the values.  Save the code as e.g. M1000.m1s in the macro folder for the profile you are using then just add a M1000 to the start of your programs.

Dim a As Integer
For a = 101 To 199
  SetVar(a,0)
Next
End
Without engineers the world stops