USBDemo, something to learn USB a little bit


Closed Thread
Results 1 to 40 of 279

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default I Can't I Can`t i really donīt understand

    Hi.

    To Mister_E or anyone that really understand this (i clearly donīt). I made this post already but none seemed to understand it, so i am posting again in other words.

    I made this software that controls an USB device, it all began with Mister_E`s demo, it is working really fine now, no problems with it. NOW i want to use two devices, same software!. Lets say this is a temperature sensor, now i want to measure two diferent points so i wanīt to connect two diferent sensors. HOW can i differentiate both devices? when i connect the second one the first connected gets useless (I am sure the handler is replaced).

    Iīve been reading the whole code for Visual Basic and PBP, i donīt intend to change my device ID and Product ID.. this would be useless. Does the Driver easyHID only works with one device?

    Please give me a little advice on this matter.. How can i use two different handlers?

    Thanks

    DJC

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    2 different ways
    1) assign, then read the device serial number -> this has to work
    2) use a specific data byte in DataToSend as identifier -> not 100% sure of it
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3


    Did you find this post helpful? Yes | No

    Default But one of the devices just..

    Hi.. thanks for your reply Mister_E.

    I have this problem with both solutions!... i dont have two working devices when i connect them... i just have one! When i connect the second one the first connected doesnīt work!
    My guess is that this happens because the handler of the first connected device is lost and replaced for the second one.. hence my sent data (from pc to device) is just received in one of the ports (this is for sure!) so it wouldnīt work to use the serial number because i canīt even get it :s.

    The same reason for the second choice.

    I also think that both devices could have exactly the same software, my guess is that this is a matter of software (in VB), there should be a way to create two different connections (what i call handlers) but i donīt get where this is done in the code Sub ConnectHID().

    Again maybe i am thinking this wrong but this is what you would do with two diferent serial devices in different serial ports, you would have two different interrupt routines in the VB software to control each one.

    I really hope someone could guide me here, has none connected two devices?

    Thanks again for your time and concern,

    DJC

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    i already done that... i just need to find out where... i had to do some unwanted Hard-Disk clean-up recently... i hope i still have it somewhere, unless i may try to redo it once again.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5


    Did you find this post helpful? Yes | No

    Red face A whole week and no answers :(

    Hi!

    I was hoping somenone could give any ideas on my subject, its been more than a week and no post here, You donīt have to know the solutions... lets just talk about your oppinions or ideas

    Thanks for any help

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    i already gave mine, maybe yu could check on wich hub/port a specific device is connected... i just don't have any spare time... but i could deal with few K-CAN$
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    I can't speak for Visual Basic, but in Delphi, you request a list of HID devices, and each one has it's own "Handle".

    If two devices have the same Vendor/Product ID's then you look for the serial number to tell the difference. But access to the device is by specifying the Handle.

    Here's a small program that can identify the serial number and handle. Note: the handle changes on every connection or power-up/re-boot.

    www.pbpgroup.com/files/HIDmonitor.exe
    Put it anywhere, there is no installation to do.
    <br>
    DT

Similar Threads

  1. Bits, Bytes Words and Arrays
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 24
    Last Post: - 14th June 2016, 07:55
  2. How to receive stream of bytes using PIC USART
    By unifoxz in forum mel PIC BASIC Pro
    Replies: 34
    Last Post: - 20th June 2009, 10:38
  3. Replies: 9
    Last Post: - 31st July 2008, 08:56
  4. PICBasic newbie problem
    By ELCouz in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 12th February 2008, 00:55
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 01:07

Members who have read this thread : 1

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

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