USBmicro

Your source for USB electrical device interface products.

  • Home
  • Services
    • Design
    • Contact USBmicro
  • Where to buy…
You are here: Home / Documentation / DLL Commands / DevicePID

DevicePID

Return the device product ID


Description:

This is a USBm.dll function that returns the Product ID from a USB device (0x0191 for U401).

Command Syntax:

number USBm_DevicePID( device )

The USBm_DevicePID function syntax has these parts:

Part Description
device Valid device from 0 to the maximum number of devices found (minus 1). Any other number results in a FALSE return.

Remarks:

Note: USBm_DevicePID returns FALSE for an invalid device, otherwise the return value is the device PID

Product ID  0x0191 = U401

Product ID  0x01A5 = U421

Product ID  0x01C3 = U451

VB Declaration (USBmAPI.bas)

Public Declare Function USBm_DevicePID _
    Lib “USBm.dll” _
        (ByVal device As Byte) _
    As Integer

VB Example

Dim result As Integer

    result = USBm_DevicePID

This code fragment shows that result is loaded with the PID of the device, or with FALSE if the device does not exist.

C Prototype

int USBm_DevicePID( unsigned char device );

C Example

RobotBASIC

DID, PID, VID, Mfr, Prod, Serial Number, and Firmware Version are all handled by the RobotBASIC function usbm_DeviceSpecs(ne_DeviceNumber).

usbm_DeviceSpecs(ne_DeviceNumber)

Returns a string that contains information about the device. There are 7 sections separated by the | character. You can use the Extract() function to extract each section separately if desired. The sections are:

DID

PID

VID

Mfr

Prod

Serial Number

Firmware Version

Documentation

Open all | Close all