Online Development Notebook > Index > Programming Overview > DLL Commands > DeviceDID

DeviceDID - Return the Device ID (device firmware version)


Description:

This is a USBm.dll function that returns the Device ID from a USB device.

Command Syntax:

number USBm_DeviceDID( device )

The USBm_DeviceDID 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_DeviceDID returns FALSE for an invalid device, otherwise the return value is the device DID

VB Declaration (USBmAPI.bas)

Public Declare Function USBm_DeviceDID _
    Lib "USBm.dll" _
        (ByVal device As Byte) _
    As Integer

VB Example

Dim result As Integer

    result = USBm_DeviceDID

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

C Prototype

int USBm_DeviceDID( 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 seperated by the | character. You can use the Extract() function to extract each section seperately if desired. The sections are:

DID

PID

VID

Mfr

Prod

Serial Number

Firmware Version


Hardware:  U401 USB Interface    U421 USB Interface   U451 USB Interface

Programming:  USBm DLL Programming    Download Files

Application Notes:  U4x1 Application Notes    Misc Applications and Information    FAQ

While every effort has been made to make sure that the information posted on this site is correct, the author can not be held liable for any damages whatsoever for losses as a result of the application of this information. Use this information at your own risk.

USBmicro can design your custom and semi-custom USB product. Email about USB design can be directed to " Robert " at usbmicro.com.

Copyright © USBmicro, L.L.C., 2002-2010

Previous  |  Next ]     [ Up  |  First  |  Last ]     (Article 37 of 126)

This page is created with TreePad