Hi Black

Glad to know I'm not the only geek hereabouts, I can now do tech speak :o)

I'm writing a sort of package, a new EPROM for the Roland and a Windows program to drive it on a modern, 64 bit machine without parallel and serial ports, which seem to have been consigned to the dustbin of history.

Windows isn't designed for CNC so you need a seperate processor to do the step timing, the Roland processor is an easy choice. If you look at the Roland circuit diagram you will see a maskable interrupt for the comms and a non-maskable interrupt for the step timing. Using the serial port at 9600 restricts the data flow to manageable levels without handshaking, makes it easy. I vector the NMI interrupt to different service routines for Idle, Jog, Move, Brake, Home and CNC. The service routines never kill the comms interrupt long enough to get overrun errors so I can use a USB to serial adaptor without trying to configure it. The CNC interrupt pulls data out of the command buffer, the serial interrupt keeps the buffer topped up. The main body of the program just sits in an idle loop, fiddling with the LED's, looking to see if a button has been pressed, wondering if it should send anything to the host.

I send it pre-digested straight line cuts, it sends me status data, basically where it is, current feed rate and how full the command buffer is. If the command buffer drops below 800 I send it another 10 lines to cut. I haven't done error handling yet because it hasn't thrown any comms errors, (although I do check).

Of course everything in Windows is event driven, you have to keep passing control back or you end up in a "Program is not responding" condition. I open a seperate thread to talk to the Roland which keeps the buffer topped up, requests the Roland status and then goes to sleep for a few mS before checking to see if it has enough bytes in the receive buffer. It wakes the main thread up when it is time to repaint the screen. If Windows decides to do something more important and doesn't come back for half a second it doesn't matter. With 800 commands in it's buffer the Roland is good to go for a minute of so without contact with the PC, you can shrink my program down, check your emails, do a bit of CAD etc. I use the feed rate display on the Roland to show how full the command buffer is, it's reassuring.

I hear what you say about the home switches, they close sweetly enough, bounce like crazy when you open them. I find them, back off and then close them again at a slower feed rate. I get errors of one step on the Y, perfection on X and Z.

best

Robin