Hello Guest it is March 28, 2024, 06:07:23 PM

Author Topic: How many time mach4 check input/output?  (Read 2684 times)

0 Members and 1 Guest are viewing this topic.

How many time mach4 check input/output?
« on: June 09, 2015, 11:21:41 PM »
Hello,

I read ebook: mach3MySteries.pdf, mach3 will check the input/output each 1/10 second. My machine requirerequirement check fast input and output. How many time Mach4 check input and output?

Rgs
Re: How many time mach4 check input/output?
« Reply #1 on: June 10, 2015, 12:35:40 AM »
Short answer: update rate for input signals to the Mach core depends on the plug-in.

Longer answer:
As far as I know (and can remember), in Mach3, 1/10th second (10 Hz) is the rate at which (by default) the plug-in's polling loop ran, with an option for 40 Hz.  *SOME* plug-ins use that polling loop to update the values of the input signals to the Mach core, so for those, yes, the update rate to the Mach3 core was 1/10th second.  However, I think that it is possible for the plug-ins to update the input signals to the Mach3 core at a higher rate, possibly as fast as the hardware can report the input signals to the plug-in.  It all depends on the design of the plug-in (multi-threaded, etc.) and the load placed on the CPU (the Mach3 core is VERY sensitive to how much time the plug-in takes).

Likewise, in Mach4, to my experience, there is a similar polling loop in the plug-in, at least in the sample code from the SDK (from which most plug-ins are derived).  The sample code runs the polling at 10 Hz like in Mach3.  However, Mach4 is more forgiving of plug-ins that run the polling loop at a higher rate (as we do in our PMDX SmartBOB products).  AND...reporting of changes in inputs and outputs from the core back to the plug-ins is done asynchronously from that polling function - i.e. whenever the core is told an input signal changes, it sends a "signal changed" message to all of the plug-ins.  Mach4 is also more conducive to multi-threaded plug-ins, so it is possible that the state of the input signals can be updated to the Mach4 core as fast as the communication channel (USB, Ethernet, etc.) is able to send data from the device to the plug-in.  So, again, it all depends on the design of the device and plug-in.

That said - what functions are you concerned with Mach4 being able to detect and/or change "fast"?  Things like homing, probing and threading are usually controlled by the plug-in (or more likely, the device) itself with minimal coordination with the Mach4 core, because it has to respond to events like probe triggers and home switches faster than could happen if it relied on reporting to the Mach4 core and waiting for a response.

Bob
Re: How many time mach4 check input/output?
« Reply #2 on: June 10, 2015, 09:06:21 PM »
Tks for your reply.  I see, my problem in Macro. Macro in Mach3 process Input/Output slow. Do this problem improve in Mach4?

Bellow my GCode Process:

- Call Macro A
- Move X1,Y1
- Call Macro B

- Call Macro A
- Move X2,Y2
- Call Macro B

.....

Macro A, B: process Multiple Input/Output.


Rgs




Re: How many time mach4 check input/output?
« Reply #3 on: June 10, 2015, 11:39:47 PM »
I don't know if the Lua scripts in Mach4 are faster/slower/same as the VisualBasic macros in Mach3, though my gut feeling says the Mach4 Lua scripts will be faster.  I'll leave the true answer to someone else here that has more experience with this.

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: How many time mach4 check input/output?
« Reply #4 on: June 11, 2015, 12:00:36 AM »
depending on whats in the script it can be blink and its done