Author Topic: HID device serial number  (Read 2720 times)

MarkHolbrook

  • Newbie
  • *
  • Posts: 15
    • View Profile
HID device serial number
« on: February 01, 2012, 11:49:52 pm »
Hello Roman, et el,

We are attempting to detect, connect to and read USB scales from Mettler.  These scales appear as HID devices.

I've used hiddemo project to connect to the device and read from it however there is a problem.  I cannot seem to figure out how to obtain the device serial number using hiddemo and the components within it.  I've looked at most of the properties for nrhid.hiddevice but nothing seems to contain the serial number.

A direct competitor of yours instantly shows the serial number upon scanning the USB devices.  This competitor library has some other issues which make me want to use nrComm however I need to see the serial number of the scale. 

In our application there will be up to 6 of these identical scales connected.  I plan to create a nrHID component in code for each one.   The only way we will know which scale to get data from for a specific measurement is to know the serial number of the scale.

Can you help me to figure out how to obtain the serial number using nrComm?   I've attached two screen shots.  Hid1.png is the competitor code clearly showing the serial number.   hid2.png is my slightly modified version of hiddemo.

If you can help me figure out how to locate the serial number using nrComm I'll place the PO for purchase immediately.  Thanks.

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: HID device serial number
« Reply #1 on: February 02, 2012, 05:19:22 pm »
Hello

Please do not hurry to spend money.
You need test the trial version for all possible purposes before purchase a license.

About S/N

Please try to run USBDeviceDemo.
Does it show serial number? Please try click Descriptors button.

What Delphi and Windows version do you use?

Also I see some strange thing  on your HIDDemo screenshot.
It shows empty string in "Service" and "S/N" params.
But HIDDemo source code skips empty string before add into list view.
How it does happen?

Roman Novgorodov
DeepSoftware llc
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

MarkHolbrook

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: HID device serial number
« Reply #2 on: February 02, 2012, 05:27:18 pm »
Hi Roman,

Yes USBDeviceDemo does return serial number that I need.  Attached is a screen shot.

The reason why in HID demo the blank S/N and Service show up is that I commented out the check for blank values to see if there was something not being called.

This test is being run in Delphi2010 currently however at some point in the next 6 months we will be moving to Delphi XE2 both 32 and 64 bit however for this library we can remain with 32bit at least initially.

I will try using a combination of TnrUSB and HID component to get the data I need and will contact you if I need further help.  Thank you for the reply.

The hurry is due to project pressure. 
« Last Edit: February 02, 2012, 05:28:51 pm by MarkHolbrook »

MarkHolbrook

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: HID device serial number
« Reply #3 on: February 04, 2012, 12:42:29 am »
Ok Roman, I need help again.

I have managed to make a program using TnrUSB which can find my scale devices.  I am getting the TnrUsbDevice classes for my scale devices.  However in looking at TnrUsbDevice this appears to be an information class with no way to communicate with the device.

So now that I have my device I would like to obtain the TnrHID device for it so I can use that class to communicate with the device. 

I tried simply casting:
   
var
  Dev : TnrUsbDevice;
  Hid  : TnrHID;

        Dev := TnrUsbDevice( nrUSB.Device[Idx] );
 
        Hid := TnrHID( Dev );   <---- Didn't work

        also

        Hid := TnrHID( Dev.Handle );    <----- Still no good.


If I have identified a TnrUsbDevice that is correct.  IE it has the manufacturer, type and serial number I want, how can I go from TnrUSBDevice to a working TnrHID?

Thanks



       

MarkHolbrook

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: HID device serial number
« Reply #4 on: February 04, 2012, 01:17:45 am »
Roman,

I'm not sure if this is a bug in your library or what but it is incredibly frustrating to try and work with these components.

For my application I need only TnrHID.  However TnrHID does not seem to return the device serial number.  This is a problem.  TnrUsb DOES return the serial number but I can so no way to find my device using TnrUsb and then cast or access that device as a TnrHid device.

It is not at all clear from your examples how to use TnrUSB to communicate with devices.  I can find my device and I can access it as a TnrUsbDevice but even that class seems to have nothing but Pipes and it is not clear how to use those to communicate with the device.

Your library is quite expensive but may do what we need to do for this project.  However unless it can be made clear how to use the library I will have to seek another solution.  I am hoping that you have a better manual and perhaps some more complete examples which show how to make the various components work together or if they can.

Awaiting your reply.

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: HID device serial number
« Reply #5 on: February 04, 2012, 10:55:42 am »
Hello

Please test new version of HIDDemo from here:
http://deepsoftware.com/nrcomm/hiddemo_32.zip

Run and click "Get More Details"
Do you see SN?

Roman Novgorodov
DeepSoftware LLC
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

MarkHolbrook

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: HID device serial number
« Reply #6 on: February 06, 2012, 04:32:19 pm »
Yes Roman,

I now see the serial number.  Is there an updated library I can get with this functionality for HID corrected?

I need to put together a demo program for my team showing that the library can locate and talk to 6 of these scales.  For this demo we can put up with the nag warning about purchasing the library.  If I can make the demo successfully and it will read the scales then we will place an order for a registered version of the library.    Please let me know how I can get a corrected/updated library in which HID will get the serial number.

Thanks - Mark

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: HID device serial number
« Reply #7 on: February 07, 2012, 06:14:05 am »
Hello

The new version 9.29 is available.
Please download and try.

Roman Novgorodov
DeepSoftware LLC
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

MarkHolbrook

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: HID device serial number
« Reply #8 on: February 07, 2012, 03:18:53 pm »
Roman,

From the nrComm website no matter which link I try I am getting 9.23 download.  Where is the 9.29 download?

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: HID device serial number
« Reply #9 on: February 07, 2012, 03:24:45 pm »
Hello

Official nrComm Lib page is here:
http://deepsoftware.com/nrcomm/

Roman Novgorodov
DeepSoftware LLC

DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

MarkHolbrook

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: HID device serial number
« Reply #10 on: February 07, 2012, 05:33:40 pm »
Hello Roman,

We have purchased a license through Primus however the download is showing 9.28.  How can I get a no-nag version of 9.29 so I can produce my demo?

Also the download of 9.28 from Pimus is corrupted.  It will not run.  Please email me on how to get a real version of 9.29.

Mark
« Last Edit: February 07, 2012, 05:40:14 pm by MarkHolbrook »