B&B Electronics 4 Channel Input Buffer Board SDAIBB Instrukcja Użytkownika Strona 51

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 60
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 50
Documentation Number UD128A8D4602 Manual Chapter 5 47
B&B Electronics Mfg Co 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104
B&B Electronics Ltd Westlink Comm. Pk. Oranmore, Galway, Ireland Ph 353-91-792444 Fax 353-91-792445
Next I
Handling Device Changes – USB Hot Plug/Unplug
The OnChange Event - After BDaq.BBDaqEnum is created, any
change in the devices connected (plugging in a new device or
unplugging a connected device) causes an OnChange event to
occur. You can trigger on this event to check available devices,
change which devices you are addressing or to detect a new device.
Private Sub Connected_OnChange()
‘ \ Cleanup Variables, Check available Devices,
‘ \ Notify the user of the change,
‘ \ Change the device being addressed, configure, etc.
End Sub
If one set of test connections is on the first device installed as
“DAQ1” and another set of connections is on “DAQ2” and one is
unplugged, we want to set the software to access only the device
remaining.
We can use the OnChange event to trigger checking what devices
are connected, and which tests to perform.
EnableTest1 is a subroutine that configures the I/O for “DAQ1” and
enables the user to start Test 1.
EnableTest2 is a subroutine that configures the I/O for “DAQ2” and
enables the user to start Test 2.
Private Sub Connected_OnChange()
Dim Device as Variant
Set Device1 = Nothing
Set Device2 = Nothing
If Connected.Devices.Count = 0 then
‘ \ Inform user and and stop acess until another connected
Exit Sub
End If
‘ \ If at least one device, check which it is – select test
For Each Device In Connected.Devices
If Device.Name = "DAQ1" Then
Set Device1 = Device
Przeglądanie stron 50
1 2 ... 46 47 48 49 50 51 52 53 54 55 56 ... 59 60

Komentarze do niniejszej Instrukcji

Brak uwag