Hello Guest it is March 28, 2024, 01:50:07 PM

Author Topic: Sub Code(“SAVE_XML”)  (Read 2459 times)

0 Members and 1 Guest are viewing this topic.

Sub Code(“SAVE_XML”)
« on: April 27, 2015, 05:50:05 PM »
According to Mach3 Version 3.x Macro Programmers Reference Manual you can save your XML in a macro.  I can't seem to get this to work in my macros.  Sub Code(“SAVE_XML”) this is

what is said to use to do this. 

Anyone ever use it?

--Chad
Chad Byrd

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Sub Code(“SAVE_XML”)
« Reply #1 on: April 27, 2015, 08:11:43 PM »
 Code("SAVE_XML")

Still works fine here. It simply saves the current open XML back to itself. You will only know it because of the new DATE of the XML file.

The file name remains the same.

(;-) TP
Re: Sub Code(“SAVE_XML”)
« Reply #2 on: April 28, 2015, 08:10:38 AM »
What I am looking for is a way to save my tool magazine positions.  I have a 24 tool magazine and it changes 2 tools at once.  So I am having to keep track of different magazine positions constantly for tools.  I am using DROs on a custom screen and it works great.  But we're afraid of power failure and losing tool positions in the magazine.  This code would be more of a convenience for us if we can get it to work.  Is there anything special I have to do?  I have it written Code(“SAVE_XML”).  Is this correct?  I'll try it again and look at the date and time to see if it is doing what is should. 

Thanks
-Chad
Chad Byrd

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Sub Code(“SAVE_XML”)
« Reply #3 on: April 28, 2015, 10:28:30 AM »
I would not rely on it to do what you want. You should be writing the tool info to a seperate data file on the fly . That way every time it changes you write to the file. In the event of an interuption you can back up to the last known data set.

Or you COULD just do an update of the XML. With the tool data in DROs it is automatically saved in the XML so it would work and would be easy to work with.  Just each time the tool data changes save the xml. It takes about 2 secs to do the XML save.

YOUR choice, (;-) TP



Re: Sub Code(“SAVE_XML”)
« Reply #4 on: April 28, 2015, 03:00:58 PM »
That's what I was trying to do inside the macro.  Update my XML.  What about the separate data file?  For my tool magazine positions other than DROs on the screen?  Or just an update of what I have?
Chad Byrd

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Sub Code(“SAVE_XML”)
« Reply #5 on: April 28, 2015, 06:58:07 PM »
Try the XML save first.  It works fine here.   A seperate data file can be a bit complicated.

(;-) TP