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. C / C++ / MFC
  4. Read and write USB device

Read and write USB device

Scheduled Pinned Locked Moved C / C++ / MFC
c++comtutorial
9 Posts 2 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.
  • S Offline
    S Offline
    Sarvan AL
    wrote on last edited by
    #1

    Hi Geniuses, We have developed an application in VC6.0 to configure a device (with single PCB) thru' serial communication (COM port). Now we need to provide USB interface also. So far I have searched a lot to get the information on handling USB devices in VC++ application. But in vain. If anyone could guide me to get required information, it would be greatly appreciated. Thanks in advance, Sarvan AL

    C 1 Reply Last reply
    0
    • S Sarvan AL

      Hi Geniuses, We have developed an application in VC6.0 to configure a device (with single PCB) thru' serial communication (COM port). Now we need to provide USB interface also. So far I have searched a lot to get the information on handling USB devices in VC++ application. But in vain. If anyone could guide me to get required information, it would be greatly appreciated. Thanks in advance, Sarvan AL

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      USB port is not managed the same way as serial port. What you have to do, is open the driver (with CreateFile) that is associated with your device (should have been supplied with the device) and send commands through DeviceIOControl function. All this information should have been supplied also with your device. In a particular case, it can be used like a standard COM port: it is when you use a USB to serial converter. In that case, the driver will create a virtual COM port that you can open like a standard COM port. If you provide more information about the device, it would be nice.


      Cédric Moonen Software developer
      Charting control

      S 1 Reply Last reply
      0
      • C Cedric Moonen

        USB port is not managed the same way as serial port. What you have to do, is open the driver (with CreateFile) that is associated with your device (should have been supplied with the device) and send commands through DeviceIOControl function. All this information should have been supplied also with your device. In a particular case, it can be used like a standard COM port: it is when you use a USB to serial converter. In that case, the driver will create a virtual COM port that you can open like a standard COM port. If you provide more information about the device, it would be nice.


        Cédric Moonen Software developer
        Charting control

        S Offline
        S Offline
        Sarvan AL
        wrote on last edited by
        #3

        Hi Cedric, Thanks a lot for your reply. Let me tell you about the device. It's a box like device with single PCB. As on now, only serial port has been provided. We are not writing the firmware of the device. We are developing only the GUI to configure the device. Hope we need to have the device drivers from the device manufacturer. Could you tell me few more about DeviceIOControl? It would be more helpful to a newbie, like me. Thanks once again, Sarvan AL

        C 1 Reply Last reply
        0
        • S Sarvan AL

          Hi Cedric, Thanks a lot for your reply. Let me tell you about the device. It's a box like device with single PCB. As on now, only serial port has been provided. We are not writing the firmware of the device. We are developing only the GUI to configure the device. Hope we need to have the device drivers from the device manufacturer. Could you tell me few more about DeviceIOControl? It would be more helpful to a newbie, like me. Thanks once again, Sarvan AL

          C Offline
          C Offline
          Cedric Moonen
          wrote on last edited by
          #4

          Yes, but this device provide a USB port no ? With this USB port, there must also be a driver supplied in order to use it on your computer. Can you tell me more about that ? DeviceIOControl[^] but documentation should be supplied with your driver that describes which command to send to the driver.


          Cédric Moonen Software developer
          Charting control

          S 1 Reply Last reply
          0
          • C Cedric Moonen

            Yes, but this device provide a USB port no ? With this USB port, there must also be a driver supplied in order to use it on your computer. Can you tell me more about that ? DeviceIOControl[^] but documentation should be supplied with your driver that describes which command to send to the driver.


            Cédric Moonen Software developer
            Charting control

            S Offline
            S Offline
            Sarvan AL
            wrote on last edited by
            #5

            Hi Cedric, I'd like to know that other than device, what are all the things we should get from the USB device manufacturer, like DLL and LIB files, documents, etc. Since I am new to USB interface, if you could provide still more information, I would be grateful. Thanks & Regards, Sarvan AL

            C 1 Reply Last reply
            0
            • S Sarvan AL

              Hi Cedric, I'd like to know that other than device, what are all the things we should get from the USB device manufacturer, like DLL and LIB files, documents, etc. Since I am new to USB interface, if you could provide still more information, I would be grateful. Thanks & Regards, Sarvan AL

              C Offline
              C Offline
              Cedric Moonen
              wrote on last edited by
              #6

              Please provide more information about this USB device. Did you buy it ? Is it something like a development kit ? If yes, you should have received documentation with. Take a look at it, it will provide much information than I can (every device is specific). But typically, what you should receive is a driver (.sys) and the corresponding INF files (needed for the plug and play) and probably a header file that defines constants to be used with DeviceIOControl.


              Cédric Moonen Software developer
              Charting control

              S 1 Reply Last reply
              0
              • C Cedric Moonen

                Please provide more information about this USB device. Did you buy it ? Is it something like a development kit ? If yes, you should have received documentation with. Take a look at it, it will provide much information than I can (every device is specific). But typically, what you should receive is a driver (.sys) and the corresponding INF files (needed for the plug and play) and probably a header file that defines constants to be used with DeviceIOControl.


                Cédric Moonen Software developer
                Charting control

                S Offline
                S Offline
                Sarvan AL
                wrote on last edited by
                #7

                Hi Cedric, The device with USB interface is under development. As the second phase, we going to develop the GUI application with USB interface. The device manufacturer is our client. So we should be able to tell them the required things to provide us for developing the GUI application. Hope I've explained clearly. Thanks & Regards, Sarvan AL

                C 1 Reply Last reply
                0
                • S Sarvan AL

                  Hi Cedric, The device with USB interface is under development. As the second phase, we going to develop the GUI application with USB interface. The device manufacturer is our client. So we should be able to tell them the required things to provide us for developing the GUI application. Hope I've explained clearly. Thanks & Regards, Sarvan AL

                  C Offline
                  C Offline
                  Cedric Moonen
                  wrote on last edited by
                  #8

                  As far as I know, there should be a driver associated with this device. Maybe you should ask them more information about that.


                  Cédric Moonen Software developer
                  Charting control

                  S 1 Reply Last reply
                  0
                  • C Cedric Moonen

                    As far as I know, there should be a driver associated with this device. Maybe you should ask them more information about that.


                    Cédric Moonen Software developer
                    Charting control

                    S Offline
                    S Offline
                    Sarvan AL
                    wrote on last edited by
                    #9

                    Hi Cedric, As you said, We will ask the client more information about the device, its drivers and required files for PC support. Thanks a lot for spending your time for me. Sarvan AL

                    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