Results 1 to 18 of 18

Thread: Drive hardware with RS232

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2006
    Posts
    39

    Drive hardware with RS232

    I am writing a program which has only 6 to 8 single commands. I want to transmit these commands to an output to control a hardware, does the serial port work in this case? If yes, how to achieve this?(or any other method?)

    Thanks for answering
    Last edited by wil123; Apr 12th, 2006 at 02:53 AM.

  2. #2
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,713

    Re: Electrical pulse output

    You can use the serial port or COM port using the MSCOMM control from vb. You can add the control to your toolbox by clicking Project > Components > Controls tab > MS Comm Control > OK.
    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

  3. #3
    Addicted Member Vegeta's Avatar
    Join Date
    Jul 2002
    Posts
    159

    Re: Electrical pulse output

    Its quite easier to use the parallel port because it supports 8 output wires and (not quite sure) 5 status wires to check for current.
    For controlling I used the inpout dll for win 95/98 or NTPort for win2k (http://www.zealsoftstudio.com)

  4. #4

    Thread Starter
    Member
    Join Date
    Jan 2006
    Posts
    39

    Re: Electrical pulse output

    If I use a 9-pin COM port, can I just control the output voltage of pin3 to differentiate different commands?

  5. #5
    Fanatic Member lerroux's Avatar
    Join Date
    Nov 2005
    Location
    Welcome to the darkside... we have cookies
    Posts
    646

    Re: Drive hardware with RS232

    i guess that would be possible, have'nt really tried it though...
    WARNING: Excessive coding is dangerous to your health... if symptoms persist insult your doctor...

  6. #6
    Hyperactive Member
    Join Date
    Feb 2003
    Location
    Grenada
    Posts
    346

    Re: Drive hardware with RS232

    The Comport only has 1 output stream... and you have no control over the voltages, apart from it being -ve value (0 bit) and +ve value (1 bit)... and the data is in serial, so you WILL need a demultiplexer or UART driver IC at the other end...

    The easiest way is with the Parallel port... BUT is would be wise to incorporate a Hardware buffer at the end, so you don't damage your motherboard by accident.
    If my post has been helpful, then please rate it accordingly...
    If it has solved your question(s), then don't forget to mark the thread as "[Resolved]"... thank you.

  7. #7

    Thread Starter
    Member
    Join Date
    Jan 2006
    Posts
    39

    Re: Drive hardware with RS232

    Can I just solder the port output to the hardware?

    Can someone kindly help for defineing the port with parallel port? This is the first time for me to work on the interface.

  8. #8
    Hyperactive Member
    Join Date
    Feb 2003
    Location
    Grenada
    Posts
    346

    Re: Drive hardware with RS232

    You CAN solder the port output directly to the hardware... provided that:

    #1 - The hardware can accept the voltage ranges from -15 to +15
    #2 - The hardware doesn't feed back any surplus current to the Comm device

    Maybe if you can give an example of what hardware you'd like to control I can help you... I've built robots and other gizmos that interface with a PC using various ports...

    As for the printer Port, the default port for LTP1 is &H378 or in decimal 888
    &H378 is for the Printer port data lines...
    If my post has been helpful, then please rate it accordingly...
    If it has solved your question(s), then don't forget to mark the thread as "[Resolved]"... thank you.

  9. #9

    Thread Starter
    Member
    Join Date
    Jan 2006
    Posts
    39

    Re: Drive hardware with RS232

    Actually I have a programme which have 6-8 indepentent commands. And those commands are required to drive a commercial joypad.

    Really thanks for helping me.

  10. #10
    Hyperactive Member
    Join Date
    Feb 2003
    Location
    Grenada
    Posts
    346

    Re: Drive hardware with RS232

    So if I understand what you're saying...

    You want to use the joystick to control a peripheral device?

    OR the Joystick IS the peripheral device that's attached to the Serial port, and you want to use that to run a program?

    ============================================

    If you're satified and problem is solved, then please mark this thread as resolved... thanks...
    If my post has been helpful, then please rate it accordingly...
    If it has solved your question(s), then don't forget to mark the thread as "[Resolved]"... thank you.

  11. #11

    Thread Starter
    Member
    Join Date
    Jan 2006
    Posts
    39

    Re: Drive hardware with RS232

    My program is to control the joystick so as to control the other computer

  12. #12
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,692

    Re: Drive hardware with RS232

    What's the hardware interface to the joystick? Serial? Parallel? Something else? That's going to determine what you're going to use to control it.

  13. #13
    Hyperactive Member
    Join Date
    Feb 2003
    Location
    Grenada
    Posts
    346

    Re: Drive hardware with RS232

    Now I'm confused more than ever... how are you going to "control" the joystick?
    Aren't joysticks themselves controllers...??
    If my post has been helpful, then please rate it accordingly...
    If it has solved your question(s), then don't forget to mark the thread as "[Resolved]"... thank you.

  14. #14
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    Re: Drive hardware with RS232

    Hmm...
    With a little search on this forum:
    http://www.vbforums.com/showthread.php?t=394943

  15. #15

    Thread Starter
    Member
    Join Date
    Jan 2006
    Posts
    39

    Re: Drive hardware with RS232

    Let me make myself clear.

    I want my program in computer A give commands to control a joystick which is connected to computer B. The joystick is connected via USB. There are only 8 commands in the program.

    The joystick is essential since it is used to simulate a situation that my program is able to control a hardware.
    Last edited by wil123; Apr 13th, 2006 at 08:52 AM.

  16. #16
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    Re: Drive hardware with RS232

    You have to dismantle your joystick. If it is analog forget it. Otherwise mount some relais over the switches and connect these to the comm-port.

  17. #17

    Thread Starter
    Member
    Join Date
    Jan 2006
    Posts
    39

    Re: Drive hardware with RS232

    Quote Originally Posted by namrekka
    You have to dismantle your joystick. If it is analog forget it. Otherwise mount some relais over the switches and connect these to the comm-port.
    Just connect with pin2 to 9? How to determine if it is possible for direct connection?

  18. #18
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,692

    Re: Drive hardware with RS232

    If the port is USB, you don't have the normal RS-232 pins - you have Data(+) and Data(-) pins. You can't use that - without some additional hardware - to control 8 individual control lines, if that's what you need to do. The joystick won't take commands on its USB port - it OUTPUTS on that port.

    You can't send commands to the joystick to make the joystick output to the computer, which is what it sounds like what you want to do. About the best you can do is a) simulate the joystick with another device which is designed to get commands from your computer and send USB signals to the other computer, or b) control the program in the other computer with direct serial commands sent to a serial port on that computer.

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