Finding USB Devices from VB.net - vb.net

My background is that I have been supporting a Vb5 application which controls my customers equipment in real time. He is now developing a new control board which will be connected to the PC via USB.
As I understand it connecting the device will generate a Com port. At the same time we will upgrade to VB.net, which is new to me.
I have Visual studio 2015 Community edition. I have written a routine using GetPortnames to ascertain how many com ports there are and what numbers (COM4, etc) they have.
How do I find what USB devices, if any, are attached to the com ports together with any identifying data of the device?

Already answered, next time please google first.
The key word that I type in google was: vb usb
Link

Related

Creating a computer ID using Mono

I develop a few tools in C# using the .Net framework and I am considering the move to Mono. Based on the compatibility analyzer tool (MOMA), the only compatibility issue is the licensing code:
I use Window's serial number and a few other things to generate a computer ID which I then use to generate and manage my licenses.
Obviously, Windows will not be available on Linux or Mac, so I need another way to generate a computer ID.
What can I use in mono to create a reasonably reliable computer ID?
Use a MAC Address:
Get MAC Address in linux using mono
That should be unique to a given network interface, which would uniquely identify the machine.
Also, see this thread discussing the pitfalls and issues related to DRM in mono.
You can use a combination of either CPUID and a hard drive serial number.
As for your code, there is not going to be an elegant way to do this with a one-liner. You will have to check which platform you are running on via Environment.OSVersion. And then based on that, branch your code to do system-specific access. For example, to get CPUID/hdd serial number, use a WMI query; or parse the output of hdparm -I /dev/hda and go from there.
You could use a portion of how Microsoft checked hardware for Windows XP activation. They checked 10 items
Display Adapter
SCSI Adapter
IDE Adapter (effectively the motherboard)
Network Adapter (NIC) and its MAC Address
RAM Amount Range (i.e., 0-64mb, 64-128mb, etc.)
Processor Type
Processor Serial Number
Hard Drive Device
Hard Drive Volume Serial Number (VSN)
CD-ROM / CD-RW / DVD-ROM
When XP was (re)installed/activated it'd contact their servers and if 7 or more of the above items were unchanged it would activate without the need to speak with anyone.
I, personally, would recommend against using the MAC address. As you mentioned, it can be easily changed. Additionally, most machines have two or more network cards now (wired and wireless). It gets worse with virtualization as the MAC can be changed even more easily than the physical one can (do you license differently for virtual environments?)
Another option, instead of checking all 10 hardware components, is to use the UUID of the root file system. The downside of this, is that if the drive ever has issues, the license needs to be reacquired.
sudo blkid
/dev/sda1: TYPE="ntfs" UUID="72C0DE8EC0DE57C5" LABEL="windows"
/dev/sda2: UUID="30fcb748-ad1e-4228-af2f-951e8e7b56df" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda5: TYPE="swap" UUID="8c4e69f8-5074-42c0-8134-0b2429c4c02c"
/dev/sdb1: SEC_TYPE="msdos" UUID="4848-E35A" TYPE="vfat"

tester for HID devices

I have built my own USB HID device. I want to check, if it is working correctly.
I want to check the descriptors sent by the device, display input reports and send output reports. What tools are capable of this task and runs on Windows 7 64 bit?
On a day-to-day basis I use USBlyzer. It works well on Windows 7 64-bit.
As far as free tools go, the Windows DDK includes (in C:\winddk\7600.16385.1\tools\avstream\amd64) a tool called UVCview.exe ("USB device viewer") that shows at least some descriptor information.
You might also try Wireshark, but I admit, I only use it for network and can't speak to the quality of its USB capture.
(even though it's an old post) - here is a convenient and free solution:
Our Docklight Scripting software can test custom USB HID devices in the free (evaluation) download already, no time limit. Tested both on Windows 7 and Windows 10. You can access your device via the chosen VID and PID, display input report data and send output reports, even with variable output report ids.

Access 2007 Image Capture

I have been trying to figure out how to capture an image withing my Microsoft Access 2007 application using a webcam.
We have been paying for a 3rd party application for this in the past - it is used for taking ID card photos, but the software has grown buggy over time, and I think we should be able to accomplish this ourselves!
All I need is for my Access application to use the webcam to capture the image and save it in a network share. That's it!
I have been trying to hunt down vba code, twain drivers, ActiveX controls... but they all seem to be either deprecated (Access 97/2000) or proprietary! There's got to be some other solution out there though!
You could possibly shell out to another app (using the vba Shell function) that can take a snapshot from the webcam and save it to a file. I found one example:
http://batchloaf.wordpress.com/2011/04/06/snapz-a-command-line-cam-image-grabber/
Good luck.

Communication beetwen Windows CE and Windows XP applications

I have a desktop (XP) application and a CE app (Motorola MC9090) and I want to Scan few Barcodes with Motorola and then send the text to the application on PC using WiFi. I have no idea how to do it - any suggestions? (VB.NET preferred)
Think about it logically, and try simplifying this a little;
If you want to do it over WiFi, you're going to need "something" on the device to scan and send, as well as something on a "server" to receive, such as a webservice; so you actually need to write two things.
A simple option would be to put together a simple ASP.Net webservice for receiving the data (and processing it, dealing with authentication, etc.).
You can then write an application for your CE device that interacts with said webservice and handles the user interaction (most scanners will fake key presses into the control with focus). Bear in mind, that you might also need to cope with situations when the WiFi is out of range.
If you're targetting Windows CE, you cannot do it in Visual Studio 2010 or later (as far as I'm aware), so you may need to get hold of VS 2008 (to maximise your support lifecycle)

Developing an API for a USB connected Glucometer

I have a ReliOn Glucometer that can be connected to a Windows PC via USB. Glucometer Details Here. I have never tried this, but can someone point me in the right direction to go about connecting to a USB device (C# or Delphi) and pulling data from it? I want to download the current test result and save off to a database to build log of test history. I am a diabetic and I hate doing the tests everyday, but I realized if I can leverage this necessary evil with learning how to work with USB connected device, I at least can get some pleasure in knowing I made some good out of this.
Has anyone done this or something similar? I know there is a website I can join and they have an OCX to do this.. but I don't want to put my info/data on a site, plus it misses the point - I want the challenge of doing this.
Any advice - directions where to start would be greatly appreciated.
I would begin by looking at the USB device driver that comes with the software, especially the inf file. Is it HID or is it for a specific USB chipset, etc? Then look for a relevant development kit/info to take it from there.