Hello Guest it is October 15, 2019, 01:21:03 PM

Author Topic: Need info: Mach3 line count  (Read 4409 times)

0 Members and 1 Guest are viewing this topic.

Need info: Mach3 line count
« on: October 18, 2010, 12:17:48 AM »
Hello:

Power in my country is not stable enough. It frequently fluctuates and in some cases even my UPS gets abnormal switchover and due to the fact that PC gets rebooted.

I would like to know if Mach3 writes a log for the line count as it executes. It will really help me to resume the milling from where it was interupted. At this moment it is a big pain for me to identify the line number for the interupted milling.

Any help will be greately appreciated.
My CNC Store: http://liana-tech.com
_____________________________

Offline Hood

*
  •  25,855 25,855
  • Carnoustie, Scotland
    • View Profile
Re: Need info: Mach3 line count
« Reply #1 on: October 18, 2010, 03:00:12 AM »
Not that I know of and as the xml is written to when you close Mach it couldnt be done in that by saving a DRO. You may however be able to do it via a macropump and some VB and write the DRO value to a text file. Afraid I am not good enough at VB but maybe Ray L (HimyKabibble) or others will be able to give you a few pointers.
Hood
Re: Need info: Mach3 line count
« Reply #2 on: October 18, 2010, 10:13:06 PM »
Not that I know of and as the xml is written to when you close Mach it couldnt be done in that by saving a DRO. You may however be able to do it via a macropump and some VB and write the DRO value to a text file. Afraid I am not good enough at VB but maybe Ray L (HimyKabibble) or others will be able to give you a few pointers.
Hood

The line number is available through a DRO, so that's not a problem.  But I suspect writing to a file on a regular basis might slow down overall operation.  But you could give it a try and see.  Just use standard VBasic file I/O operations to write the file from a macropump.

Regards,
Ray L.
Regards,
Ray L.
Re: Need info: Mach3 line count
« Reply #3 on: October 19, 2010, 03:07:59 AM »
I'm not actually familier with the macropump programming. It will be great if someone guides. :-)

So far I understand Mach3 is executing line by line and I just need the line number (for what it's going to execute).

thanks
My CNC Store: http://liana-tech.com
_____________________________
Re: Need info: Mach3 line count
« Reply #4 on: October 19, 2010, 10:10:02 PM »
I'm not actually familier with the macropump programming. It will be great if someone guides. :-)

So far I understand Mach3 is executing line by line and I just need the line number (for what it's going to execute).

thanks


If you create a VB file named "macropump.m1s" in the Mach3/macros directory, Mach3 will run it periodically (10X/second, more or less).  You can write a macro that reads the line number DRO, and writes that value out to a file.  Since they are invoked often, it is very important that macropump macros execute *quickly*, or they can degrade system performance.

An updated version of my VB Macro Programmers Reference Manual is posted on the ArtSoft documentation site, which explains much of what you'll need to know to actually do this.  The rest you can get by asking specific questions here.

Regards,
Ray L.
Regards,
Ray L.

Offline BR549

*
  •  6,902 6,902
    • View Profile
Re: Need info: Mach3 line count
« Reply #5 on: October 19, 2010, 10:17:52 PM »
I worked on something like this a while back for the same purpose. It might be better to only write to  the file about every 5 minutes or so. IF you continuously write to the hard drive it may TIE up a lot of CPU time trying to write 10 times per sec.  Mach can process a lot of lines in a minutes time.

Just a thought, (;-) TP

Offline BR549

*
  •  6,902 6,902
    • View Profile
Re: Need info: Mach3 line count
« Reply #6 on: October 20, 2010, 08:30:28 PM »
Hum may have found somthing that works,

Set up a brain to do a timer for ay 20sec then trip a led.

In the macropump If it sees the LED on write the LineNum to a file then turn off led.

The brain takes some of the load off of VB/cpu and speeds it up a lot. It may not get you the exact line you failed on BUT it will be very close.

MAY work, worth a try.

(;-) TP

Offline BR549

*
  •  6,902 6,902
    • View Profile
Re: Need info: Mach3 line count
« Reply #7 on: October 20, 2010, 09:45:51 PM »
I just tested a simple version AND it works fine so far at 10 sec intervals may can go lower.

Hope that helps, (;-0 TP