USBmicro

Your source for USB electrical device interface products.

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

DeviceValid

Return a device-present indication


Description:

This is a USBm.dll function that returns an indication of validity from a USB device.

Command Syntax:

true⁄false USBm_DeviceValid( device )

The USBm_DeviceValid 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_DeviceValid always returns TRUE if the device is valid, otherwise FALSE.

VB Declaration (USBmAPI.bas)

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

VB Example

Dim result As Integer

    result = USBm_DeviceValid 3

This code fragment shows that result is loaded with TRUE if device three exists, or with FALSE if the device does not exist.

C Prototype

int USBm_DeviceValid( unsigned char device );

C Example

RobotBASIC

usbm_DeviceValid(ne_DeviceNumber)

Returns true if the device number refers to a connected and active device. False otherwise.

Documentation

Open all | Close all