Thread: Batch file or VisualBasic file to send to USB port

  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    1

    Unhappy Batch file or VisualBasic file to send to USB port

    hi All
    I need to write either a simple batch file or VisualBasic exe to send to the USB port to open a cash drawer

    The syntax is something like OpenDrawer 1 "Star TSP700 Raster Printer"

    I have written similar files in VisualBasic for Com ports which work eg:


    Private Sub Form_Load()
    ' OPEN COM1 FOR OUTPUT
    Open "com1" For Output As #1
    ' POP CASH DRAWER
    ' CMD:
    Print #1, Chr$(7)
    ' CLOSE THE COM1 PORT
    Form1.Cls
    Close #1
    End Sub

    but they do not work with USB

    Can anyone help me out please?
    TIA
    Rod

  2. #2
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    You typically need a driver to communicate through a usb port. Fortunately, there is a generic driver available. This is targeted at C/C++ but may be useable in VB through an intermediate dll. Some usb devices include a user mode interface. One such example is Ez-USB.

    There is also likely to be commercial software that provides usb access to vb programs.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A development process
    By Noir in forum C Programming
    Replies: 37
    Last Post: 07-10-2011, 10:39 PM
  2. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  3. Batch file programming
    By year2038bug in forum Tech Board
    Replies: 10
    Last Post: 09-05-2005, 03:30 PM
  4. what does this mean to you?
    By pkananen in forum C++ Programming
    Replies: 8
    Last Post: 02-04-2002, 03:58 PM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 02:58 AM