Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. UBS or Parallel Port

UBS or Parallel Port

Scheduled Pinned Locked Moved Visual Basic
help
15 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Christian Graus

    Wow - why are you using VB6 ?

    Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

    M Offline
    M Offline
    meki_2118
    wrote on last edited by
    #4

    My thesis has two hardware in it and the other hardware is a Finger Print scanner and I I've programmed it in VB6 and its working fine now. My thesis is kinda like a security system and I really need to know how to control my electronic lock in VB6 so that both of my devices will work properly. Can you help me with this problem??? thanks.

    1 Reply Last reply
    0
    • L Luc Pattyn

      If you only need a few digital input/output lines, the easiest is using the control lines of either a serial port or a parallel port. USB itself is complex, but if you have a USB-to- serial cable with its driver, it would behave like a regular serial port. I would go for .NET 2.0, C# (or VB.NET) and the SerialPort class. :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      Sorry for any delays in replying, I currently don't always get e-mail notifications.


      M Offline
      M Offline
      meki_2118
      wrote on last edited by
      #5

      Your right, I just really need a few I/O lines, Its just like switching on and off the light. Can give any tutorial sites, sample code or tips about my problem? And other thing is that I really need to use VB6 language for this thesis. Thanks for your reply I really appreciate it.

      C L 2 Replies Last reply
      0
      • M meki_2118

        Your right, I just really need a few I/O lines, Its just like switching on and off the light. Can give any tutorial sites, sample code or tips about my problem? And other thing is that I really need to use VB6 language for this thesis. Thanks for your reply I really appreciate it.

        C Offline
        C Offline
        CKnig
        wrote on last edited by
        #6

        It's a (long) while back but I think there used to be a ActiveX/OCX gadget for serial I/O. The parallel port is a pain ( I think you can only write a device driver to access it). IMHO a project like this (exotic hardware) should still be done in VC++ where you have the whole WinAPI at your fingertips (ever had to write some .net 1.1 wrappers for the serial port ?) and most 3rd party SDKs for their hardeware are still in C/C++.

        1 Reply Last reply
        0
        • M meki_2118

          Your right, I just really need a few I/O lines, Its just like switching on and off the light. Can give any tutorial sites, sample code or tips about my problem? And other thing is that I really need to use VB6 language for this thesis. Thanks for your reply I really appreciate it.

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #7

          Hi, I don't know how to control the control lines of a serial port without the help of the .NET SerialPort class, but I am confident there are some articles on this site that could help you; otherwise Google knows it all. :)

          Luc Pattyn [Forum Guidelines] [My Articles]


          Sorry for any delays in replying, I currently don't always get e-mail notifications.


          M 1 Reply Last reply
          0
          • L Luc Pattyn

            Hi, I don't know how to control the control lines of a serial port without the help of the .NET SerialPort class, but I am confident there are some articles on this site that could help you; otherwise Google knows it all. :)

            Luc Pattyn [Forum Guidelines] [My Articles]


            Sorry for any delays in replying, I currently don't always get e-mail notifications.


            M Offline
            M Offline
            meki_2118
            wrote on last edited by
            #8

            hi again. I've been thinking if you could help me to control the parallel port in VB .Net. I've already change the language that I'm going to use in my program and I used the VB .Net 2008. I'm really glad if you can help. Thanks.

            L 1 Reply Last reply
            0
            • M meki_2118

              hi again. I've been thinking if you could help me to control the parallel port in VB .Net. I've already change the language that I'm going to use in my program and I used the VB .Net 2008. I'm really glad if you can help. Thanks.

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #9

              meki_2118 wrote:

              VB .Net

              much better than VB6

              meki_2118 wrote:

              control the parallel port

              The SERIAL port has a couple of control lines, which can easily be written/read using the SerialPort class. There is no .NET support for parallel ports, and I have no experience whatsoever with parallel port (my PC does not have one either). :)

              Luc Pattyn [Forum Guidelines] [My Articles]


              Happy Holidays!


              M 1 Reply Last reply
              0
              • L Luc Pattyn

                meki_2118 wrote:

                VB .Net

                much better than VB6

                meki_2118 wrote:

                control the parallel port

                The SERIAL port has a couple of control lines, which can easily be written/read using the SerialPort class. There is no .NET support for parallel ports, and I have no experience whatsoever with parallel port (my PC does not have one either). :)

                Luc Pattyn [Forum Guidelines] [My Articles]


                Happy Holidays!


                M Offline
                M Offline
                meki_2118
                wrote on last edited by
                #10

                Do I still need to download the inpout32.dll to make the Serial Port work? Because I've read that you should first to install that to make the parallel port work. Is it also the same in the serial port? I would really like to control my electronic lock within two weeks because I'm getting close to the deadline of my thesis and its only 50% finished. Can help me how to control the serial port. I will really appreciate your help. Thanks. Happy Holidays! :)

                L 1 Reply Last reply
                0
                • M meki_2118

                  Do I still need to download the inpout32.dll to make the Serial Port work? Because I've read that you should first to install that to make the parallel port work. Is it also the same in the serial port? I would really like to control my electronic lock within two weeks because I'm getting close to the deadline of my thesis and its only 50% finished. Can help me how to control the serial port. I will really appreciate your help. Thanks. Happy Holidays! :)

                  L Offline
                  L Offline
                  Luc Pattyn
                  wrote on last edited by
                  #11

                  meki_2118 wrote:

                  Do I still need to download the inpout32.dll to make the Serial Port work?

                  No. To use the .NET classes you need the .NET Framework, nothing else.

                  meki_2118 wrote:

                  my thesis and its only 50% finished

                  Time to move ahead then. This thread is 9 days old, what serial port experiments have you performed since? Is your hardware ready? Did you check the number of lines you need, the voltage levels, the currents? :)

                  Luc Pattyn [Forum Guidelines] [My Articles]


                  Happy Holidays!


                  M 1 Reply Last reply
                  0
                  • L Luc Pattyn

                    meki_2118 wrote:

                    Do I still need to download the inpout32.dll to make the Serial Port work?

                    No. To use the .NET classes you need the .NET Framework, nothing else.

                    meki_2118 wrote:

                    my thesis and its only 50% finished

                    Time to move ahead then. This thread is 9 days old, what serial port experiments have you performed since? Is your hardware ready? Did you check the number of lines you need, the voltage levels, the currents? :)

                    Luc Pattyn [Forum Guidelines] [My Articles]


                    Happy Holidays!


                    M Offline
                    M Offline
                    meki_2118
                    wrote on last edited by
                    #12

                    Luc Pattyn wrote:

                    Time to move ahead then. This thread is 9 days old, what serial port experiments have you performed since? Is your hardware ready? Did you check the number of lines you need, the voltage levels, the currents?

                    This is the first time for me to program a hardware and it's also the first time for me to use the PC's port for programming. I'm really a newbie about this hardware programming. My hardware is still not ready because I'm planning to experiment it first with a LED light. I've heard that accessing the PC ports are dangerous and there's a risk burning your M.Board and I really don't want to happen that right now. And about the "number of line" your talking about I'm really clueless about that. I think I must first study how the serial port work. Am I right? Thanks again for your help. :)

                    L 1 Reply Last reply
                    0
                    • M meki_2118

                      Luc Pattyn wrote:

                      Time to move ahead then. This thread is 9 days old, what serial port experiments have you performed since? Is your hardware ready? Did you check the number of lines you need, the voltage levels, the currents?

                      This is the first time for me to program a hardware and it's also the first time for me to use the PC's port for programming. I'm really a newbie about this hardware programming. My hardware is still not ready because I'm planning to experiment it first with a LED light. I've heard that accessing the PC ports are dangerous and there's a risk burning your M.Board and I really don't want to happen that right now. And about the "number of line" your talking about I'm really clueless about that. I think I must first study how the serial port work. Am I right? Thanks again for your help. :)

                      L Offline
                      L Offline
                      Luc Pattyn
                      wrote on last edited by
                      #13

                      meki_2118 wrote:

                      I must first study how the serial port work. Am I right?

                      yes. whatever it is you will be using, you must study it.

                      meki_2118 wrote:

                      the "number of line" your talking about I'm really clueless

                      each serial port offers a few output lines and a few input lines. you must determine how many you need for your target hardware; if the port has fewer, it won't help you.

                      meki_2118 wrote:

                      I'm planning to experiment it first with a LED light

                      That is good. An LED will take some 10 mA and it sure needs a series resistor (say 1K). When it works, it shows your software is probably OK. But that might be the smaller part of the job. Before you implement something, you should: 1. study the technologies you are considering; 2. make a design. In your case: check number of lines, voltage levels, current requirements. Example: if your door lock needs 1 Amp to operate, the serial or parallel port will not be capable of supplying that, hence you would then need a power supply, a relay, and probably a transistor to control the relay. (A relay probably will need more than a few volts, and being inductive, I would not connect it to a PC directly). :)

                      Luc Pattyn [Forum Guidelines] [My Articles]


                      Happy Holidays!


                      M 1 Reply Last reply
                      0
                      • L Luc Pattyn

                        meki_2118 wrote:

                        I must first study how the serial port work. Am I right?

                        yes. whatever it is you will be using, you must study it.

                        meki_2118 wrote:

                        the "number of line" your talking about I'm really clueless

                        each serial port offers a few output lines and a few input lines. you must determine how many you need for your target hardware; if the port has fewer, it won't help you.

                        meki_2118 wrote:

                        I'm planning to experiment it first with a LED light

                        That is good. An LED will take some 10 mA and it sure needs a series resistor (say 1K). When it works, it shows your software is probably OK. But that might be the smaller part of the job. Before you implement something, you should: 1. study the technologies you are considering; 2. make a design. In your case: check number of lines, voltage levels, current requirements. Example: if your door lock needs 1 Amp to operate, the serial or parallel port will not be capable of supplying that, hence you would then need a power supply, a relay, and probably a transistor to control the relay. (A relay probably will need more than a few volts, and being inductive, I would not connect it to a PC directly). :)

                        Luc Pattyn [Forum Guidelines] [My Articles]


                        Happy Holidays!


                        M Offline
                        M Offline
                        meki_2118
                        wrote on last edited by
                        #14

                        hi. I've already studied how the serial port work and I already looked at the device I going to use. I think that I'm going to use two lines of the serial port. And my device will work like an florescent light, it is powered by a 220 volts. And the logic here is that my pc will only command the lock to turn on and off. But I don't know what pin to use and will I be still needing a transformer to change the voltage that will run through my pc? :) Happy New Year

                        L 1 Reply Last reply
                        0
                        • M meki_2118

                          hi. I've already studied how the serial port work and I already looked at the device I going to use. I think that I'm going to use two lines of the serial port. And my device will work like an florescent light, it is powered by a 220 volts. And the logic here is that my pc will only command the lock to turn on and off. But I don't know what pin to use and will I be still needing a transformer to change the voltage that will run through my pc? :) Happy New Year

                          L Offline
                          L Offline
                          Luc Pattyn
                          wrote on last edited by
                          #15

                          Hi, IIRC the pins DTR and RTS are output pins on the PC's serial port. They are controlled by the properties SerialPort.DtrEnable and SerialPort.RtsEnable. RS232C pins carry a DC voltage, anywhere in the range (-15V,+15V). They are capable of sourcing/sinking some 10 mA and not suited for larger currents, larger voltages, or direct connection to devices that are powered by the AC mains. If your door lock is powered by 220V AC mains directly, you will need galvanic isolation (you can't connect mains to your PC!); it also will need more than 10mA so you need some switching device, either a transistor/thyristor/triac or a relay, and probably both. It somewhat depends on the specs of the lock (see documentation!), and the distance between PC and lock. [ADDED] Instead of a transistor you could use an opto-coupler, which together with a relay would be able to control almost anything; the transmitter side of the opto-coupler would very much ressemble an LED, making your initial LED experiment much more relevant.[/ADDED] :)

                          Luc Pattyn [Forum Guidelines] [My Articles]


                          Happy 2008!


                          modified on Friday, January 04, 2008 7:40:49 AM

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups