borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Next Topic (Error code structure) New Topic New Poll Post Reply
AndreaVB Forum : VB General : Interfacing to an external counter
Poster Message
gearcutter
Level: Trainee

Registered: 14-05-2008
Posts: 3

icon 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
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 1030
icon Re: Interfacing to an external counter

Hi
I ran "vb6 usb" through google and found this article on xtreme vb (http://www.xtremevbtalk.com/showthread.php?t=194925). There's loads of links there.
What specific problem did you have and what have you tried?
Regards
Kieron


____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

15-05-2008 at 04:24 AM
View Profile Send Email to User Show All Posts | Quote Reply
gearcutter
Level: Trainee

Registered: 14-05-2008
Posts: 3
icon 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
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 1030
icon Re: Interfacing to an external counter

I have not used USB stuff personally(& i don't have a usb device in this manner), however, the links do have examples.
Is there one similar? If so, what problems are you having with it and i'll look at the code.

Hope this helps
Kieron


____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

16-05-2008 at 05:02 AM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 1030
icon Re: Interfacing to an external counter

HI
Looking at the Velleman site, it comes with vb6 code, and has a support forum.
No direct experience of this tho, it looks like you install the dll on your machine and call functions on it.
The functions look quite straightfwd (from their help PDF anyway).
You may have an issue with vb6 timers so you should look into accurate timers too (the vb6 timer control just won't be good enough for the accuracy you need on a miller)

Hope this helps,
Kieron


[Edited by stickleprojects on 16-05-2008 at 05:14 AM GMT]

____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

16-05-2008 at 05:12 AM
View Profile Send Email to User Show All Posts | Quote Reply
gearcutter
Level: Trainee

Registered: 14-05-2008
Posts: 3
icon 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
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : Interfacing to an external counter
Next Topic (Error code structure) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Il portale per lui e lei | Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder