[Implemented] Serial communication

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

[Implemented] Serial communication

Post by BackupUser »

Restored from previous forum. Originally posted by wcardoso.

:)Hey Fred!, can you add commands or functions in the compiler or an external library to use the serial ports ?.
I use frequently communications with peripheral devices and I need some commands to use the PC serial ports.
Think in commands like: OpenCom(#Port,BaudRate,etc...)
Send(#Port,Variable,etc..) Read(#Port,Variable,etc) SetCTS ResetCTS Etc, etc.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Berikco.

I think this is not so easy, very different even on the Windows OS'ses NT vs 9X and what about linux portability? On NT must go via API.
there are many packages out there that can do this, maybe you can try some.
http://www.programmersheaven.com/zone15 ... /21498.htm
I use another one, TvicHW32 for hardware poking under NT, but no serial com in there.

Regards,

Berikco

http://www.benny.zeb.be
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

There is an example at download.purebasic.com called PureFrog. It open a serial communication. But yes I will do a library. I just need an expert to tell me which command should be put it (as I don't use it really).

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by pusztry.

Fred,
That is going to be AWSOME. I realy use the serial port daily at my job. I could realy use that so that I develope great software with PureBasic. PLEASE let me know if I can help. I don't know the API calls because I you another package but I need PB to be used for the future.

- Ryan


WinXP, PIII 800 MHz, 512MB RAM, SB Live 5.1, NVidia TNT 2 Ultra
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by plouf.

about the commands i think wcardoso
say the needed commands ie open/send/receive
and somehow set/reset pins except RxD TxD
since these are controller by send/receive
plus somehow be able set comm state
and get the events like buffer full
(if you dont use rtc for handshaking )etc

Christos
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Rings.

i should make a example with Win-Api to show whats actually needed.

Its a long way to the top if you wanna .....CodeGuru
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

Would be a good idea.

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by pusztry.

Rings That would Be great to look at an example.

- Ryan


WinXP, PIII 800 MHz, 512MB RAM, SB Live 5.1, NVidia TNT 2 Ultra
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by wcardoso.

Rings, like Fred I think your Win-API example will gonna great, but don't forget that PB is a multi-OS tool and that implies a library to work with Linux and Amiga too.
:)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Pupil.
Originally posted by wcardoso

Rings, like Fred I think your Win-API example will gonna great, but don't forget that PB is a multi-OS tool and that implies a library to work with Linux and Amiga too.
:)
I think Rings proposed to make an example so that it would be easier to see what's necessary to have included in a PB Serial lib(which Fred does for all supported OS:s). Am i totally off Rings?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by wcardoso.

Pupil sorry, but my intention was to mark that using the Win-Api would do that the solution was very Windows-dependent.
That's all.
Regards
:)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Berikco.
I think this is not so easy, very different even on the Windows OS'ses NT vs 9X and what about linux portability?
Well i whas somewhere lost to, i dit some serial communications in the past for Packet radio over CB, it whas very different in Win3.11 an win95
In win32 most api wil be the same i think

Regards,

Berikco

http://www.benny.zeb.be
Post Reply