USBmicro

Your source for USB electrical device interface products.

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

FindDevices

Find all U4x1 devices


Description:

This is a USBm.dll function that scans all of the HID devices available on the bus. If a device qualifies as a U4x1, then open access to the device and place the device into the internal data structure for U4xx devices. Devices are indexed with a device number starting from 0 to the number of devices found minus one. This function is the initial call to connect devices logically to the PC. Once this function is called (successfully) then access to the device can be done with the device commands.

Command Syntax:

true⁄false USBm_FindDevices()

The USBm_FindDevices function syntax has these parts:

Part Description
  No argument

Remarks:

Note: USBm_FindDevices returns FALSE for no connected devices, otherwise the return value is TRUE.

VB Declaration (USBmAPI.bas)

Public Declare Function USBm_FindDevices _
    Lib “USBm.dll” _
        () _
    As Integer

VB Example

Dim result As Integer

    result = USBm_FindDevices

This code fragment shows that result is loaded with TRUE if devices exist and can be opened by the DLL, or with FALSE.

C Prototype

int USBm_FindDevices( void );

C Example

RobotBASIC

usbm_FindDevices()

Returns -1 (true) if there are U4x1 devices connected to the PC. Returns 0 (false) otherwise. You should call this function before you do anything with devices.

Documentation

Open all | Close all