Author Topic: COMport(RS232) help needed(under Freebasic)  (Read 4790 times)

0 Members and 1 Guest are viewing this topic.

Offline stefan63

  • ZX 81
  • *
  • Posts: 7
  • Karma: 0
    • View Profile
Hello people,
Until now i worked under DOS only (TurboPascal) and for my (RS232) purposes i used
direct port access. Under WinXP and with FreeBasic i want to use standard access
"OPEN COM ....." , but this is too new for me.  What confuses me:
  - how i can check is or not new byte arrived(under DOS i have interrupt)? Or here is another principle?
  - when sending - can i send byte by byte (and how to check is sended or still not  previous byte, under DOS i use interrupt)? Or i must output to "file" whole packed?
  - If "OPEN COM" is for opening , which command is for port closing - "CLOSE filenum" ?
Thank You and regards,
Stefan


 

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: COMport(RS232) help needed(under Freebasic)
« Reply #1 on: March 16, 2007 »
Under XP you'd use the OpenFile/ReadFile API to do serial comms.  There's no interrupt, you either wait for data to arrive or you use the 'overlapped' structure and poll for data arriving.

MSDN article on serial coms for win32.
http://www.tetraedre.com/advanced/files/msdn_serial.htm

Jim
« Last Edit: March 16, 2007 by Jim »
Challenge Trophies Won: