Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Coms port and RAM disk
#1
Hi to everyone,

I am new to QB64PE but have used a previous version of QB64 and Inform before. Over the decades I also have used QB45 for many projects.

I am retired now and am investigating the suitability of QB64PE and Inform-PE for a hobby project. I would like to find out the following.

Coms Port: Is it possible to communicate via a serial coms port? The old QB45 required a coms port on the mother boards. New computers do not have serial coms ports anymore. Would a USB based coms port adapter work with QB64PE? Code examples are very appreciated.

The version of Inform, which I used before only allowed to set up one window. For my hobby project, I would need several windows. Can the latest version of Inform do more than one window? If not then I would like to exchange data between the programs of several windows  either via files on the HDD or a RAM disk. Any reply and advice on this topic is greatly appreciated.

Best Regards

Willi
Reply
#2
Yes, serial adapters over usb work fine in QB64pe.
Below the functions I created for this

Code: (Select All)
Errhandler: ' needed for ser.open% (ser$)
errorNum = Err: Resume Next

Function ser.open% (ser$)
  On Error GoTo Errhandler
  Open ser$ + ",N,8,1,BIN,CS0,DS0,RB8192" For Random As #88
  If errorNum = 0 Then serBytes$ = ser.read$
  On Error GoTo 0
  ser.open% = errorNum
End Function

Function ser.close$ ()
  ser.close$ = ser.read$
  Close #88
End Function

Sub ser.send (bytes$)
  Dim b As String * 1
  For i% = 1 To Len(bytes$)
    b = Mid$(bytes$, i%, 1)
    Put #88, , b
  Next i%
End Sub

Function ser.read$ ()
  Dim b As String * 1: resp$ = ""
  Do While Loc(88)
    Get #88, , b: resp$ = resp$ + b
  Loop
  ser.read$ = resp$
End Function
45y and 2M lines of MBASIC>BASICA>QBASIC>QBX>QB64 experience
Reply
#3
Also some TCP/IP stuff to check out in the wiki:

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

https://qb64phoenix.com/qb64wiki/index.p...aring_Demo

https://www.tapatalk.com/groups/qbasic/v...67#p214167

Pete
Reply
#4
(03-05-2024, 03:01 AM)Willi Grundmann Wrote: The version of Inform, which I used before only allowed to set up one window. For my hobby project, I would need several windows. Can the latest version of Inform do more than one window? If not then I would like to exchange data between the programs of several windows  either via files on the HDD or a RAM disk. Any reply and advice on this topic is greatly appreciated.

If you're working on a Windows system, the GuiTools Framework could be used. It has easy to use multi-windows support as shown in the Multi Windows Demo.

Willi Grundmann sounds german, also kann ich auch in deutsch Hilfestellung geben, wenn erforderlich. Big Grin
Reply




Users browsing this thread: 1 Guest(s)