------------------------------- MultiUSB DppApi Version 1.0.1.4 ------------------------------- (C) Amptek Inc. 2007 ----------------------------- Important MultiUSB Functions: ----------------------------- OpenUSBDeviceEx GetUSBDppDeviceInfo --------------------- MultiUSB Directories: --------------------- MultiUSB Demonstration Project: ~\DPPAPI\vb\MultiUSB\MultiUSB MultiUSB DPPAPI (Preliminary) Reference: ~\DPPAPI\vb\MultiUSB\MultiUSB API Reference ReadDpps Demonstration Project: ~\DPPAPI\vb\MultiUSB\ReadDpps --------------------------- Demonstration Applications: --------------------------- MultiUSB - Run repeated spectrum acquisitions from a selected device. ReadDpp - Reads running DPPs, displays device status. ------------------------------------ How to connect to a specific device: ------------------------------------ 1.) Get the number of DPP devices running. 2.) Get device information for each device found. 3.) Connect to the device using the device number. Notes: <> Open only ONE device at a time per application or process. <> Always close the open device before connecting to another device. <> Always close the open device before terminating the application. Private Sub cmdGetDevices_Click() cmdGetDevices.Enabled = False ' disable button until done Dim numdev As Integer ' number of usb devices Dim Res As Integer ' number of usb devices Dim objDppApi As Long ' pointer to dpp api Dim strStatus As String ' status text Dim iDeviceType As Integer ' number of acquired channels Dim SerNum As Long Dim i As Long objDppApi = OpenDppApi() ' create/open DPPAPI numdev = OpenUSBDevice(objDppApi) ' open communications default USB device CloseUSBDevice (objDppApi) ' close usb default device If (numdev > 0) Then iNumDevices = numdev For i = 1 To numdev Res = OpenUSBDeviceEx(objDppApi, i) ' open selected USB device iDeviceType = GetUSBDppDeviceInfo(objDppApi, i, SerNum) ' get device information If (iDeviceType = 2) Then strStatus = strStatus & Str(i) & " " & "[PX4] " & Str(SerNum) & vbNewLine ElseIf (iDeviceType = 1) Then strStatus = strStatus & Str(i) & " " & "[DP4] " & Str(SerNum) & vbNewLine Else strStatus = strStatus & Str(i) & " " & "Device Error" & vbNewLine End If CloseUSBDevice (objDppApi) ' close usb Next End If txtStatus = strStatus CloseDppApi (objDppApi) ' close DPPAPI Sleep (750) cmdGetDevices.Enabled = True End Sub