Hi,
I can't find how can I transmit signals for step/dir from Mach3 to Arduino.
That is not possible. USB is a serial communication protocol and so any timing of step/dir signals gets hoelessly
screwed up.
You might ask 'well how do others do it, I've seen USB connected devices producing step/dir pulses?'
The reason is because Mach does not send step/dir pulses to a USB board, it sends P(osition)V(elocity) over T(ime)
data from its trajectory planner. That is it sends a stream of numeric data and the USB CONVERTS that numeric data
to PULSE STREAMS which it presents to the outside world in PARALLEL. That makes the USB device an external motion
controller.
You could make an Arduino into an external motion controller, but it would be challenging. Firstly the Arduino is way
too small and lacking in power. Most external controllers have a mid-level FPGA and/or a 32bit microcontroller either
or both of which make an Arduino look like a minnow.
You would have to code a plugin (that lives on the PC) in C++ to drive the Arduino (or other control device).
If you were going to all that trouble you wouldn't bother with Mach3, its pretty old and is now unsupported. You would
have to use a really old and creaky version of Visual Studio. You would in preference use Mach4 which is at least current
and has a well developed SDK. You would need to sign a N(on)D(isclosure)A(rgeement) with NFS but then you would
get all the inside info you need.
Why don't you use an external motion controller like an Ethernet SmoothStepper directly? Note Mach3 and Mach4 have MODBUS
plugins, but the Mach4 plugin
IS SO MUCH EASIER TO USE AND UNDERSTAND. It still wont communicate step/dir
in realtime but it is a dream to program and use.
Craig