Hello Guest it is March 28, 2024, 11:47:45 AM

Author Topic: Persistent Parameters  (Read 8456 times)

0 Members and 1 Guest are viewing this topic.

Persistent Parameters
« on: November 10, 2012, 08:35:30 AM »
Hello World,
I'm having a hard time finding a parameter (a Double) that will persist from one Mach session to the next that can be used in a macro.  I assume it would have to be saved into the XML but scanning that I don't see any likely candidates.  If you can help me solve this and/or lead me to the documentation on this subject it is much appreciated.
Thank you,

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Persistent Parameters
« Reply #1 on: November 10, 2012, 09:04:02 AM »
500-600

Re: Persistent Parameters
« Reply #2 on: November 10, 2012, 09:14:51 AM »
Thanks, from what I can see in the Reference Manual GetParam and SetParam are looking for a string value as to the parameter name.  How do I get and set these parameters, 500 - 600?  And if you could lead me to the documentation it would be greatly appreciated.
Thanks again,

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Persistent Parameters
« Reply #3 on: November 10, 2012, 09:37:39 AM »
SetVar(500,1) sets the var to the secondary value (1)

GetVar(500)  retrieves the Var value


(;-) TP

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Persistent Parameters
« Reply #4 on: November 10, 2012, 10:30:55 AM »
You can also write to a UserDRO, the value of which get's saved in the .xml I think.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Persistent Parameters
« Reply #5 on: November 10, 2012, 01:24:53 PM »
Gentlemen,
I've spent the past couple of hours trying to get a (double) value to persist through a shut down and re-start of Mach.  Params, Vars, OEMDRO's, UserDRO's, none of these will hold the value when Mach is re-started.  I have Persistent DRO's checked in General Config but when I re-start Mach the value is at default, not the value at last shut down, isn't this the definition of Persist.
What am I missing?
Thank you.
Re: Persistent Parameters
« Reply #6 on: November 10, 2012, 01:55:30 PM »
Getting a little closer, it doesn't appear to be a problem with the Set and Get commands but rather when I set a OEMDRO from a macro it doesn't persist, even though I can watch the DRO change when I run the macro.  If I manually change the DRO and enter as you have to after entering the new value it persists and can be verified in the XML.  So now the question is how do I get the value to 'stick' when it's changed via a macro?
Thanking you once again.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Persistent Parameters
« Reply #7 on: November 10, 2012, 02:25:53 PM »
I just checked and HERE it works just fine. It saves Vars and dros and I see them in the XML and after I restart they are still there and can be called up via macro. Where are you running the macros from. What type dro are you setting. OEM,USER?

Same with VARs they stay persistant in the range of 500-600. THOSE are the only ones that will by the way.

(;-) TP

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Persistent Parameters
« Reply #8 on: November 10, 2012, 03:20:28 PM »
Are you using an old version of Mach3?
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Persistent Parameters
« Reply #9 on: November 10, 2012, 03:51:15 PM »
I'm running the macro from Mach3\macros\Mill.  Version 3.042.040  I'm using an obscure OEMDRO right now, Tangential Lift Angle #92 since I figured it wouldn't be influenced elsewhere and it is part of the XML, not all DRO's are.  Doing more investigation I find 2 XML files, both with the same mod date and time, one in the Mach3 directory and the other in Mach3\macros\Mill directory, HERE'S the WEIRD THING, the XML in the Mach3 directory is holding the default value, in this case 45; the XML in the Mach3\macros\Mill directory is showing the value I set via the macro.  I always thought the XML of the profile was in the main directory only.  Can you shed any light on this.
I sincerely appreciate your help, thanks.