I am developing a proprietary app in Realbasic to pick and place parts onto an SMT board. I use Mach3 daily for machining parts for my product. On the same computer Mach 3 runs the motors very smoothly. With my app, using a parallel port plugin called Inpout32.dll, the motion from the stepper loop has hickups twice a second. I had thought that Mach 3 was Visual Basic based, so that maybe it used the same plugin which is popular among VB and RB developers. I can't use Mach 3 to position the parts as there are a number of values per move that need to be input for the operator, Mach 3 can't manage the structure I want to use, so I need a new app. I would like to get an idea from my Mach3 app as to how it is processing the step and direction output regiuters. Currently I am doing something like:
A single byte for the output registers (pins 2-9) bits 0 - 7
example is byte 0 = direction for X, byte 1 is step pin for X
//set dir based on where it has to go
//loop this code, include accel and decel functions
00000000 //direction pin = 0
01000000 //turn on step pin for X
00000000 //turn step back off
Pause SpeedRate //set speed of motor/loop
Mach runs the same motors fine, so I know the port and outputs have the potential. I need to understand what method is best for looping the motor, if anyone has any suggestions on this I'd appreciate it. Thanks