• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 

HID device serial number

Started by MarkHolbrook, February 01, 2012, 09:49:52 pm

Previous topic - Next topic

MarkHolbrook

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

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

February 02, 2012, 03:27:18 pm #2 Last Edit: February 02, 2012, 03:28:51 pm by MarkHolbrook
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. 

MarkHolbrook

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

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

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

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

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

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

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

February 07, 2012, 03:33:40 pm #10 Last Edit: February 07, 2012, 03:40:14 pm by MarkHolbrook
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