Online Development Notebook > Index > ODN > USBm DLL Programming > Device Commands > ReadB

ReadB


Description:

This is a USBm.dll function that reads a byte value from port B. The returned value is the state of the port lines that an external device has set, if the line is an input. The lines that might be configured as outputs return the output state.

 

Command Syntax: (USBm.dll)

USBm_ReadB(device, data)

The USBm_ReadB function syntax has these parts:

Part Description
device A zero-based index to address the appropriate USB device.
data The function causes this variable to be changed to the value of the port.

 

Remarks:

 

 

VB Declaration

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

 

VB Example

Dim data As Byte
    USBm_ReadB 4, data

This code fragment reads port B of device 4, placing the result into "data".

 

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