Sub btn_con_Click
If usb1.UsbPresent(1) = usb1.USB_NONE Then ' Ver_2.4
Log("Msgbox - no device")
Msgbox("Kein USB Gerät erkannt!", "Fehler")
Log("Msgbox - returned")
Return
End If
Log("Checking permission 1")
If (usb1.HasPermission(1)) Then ' Ver_2.4
Msgbox(usb1.DeviceInfo(1), "GeräteInfo") ' Ver_2.4
usb1.SetCustomDevice(usb1.DRIVER_SILABS, 0x547, 0x1004)
Dim dev As Int
dev = usb1.Open(9600, 1)
If dev <> usb1.USB_NONE Then
Log("Connected successfully! ")
lbl_status.Text="Vero verbunden"
astreams1.Initialize(usb1.GetInputStream, usb1.GetOutputStream, "AStreams")
usb1.SetParameters(9600,usb1.DATABITS_8,usb1.STOPBITS_1,usb1.PARITY_NONE)
Else
Log("Error opening USB port ")
End If
Else
usb1.RequestPermission(1) ' Ver_2.4
End If
End Sub