Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Serial and USB ports
#6
You could try:

https://qb64phoenix.com/qb64wiki/index.php/OPEN_COM

although I don't think you can get any USB device opened..

This code accesses COM1: then input/output functions are available.

Code: (Select All)
On Error GoTo Handler
FF = FreeFile
comPort$ = "COM1:" 'try a COM port number that does not exist
Const comMode$ = "9600,N,8,1,CS0,DS0" 'Use 0 to avoid timeouts
Open comPort$ + comMode$ For Random As FF
If errnum = 0 Then Print "COM exists!"

K$ = Input$(1)
End

Handler:
errnum = Err
Print "Error:"; errnum
Resume Next
Reply


Messages In This Thread
Serial and USB ports - by Keith - 03-28-2025, 05:20 PM
RE: Serial and USB ports - by Pete - 03-28-2025, 06:54 PM
RE: Serial and USB ports - by Keith - 03-29-2025, 04:52 PM
RE: Serial and USB ports - by Parkland - 03-30-2025, 01:56 AM
RE: Serial and USB ports - by Keith - 03-30-2025, 08:42 AM
RE: Serial and USB ports - by eoredson - 04-03-2025, 10:14 PM
RE: Serial and USB ports - by Keith - 04-04-2025, 08:34 AM
RE: Serial and USB ports - by eoredson - 04-04-2025, 09:57 PM
RE: Serial and USB ports - by hsiangch_ong - 04-05-2025, 07:03 AM
RE: Serial and USB ports - by Keith - 04-05-2025, 09:56 AM
RE: Serial and USB ports - by hsiangch_ong - 04-07-2025, 09:09 AM
RE: Serial and USB ports - by Parkland - 04-25-2025, 07:59 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Connection address weird ports? Parkland 1 435 04-25-2025, 09:45 PM
Last Post: DSMan195276
  USB Camera? james2464 33 6,559 02-27-2025, 12:02 AM
Last Post: SpriggsySpriggs
  Struggling with serial comms Wolstan Dixie 8 2,529 05-20-2022, 09:58 PM
Last Post: moci

Forum Jump:


Users browsing this thread: 1 Guest(s)