Hello Guest it is March 29, 2024, 11:51:55 AM

Author Topic: Script in a button or in a macro. Which is more efficient?  (Read 4849 times)

0 Members and 1 Guest are viewing this topic.

Script in a button or in a macro. Which is more efficient?
« on: June 10, 2006, 12:20:23 AM »
I'm working on a project and in my initial testing I am seeing some problems with running macros repetitively.

Here's what I have,
 M90001.m1s
  code "G31 z-10 f35"
  while IsMoving
  wend
  code "M3"
  code "G0Z1"

 M90002.m1s
  code "g31 z-10 f35"
  while IsMoving
  wend
  code "M5"
  code "G0Z1"

In my tap file I setup this test

M90001
g0y1
M90002
g0y0
m30

Note, the spindle command are controlling a vacuum pickup nozzle. The test is supposed to pick up an object whit the vacuum, move to the y1 location and drop the object.

This whole process runs perfectly each time I hit Cycle Start

BUT, as a test, I set up multipass for 100 repetitions to test my just completed digitize probe. It runs fine for a few iterations. Then the motors start making more and more noise. After about 6 iterations the motors ar grinding and an start to lock up.

If I hit Estop, reset, restart, it repeats this process each time. Runs fine and then  starts to grind.

Whats going on? My guess is that the PC is spending more and more resources opening and closing the Macro files robbing time from Mach3.

Anyone seen anything like this before? Would I be better of putting the scripts into buttons where disk access would not be involved?

Any Ideas?

Ted

Offline ART

*
  • *
  •  1,702 1,702
  • Tough as soggy paper.
    • View Profile
Re: Script in a button or in a macro. Which is more efficient?
« Reply #1 on: June 10, 2006, 08:04:06 AM »
Hi Ted:

 Hmm. Sounds like a memory leak. Ill run some tests...

Art

Offline ART

*
  • *
  •  1,702 1,702
  • Tough as soggy paper.
    • View Profile
Re: Script in a button or in a macro. Which is more efficient?
« Reply #2 on: June 10, 2006, 08:19:06 AM »
Well, the good news is there is no leak. But running those IsMoving loops realy hog bandwidth. I must come up with a better way of doing that..

  Ill do some investigation oon how better to do that. Next version may handle it better. In answer to your question, buttons woudl be quicker as they dont need file access..

(Subroutines would be better still... )


M98O1
G0Y1
M98O2
g0y0
M30


O1
G31Z-10F35
M3
M99

O2
G3131Z-10
M5
M99

Regards,
Art
Re: Script in a button or in a macro. Which is more efficient?
« Reply #3 on: June 10, 2006, 10:34:27 AM »
Well Art, Glad to hear it's not ME this time.

I re-wrote the test using subroutines and it works perfectly with hundreds of passes.

I can see how the IsMoving() would be polling the port for the probe contact using up all the bandwidth. In fact, during one of the runs yesterday using the Macros, windows reported that Mach3 was using 93% of the CPU Usage. Too bad we did not have an interupt structure to play with.

I'm going to try the Button method as soon as the family is done with me for the day.

Offline ART

*
  • *
  •  1,702 1,702
  • Tough as soggy paper.
    • View Profile
Re: Script in a button or in a macro. Which is more efficient?
« Reply #4 on: June 10, 2006, 01:26:23 PM »
Hi:

 Well, as to an interrupt structure, as of this weeks release th eplugin structure will be very stable I think. And it offers an interrupt sturcture.
So it woudl actually be cabale of doing things such as that will no overhead.  Soonm things will get mnuch better I think.. We're in a bit of flux at the moment in terms of what can be done..

Art