I think you want to use the parallel port rather than the serial port. I've done what I think you want to do, but not in LabView.
I have a Taig benchtop milling machine that I built my own stepper control box for (based on the allegro chips). It like every hobby CNC machine I've seen uses step and direction lines for each axis. IE, when the direction line is pulled high, each pulse on the step line moves one direction, when the direction line is pulled low, each pulse moves the stepper the other way. This very low-level of control is quite popular in CNC machine tools and allows the controller to blend axes for circles etc.
You've got a couple issues with trying to do this level of stepper control with LabView, the main issue is windows itself, the latencies out the parallel port is quite long due to the hardware abstraction layer in windows. Second is the lack of determinism in windows. So even after your pulses (IE data) start spewing out the serial port, there is no guarantee that all your data will come out in a smooth consistent manner. Rather, there will be a splatter of data, a pause while windows does something else, then another splatter of data.
This is a real issue when controlling either steppers or servos with step and direction type of controls. Because the step pulse train is directly linked to motor speed. Any fast changes in the pulse train period will cause motor stalls or other very undesirable behavior. You can get around this to some extent by working very slowly.
My workaround is to use TurboCNC (you get the source code when you register), which is a turboPascal program that runs in DOS. DOS is so simple that it's quite deterministic and you can get nice consistent pulse trains out the parallel port. I use various windows programs to build my parts, and generate G-Code (Autodesk inventer, meshcam, MasterCam, etc). I've also written some, not-for-prime-time, Labview routines to edit G-code, view toolpaths, and unroll loops, etc.
To use a non-real-time OS to control real-time critical tools like this, you can always build a hardware buffer. Imagine a hardware Queue where your pulses are pushed into one side of the queue sporadically, and a hardware clock pops them out of the queue to your controller in nice smooth increments. I've been toying with building such a thing, but honestly, the DOS turboCNC program works so well that it's not high on my list.
The beauty of DOS and turboCNC is that you can use a $40 small laptop to control your machine. I have a 486 HP laptop sitting on top of my controller next to my mill. Small, cheap and effective, everything I want.
Pushing your data out of the parallel port is fairly easy in LabView, and parsing G-code is also quite easy, but before you spend much time on it, make sure the data coming out your parallel port is suitable for your needs from a timing standpoint.
Hope that helps,
Sheldon
Message Edited by Sheldon Stokes on 09-27-2005 09:01 AM
Technical geek, engineer, research scientist, biodegradable...