USB HID API Function Library
Kadtronix products and services!

 
 
 
 
 
  • Description
  • U4x1 Control
  • Descriptors
  • Screen-shots
  • U4x1 Control
  • Compatibility
  • Buy Now
  • User Manual
  • Contact Us
  •  

     
    UsbHidApi USB Comm Library

    Low as $39 (standard license)
    Windows DLL for VC++ and VB
    plus demo app w/source code
    also compatible with .NET & LabView



    Description

    Want to develop a USB HID device?  Need Windows PC application software, but don't want to deal with custom device drivers?  Want to develop a quick and easy host PC application to test your USB HID device? The UsbHidApi dynamic link library (DLL) is for you.  Did you know that you don't need a custom driver to access your USB device.  If it's a Human Interface Class (HID) device, you can take advantage of existing Windows drivers.  Used mainly for keyboards, mice, and joysticks, this class is also well-suited for special-purpose applications including access and control of custom-developed devices.  UsbHidApi encapsulates API calls that give you easy access to your device.  These API calls can be used in any development environment that accepts DLLs (e.g., Visual C++ & Visual Basic).   Also compatible with LabView and LabWindows/CVI (see note below). 

    Also included is UsbHidApi_NET, a special API version that contains a wrapper for .NET compatibility (see note below). Compiled using the Visual C++ Toolkit 2003, UsbHidApi_NET is recommended for Visual C++ .NET developers.

    You get both the UsbHidApi and the UsbHidApi_NET for the same low price!

    Check out these features:

    Easy to use API calls - Open( ), Read( ), Write( ), etc.
    No custom drivers (uses USB HID drivers already included in Windows)
    Develop PC host applications quickly
    Write applications for USB HID devices
    Includes two API libraries: UsbHidApi and UsbHidApi_NET
    Two available demonstration applications: Generic and U4x1 (UsbHidApi only)
    Free demo source code included:  Visual C++ 6.0 and Visual Basic
    VC++ 6.0 demo source available for either generic demo app or U4x1 demo app
    VB demo source available for generic demo app only
    Compatible with LabView and LabWindows/CVI (see note)
    Also includes API for Visual C++ .NET developers (see note
    Use implicit- or explicit-linking (DLL required for both options, included)
    Includes dynamic library library (DLL) file


    Advertisement:
    Attention Developers and OEMs:

    Want to market your own USB device but don't have the time or resources to develop it?  Our UsbDacq10 design is available for manufacturing and marketing.  Features digital I/O, analog-to-digital, SPI, and R/C servo channels.  Includes schematic, PCB layout, parts list, hex load file, and host software API (plus demo application).

    Click here to learn more.

    Advertisement:
    U4x1 Device Control

    Are you interested in writing a custom application for a UsbMicro U401 or U421 device?   Click here to discover how.


    Designing Firmware for Your USB Device?

    One of the key elements in developing firmware for your custom USB device is defining the descriptors.  This is important for proper device enumeration by the host.  There are several types of descriptors including configuration, device, and report.  Many times users will define a valid set of descriptors, but fail to properly classify the device. The device is classified by its "usage" such as a keyboard, joystick, or mouse.  These devices are typically allocated for exclusive use by the operating system.  If you are developing a custom device (e.g., temperature controller, digital input/output board, etc.) using the HID class, your report descriptor should indicate a "Vendor Defined" usage as indicated in the sample report descriptor below (courtesy of L. Zadra):

    /*------ Report Descriptor Group ---------------------*/
    /* This is a basic report descriptor. All data in the */
    /* reports are vendor defined and therefore the host  */
    /* doesn't care  what we transfer                    */

    BYTE code abromReportDescriptor[SIZEOF_REPORT_DESCRIPTOR] =
    {
       0x06, 0xA0, 0xFF, // Usage Page (FFA0H = vendor defined)
       0x09, 0x01, // Usage (vendor defined)
       0xA1, 0x01, // Start Collection (Application)

       // INPUT DEFINITION
       0x09, 0x01, // Usage (vendor defined)
       0x15, 0x00, // Logical Minimum (0)
       0x25, 0xff, // Logical Maximum (255)
       0x75, 0x08, // Report Size ( 8 BITS)
       0x95, EP1_MAX_REPORT_SIZE, // Report Count (16 Bytes)
       0x81, 0x00, // Input (Data, Variable, Absolute)

      // OUTPUT DEFINITION
      0x09, 0x02, // Usage (vendor defined)
      0x75, 0x08, // Report Size (8 BITS)
      0x95, EP0_MAX_REPORT_SIZE, // Report Count (16 Bytes)
      0x91, 0x00, // 0utput (Data, Variable, Absolute)
      0xC0 // End Collection
    };



    You can view the online user manual here:

    View User Manual



    Screenshot - Generic demo app - UsbHidDemo


     



    Screenshot - U4x1 demo app - UsbU4x1Demo


     



    U4x1 Software Development

    The UsbHidApi comm library is compatible with the UsbMicro U4x1 devices.  Users who want to create their own control software for these devices will find the UsbHidApi library invaluable.  Available in two form-factors: U401 and U421, these devices are functionally identical and provide 16 digital I/O signals configurable in any combination of inputs and outputs.  You can obtain a U4x1 device with our USB Digital I/O Commander product. For complete details on U4x1 hardware and interfacing, refer to the UsbMicro website

    Control and access of U4x1 device I/O signals involves several steps: 
  • 1) Open the device
  • 2)  Configure signals (inputs & outputs)
  • 3)  Read/write the device
  • We offer a special U4x1 demonstration option for those interested in developing Windows application software specifically for U401 and/or U421devices.  Source code (included) demonstrates how to search, open, and initialize the hardware.  Also setup the digital lines for input/output operations.  Even perform SPI master read/write functions.  Includes developed and tested device classes which can be used in your applications.  For purchase information, see details below:



    Compatibility

    UsbHidApi has been tested on Windows platforms including Win98, Win2K, & WinXP and has been used with a variety of HID class devices.  For those with compatibility concerns or unusual interfacing requirements, we offer a 30-day unregistered evaluation.  This limited-use version allows you to test the library with your application on a trial basis. 
     

    Request Evaluation

    To request the evaluation, click the link above.  Those interested in programming for applications including .NET and LabView should read the following notices: 

     .NET programmers:
    Also included is an API version that contains a wrapper for .NET compatibility.  Compiled using the Visual C++ Toolkit 2003UsbHidApi_NET is recommended for Visual C++ .NET developers. 
    LabView and LabWindows/CVI programmers:
    UsbHidApi may also be used in LabView and LabWindows/CVI applications.  For compatibility with ANSI C compilers, include the following header file in your application: UsbHidApi_2.h.  This is a specially modified version of the original header and is intended for use in ANSI C applications.

    Add the following statement to your C source file:

     #include "UsbHidApi_2.h"

    Add the following library to your list of build objects:

      UsbHidApi.lib

    See the following application notes for additional details:

    FAQ: Using Dynamic Link Libraries with LabWindows/CVI
    Integrating external code using Import Shared Lib. Wizard
    Writing win32 DLLs and Calling them from LabView

    (Larry Tell has developed a LabWindows/CVI demo using UsbHidApi.  The demo is available free of charge and can be downloaded using one of the following links:

    • Download full demo including source code  (~12Mb)
    • Download source code files only  (~80Kb)


    Get your USB HID product to market quickly with the UsbHidApi library.
     
    *** Important: ***

    Purchased software must be downloaded from this site.  Download instructions will be provided via e-mail.  Please read our terms and conditions below before purchase.


     
    Buy Now!
    Demo Option
    Standard License
    Commercial License*
    Generic:
    (for any USB HID device)
    $39
    $99
    U4x1
    (for UsbMicro U4x1 devices)
    $59
    $129


    Terms and Conditions
    Purchased software must be downloaded from this site.  Download instructions will be provided via e-mail. 
    Choose the U4x1 demo option if you are developing specifically for a U401 or U421 device.  Choose the generic demo option otherwise.  Source-code is included with both demos.  Each demo includes a Microsoft Visual C++ 6.0 project.  (The Generic demo also includes a Visual Basic project.) 
    Demonstration projects with source code are provided for Visual C++ 6.0 and Visual Basic 6.0.  Demos are not available for .NET, LabView, or LabWindows/CVI.
    The Generic demo uses static linking while the U4x1demo uses dynamic linking.  The library file (UsbHidApi.dll) will be automatically copied to your Windows system folder during the install process.
    If you are developing software for resale or distribution, choose the commercial license.  The commercial license allows royalty-free DLL distribution for OEMs and others who wish to use UsbHidApi with their products.
    Sorry, no refunds on purchased software.  If you are not sure the API will work in your application, you are urged to review our compatibility notice.  A special API evaluation copy is available upon request.

     
    *** Important: ***

    Purchased software must be downloaded from this site.  Download instructions will be provided via e-mail.  Please read our terms and conditions above before purchase. 


     

    Back to Main Page