<< bulk_init BULK Basic's commands bulk_read >>

USB Comunication Toolbox for Scilab >> BULK with libusb-1.0 Library > BULK Basic's commands > bulk_open

bulk_open

Open a USB Device

Calling Sequence

open_success = bulk_open(VendorID,ProductID)

Parameters

VendorID
: Vendor Identification of the USB device' s manufacturer. This number its unique for every USB manufacturer
ProductID
: Product Identification of the USB device. This number its define by the USB manufacturer.
open_success
: retun 0 if device has been opened and -1 if the device can not be opened. Check the USB device is properly connected to the host computer.

Description

Open USB Device

This function open an USB Device using the VendorID and ProductID of the device connected to the host computer.

Do not forget close the device.

Examples

VendorID="04D8";
ProductID="0204";
VendorID=uint16(hex2dec(VendorID));
ProductID=uint16(hex2dec(ProductID));
init_success=bulk_init();
if ( init_success < 0 ) then
   disp("unable to initialize the Libusb-1.0 Library");
   return
else
   disp("Libusb-1.0 Library initialized");
end
open_success=bulk_open(VendorID,ProductID);
if ( open_success < 0 ) then
  disp("unable to open device");
  return
else
  disp("device open"); 
  close_success=bulk_close();
end
exit_success=bulk_exit();
  if ( exit_success < 0 ) then
     disp("unable to free static data associated with Libusb-1.0 Library");
     return
  else
     disp("Libusb-1.0 Library have been freed all of the static data associated");
  end

See Also

Authors

<< bulk_init BULK Basic's commands bulk_read >>