Online Development Notebook > Index > ODN > USBm DLL Programming > DLL Commands > WriteDevice

WriteDevice


Description:

This is a USBm.dll function that writes raw bytes to device.

 

Command Syntax:

true⁄false USBm_WriteDevice(device, array)

The USBm_WriteDevice 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.
array Series of eight bytes to write to device.

 

Remarks:

Note: USBm_WriteDevice returns TRUE if the device is successfully written.

 

VB Declaration (USBmAPI.bas)

Public Declare Function USBm_WriteDevice _
    Lib "USBm.dll" _
        (ByVal device As Byte, _
        ByRef data As Byte) _
    As Integer

 

VB Example

Dim OutBuffer(10) As Byte

    OutBuffer(0) = 0
    OutBuffer(1) = 21
    OutBuffer(2) = 3
    OutBuffer(3) = 65
    OutBuffer(4) = 8
    OutBuffer(5) = 17
    OutBuffer(6) = 60
    OutBuffer(7) = 0

    USBm_WriteDevice 2, OutBuffer(0)

This code fragment shows writing a series of bytes to device two. The bytes would follow the "raw" command format.

 

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