 |
gearcutter Level: Trainee
 Registered: 14-05-2008 Posts: 3
|
Interfacing to an external counter
As a new programmer, I have a problem. I wish to count pulses from an external digital counter (probably via a Velleman USB interface card). I know how to access the 'internal counter' in VB6, but how do I count a stream of external pulses? the ultimate aim is to count them and then stop counting after a pre-determined number is reached. the pulses are being used to pulse a stepper motor on a small milling machine.
Gearcutter
____________________________
Neville Horsfield
|
|
14-05-2008 at 11:22 AM |
|
|
gearcutter Level: Trainee
 Registered: 14-05-2008 Posts: 3
|
Re: Interfacing to an external counter
Thanks Kieron.
I,m trying to control a rotary table on my milling machine for cutting gearwheels, using a VB6 programme to calculate the number of pulses required by the stepper motor for a certain degree of revolution per gearwheel tooth. I have the VB6 programme up and running, but am finding it difficult to find any written matter, regarding the Calls in VB6 to acces the stepper, via say a Velleman USB Interface Card.
For instance, is it possible to open a serial port via the card, then feed a given number of pulses out to the motor, then close the port? I can utilise the Timer function in VB6 to generate the pulses.
Gearcutter
____________________________
Neville Horsfield
|
|
15-05-2008 at 01:14 PM |
|
|
gearcutter Level: Trainee
 Registered: 14-05-2008 Posts: 3
|
Re: Interfacing to an external counter
Hi,
I think the internal VB6 Timer should be OK. All it has to do is supply a series of pulses which activate the stepper motor. It is only being used for rotational positioning of a rotary table, not for the actual cutting process. I am contemplating buying the Velleman Kit from Maplin (Part No: N67BH). All it really needs to do is open a serial channel on command, and allow a predetermined number of pulses through to the motor, then send a Stop bit on a second channel back to the VB6 programme. The tooth is then cut, and the process repeated to index the rotary table to the next tooth position.
gearcutter
____________________________
Neville Horsfield
|
|
16-05-2008 at 02:31 PM |
|
|
|
|
 |
 |