Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Control Stepper motor with parallel port

Status
Not open for further replies.

saathis

Member level 1
Joined
Dec 11, 2010
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,601
Dear helpers,

I need help to code in vb6 that D1 of parallel port goes high then stepper motor have rotate forward to open door.... then D2 of parallel port goes low then stepper motor have to rotate reverse to close door...... how can make it in vb6.0..... i got references in C, VB.net but i want do in vb6.0.... anyone can help me....please please please it very urgent case....
 

CMOS

Advanced Member level 3
Joined
Jan 6, 2004
Messages
864
Helped
94
Reputation
186
Reaction score
50
Trophy points
1,308
Location
USA
Activity points
5,683
There is no function in VB to access parallel port directly. You need to use a DLL like InpOut32.dll. Check this Parallel Port
 

saathis

Member level 1
Joined
Dec 11, 2010
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,601
Option Explicit
Public Declare Function Inp Lib "inpout32.dll" _
Alias "Inp32" (ByVal PortAddress As Integer) As Integer
Public Declare Sub Out Lib "inpout32.dll" _
Alias "Out32" (ByVal PortAddress As Integer, ByVal Value As Integer)
Private Declare Sub Sleep Lib "Kernel 32" (ByVal dwMilliseconds As Long)


You mean this coding right i have create module thn i put this coding this into module....... now how to code D1 goes high to rotate stepper motor rotate foraward few seconds... thn D2 goes low to rotate stepper motor rotate reverse few seconds.....
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
48,211
Helped
14,207
Reputation
28,673
Reaction score
12,903
Trophy points
1,393
Location
Bochum, Germany
Activity points
279,282
The question implies, that you have stepper motor controller generating the step frequency and motor waveforms on it's own. But you didn't mention the motor type or existing hardware.

The usual purpose of a step motor is to perform a step-accurate positioning. This won't be achieved, if the motor moves for- and backward, while a digital input is set. It's more common to perform individual steps by the controlling computer. Or output the phase signals (mostly four) from the computer and have a simple driver IC (like ULN2803) as motor interface.
 

CMOS

Advanced Member level 3
Joined
Jan 6, 2004
Messages
864
Helped
94
Reputation
186
Reaction score
50
Trophy points
1,308
Location
USA
Activity points
5,683
Use the functions like this
Code:
' Forward
call Out (888, 01) ' 888 is the most common parallel port address. Check if yours is different in BIOS settings. 01 = Data port value (D1 = High)

call sleep(5000) ' Wait for 5 seconds. Note that this will make your application non-responsive. Use of Timer is recommended

' Reverse
call Out (888, 02) ' 02 = Data port value (D2 = High)

call sleep(5000) ' Wait for 5 seconds. Note that this will make your application non-responsive. Use of Timer is recommended

call Out(888, 00) ' 00 = Motor stop ?? (D1 = D2 = Low)
 

saathis

Member level 1
Joined
Dec 11, 2010
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,601
Yes Mr.FvM im using ULN 2803A T Base IC.... motor is unipolar type.... so cn u give me guide how to set D1 goes high then rotate motor few seconds???....

Thank Mr.CMOS.... i il try explore it....
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
48,211
Helped
14,207
Reputation
28,673
Reaction score
12,903
Trophy points
1,393
Location
Bochum, Germany
Activity points
279,282
To drive the stepper by ULN2803 without additional motor controller chips, you would connect four LPT port lines, one for each motor phase. And send the required signal pattern to drive the stepper motor from your VB program, either full or half steps. Just refer to the "Similar Threads" shown at the bottom of this page.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top