USBmicro

Your source for USB electrical device interface products.

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

CloseDevice

Close the open device


Description:

This is a USBm.dll function that closes access to a USB device.

Command Syntax:

true⁄false USBm_CloseDevice( device )

The USBm_CloseDevice 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_CloseDevice returns TRUE if the device successfully closes.

VB Declaration (USBmAPI.bas)

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

VB Example

Dim result As Integer

    result = USBm_CloseDevice 3

This code fragment closes device number three. “Result” will contain TRUE or FALSE.

C Prototype

int USBm_CloseDevice( unsigned char device );

C Example

RobotBASIC

usbm_CloseDevice(ne_DeviceNumber)

Returns true if the device was successfully closed. False otherwise.

Documentation

Open all | Close all