Results 1 to 15 of 15

Thread: [RESOLVED] control stepper motor via parallel port

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    584

    Resolved [RESOLVED] control stepper motor via parallel port

    hi,please help.how to control the stepper motor via parallel port??
    current i want to control the stepper motor rotation via parallel port.
    now the problem is i don't know how to start control the stepper motor rotation.

    i have start the parallel port connect code as below:
    Code:
    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)
    
    Option Explicit
    Dim value As Integer
    Dim portaddress As Integer
    
    Private Sub Cmdinputsignal_Click()
    Text2.Text = Inp(portaddress)
    End Sub
    
    Private Sub Form_Load()
    portaddress = &H378 ' LPT1
    End Sub
    
    Private Sub cmdoutputsignal_Click()
    value = Text1.Text
    Out portaddress, value
    
    End Sub
    please help.Thanks.

  2. #2
    PowerPoster CDRIVE's Avatar
    Join Date
    Jul 2007
    Posts
    2,620

    Re: control stepper motor via parallel port

    I received your PM but as I've stated repeatedly, the parallel port is not my subject of expertise.
    <--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
    If topic has been resolved, please pull down the Thread Tools & mark it Resolved.


    Is VB consuming your life, and is that a bad thing??

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: control stepper motor via parallel port

    I remember this homework project but I did it on the serial port. Still same logic.
    Send your commands as binary which will get your desired pins to transmit a 1 or a 0.

    Did you create a driver circuit for this yet? The ports off the motherboard are not high output enough to drive a stepper motor on their own and you will risk blowing your board without it.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    584

    Re: control stepper motor via parallel port

    RobDog888:
    hi,yes i already create the stepper motor driver.The problem now is i have no idea how to start the coding to control the stepper motor rotate left and right.

    please help.thanks.

  5. #5
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: control stepper motor via parallel port

    Never done this kind of thing but see if this helps you...

    http://www.codeproject.com/KB/vbscri...r_Control.aspx

    Also if you type "Stepper" in the link below, you will get plenty of stuff to play around with...

    http://www.labjack.com/forums/index.php?act=Search&f=

    Hope this helps...
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  6. #6
    PowerPoster CDRIVE's Avatar
    Join Date
    Jul 2007
    Posts
    2,620

    Re: control stepper motor via parallel port

    I don't know what your level of understanding is, in regard to the stepper itself, so perhaps this will be of use to you.

    http://www.imagesco.com/articles/picstepper/02.html
    <--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
    If topic has been resolved, please pull down the Thread Tools & mark it Resolved.


    Is VB consuming your life, and is that a bad thing??

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    584

    Re: control stepper motor via parallel port

    CDRIVE:
    hi,basically i'm able to rotate the stepper motor at the moment.
    now the problem is how to control the stepper motor by send one pulse to stepper motor will rotate one step.

  8. #8
    PowerPoster CDRIVE's Avatar
    Join Date
    Jul 2007
    Posts
    2,620

    Re: control stepper motor via parallel port

    Here's a thread in which the TS is controlling LEDs via the Parallel Port. The concept should be the same except you will need to toggle the desired pin only briefly.

    http://www.martin2k.co.uk/forums/ind...showtopic=6234
    <--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
    If topic has been resolved, please pull down the Thread Tools & mark it Resolved.


    Is VB consuming your life, and is that a bad thing??

  9. #9
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: control stepper motor via parallel port

    Did you also check the links that I gave you?
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  10. #10
    PowerPoster CDRIVE's Avatar
    Join Date
    Jul 2007
    Posts
    2,620

    Re: control stepper motor via parallel port

    VB Forums is, without a doubt, the finest VB forum in the entire world. However, you dabble in interfacing VB and your electronics projects. Therefore, I invite you to join All About Circuits Forum that will compliment your membership here at VB Forums but definitely not replace it.

    http://forum.allaboutcircuits.com/

    They have a coding section also.
    <--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
    If topic has been resolved, please pull down the Thread Tools & mark it Resolved.


    Is VB consuming your life, and is that a bad thing??

  11. #11

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    584

    Re: control stepper motor via parallel port

    cdrive,koolsid:
    thanks for your information.

  12. #12

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    584

    Re: control stepper motor via parallel port

    CDRIVE,koolsid:
    hi,thanks now i'm able to rotate the stepper motor.now i face another problem i want to get the input signal from parallel port pin 1 value to display at text3.text to do some validation,but i cannot the the signal input from pin1.

    Text3.Text = Inp(&H37A)
    If Text3.Text <> 255 Then
    MsgBox (Text3.Text)
    Exit Sub
    End If

    please help.thanks.

  13. #13
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: control stepper motor via parallel port

    Assuming that Inp(&H37A) is correct, try this to check if it is working...

    vb Code:
    1. If Val(Inp(&H37A)) <> 255 Then
    2. MsgBox Val(Inp(&H37A))
    3. Exit Sub
    4. End If
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  14. #14

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    584

    Re: control stepper motor via parallel port

    koolsid:
    thanks is work.

  15. #15
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: [RESOLVED] control stepper motor via parallel port

    Glad it worked
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width