| Online Development Notebook > Index > ODN > USBm DLL Programming > DLL Commands > DeviceProd |
DeviceProd
Description:
This is a USBm.dll function that returns the Product string from a USB device.
Command Syntax:
true⁄false USBm_DeviceProd(device, string)
The USBm_DeviceProd 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. |
| string | Any valid string expression. |
Remarks:
In VB the string passed as an argument must be large enough to hold all the characters that the function places in the string. The best way to acheive this is to set the string to a large size with the String function as in this code:
| strStrng = String(250, " ") |
Note: USBm_DeviceProd returns TRUE for a valid device.
VB Declaration (USBmAPI.bas)
| Public Declare Function USBm_DeviceProd _ Lib "USBm.dll" _ (ByVal device As Byte, _ ByVal product As String) _ As Integer |
VB Example
| Dim strng As String * 255 USBm_DeviceProd 3, strng frmStatus.lstDevices.AddItem "Product: " & strng |
This code fragment shows that strng is loaded with the "product" text of device three. Assuming that the form called "Main" exists with a text box called "Info", the "product " information will be made visible to the user.
C Example
-TBD-
| Hardware: U401 USB Interface U421 USB Interface |
| Programming: USBm DLL Programming Download Files |
| Application Notes: U4x1 Application Notes Misc Applications and Information FAQ |