A RS 232 Communication Library

Share your advanced PureBasic knowledge/code with the community.
Marc
User
User
Posts: 28
Joined: Mon Jun 16, 2003 9:02 pm
Location: Paris - Villemer
Contact:

A RS 232 Communication Library

Post by Marc »

As I did not find RS 232 Communication function in PB, I wrote a library (4Ko). Included in the Zip file, the library help file, an installation software and a sample PB source to demonstrate the library functions.

I also try to upload it to PB resources site.

To download the Zip file clic here http://perso.wanadoo.fr/marc.vitry/purebasic.htm
Cor
Enthusiast
Enthusiast
Posts: 124
Joined: Fri Apr 25, 2003 7:52 pm
Location: Netherlands
Contact:

Post by Cor »

Well done Marc :D
Cor de Visser

Registered PureBasic user

Author of ChordPlanet
Made with PureBasic
http://www.chordplanet.com
DominiqueB
Enthusiast
Enthusiast
Posts: 103
Joined: Fri Apr 25, 2003 4:00 pm
Location: France

Thank's

Post by DominiqueB »

Great tool !
I'l have a test tomorow.
Just a thought: why did you limit the speed to 19200 b ?
Some can goes upper :-)

Thank's again !
Dominique

Windows 10 64bits. Pure basic 32bits
Marc
User
User
Posts: 28
Joined: Mon Jun 16, 2003 9:02 pm
Location: Paris - Villemer
Contact:

Post by Marc »

In the demonstration software the maximum speed is 19200 but can be change in the source. The Comopen function also accept 57600 and 115200 Bds.

Regards
DominiqueB
Enthusiast
Enthusiast
Posts: 103
Joined: Fri Apr 25, 2003 4:00 pm
Location: France

Ok

Post by DominiqueB »

That was what i thought too !

Thank's.
Dominique

Windows 10 64bits. Pure basic 32bits
Fred
Administrator
Administrator
Posts: 18226
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Looks very nice.. Thanks for this lib :)
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

well done
SPAMINATOR NR.1
User avatar
geoff
Enthusiast
Enthusiast
Posts: 128
Joined: Sun Apr 27, 2003 12:01 am
Location: Cornwall UK
Contact:

Post by geoff »

Looks excellent, complete and ready to use with help file.

But this raises a question for me.

Should this be integrated into PureBasic with new PureBasic commands and the Help info transferred into PureBasic Help? Or should this be a standard addition to the UserLibraries folder for future PureBasic downloads?

Marc would you be happy to see this happen?

We could all use a variety of different libraries from various sources, for example there are several options for RS232. However, there is a lot to be said for incorporating the best solutions into the standard package. That way the whole PureBasic user base is available to identify possible bugs and incompatibilities and any user who finds problems can expect other users to be able to help.

I guess this is something of a difficult issue, some people may not want to see their hard efforts incorporated as an unidentifiable part of something larger. But for most users this would probably be the best result.
Fred
Administrator
Administrator
Posts: 18226
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

I agree and it's only up to the library maker choice. This what it happens with the very good 'OnError' lib, which is coded by Rings and PureFan and which is now part of the PureBasic package, thanks to them.

But this lead to several problems which aren't so obvious. Until now, I wrote almost all the commands which means than I know the code and know how to fix it if something bad happen. Now imagine I package several big libs and the users behind them leave. Once a bug rise, I will have to spend a great amount of time only to understand how the code works. Understand C code is relatively easy when it's well written, but ASM one is another matter. The other topic is the cross compatibily: I have to be able to do it for any other plateform that PB support, and when I gain time by getting it finished on one plateform, I lost it on the other one :).

Anyway, I'm not against this fact, I just want to clarify the things. I believe in the plugin concept, and actually you can do an user lib which perfectly integrate the PB environment (same help, F1 on keyword call help etc...), so...
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Post by Tranquil »

I would like to see only libs which are definitly coded by the PB Team. Couse only here we can be sure to get the support and the knowledge of the library a registred user should be able to get.
Also the benefits and credits belongs longer to the original author - and thats mostly all what he is getting for his work.

Respect to the PB Team and all users who supports them. (especially Berico, Siggi, Timo, Danielo, Fred)

Anyway, a good community here! nice to see!

Cheers
Mike
Tranquil
Marc
User
User
Posts: 28
Joined: Mon Jun 16, 2003 9:02 pm
Location: Paris - Villemer
Contact:

Post by Marc »

I'm totaly agree with Fred. User libraries concept is good for PB and for the all users.

Message: Bravo à toute l'équipe de PB.

Regards.
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

Marc wrote:I'm totaly agree with Fred. User libraries concept is good for PB and for the all users.

Message: Bravo à toute l'équipe de PB.

Regards.
Well Fred, it's almost 7 month that I told you my opinion about this matter.

The User Lib stuff is really good, but YOU never know how good a user lib is coded, that's for sure ( in C or ASM ).
So if the user lib coder leaves the community and something is wrong with the lib....
More throuble YOU will have, if you incorporate a user lib in the PureBasic package and something is wrong with it.

And finally as you can see, there are users, that like to have only libs coded by the PureBasic Team. Not a good solution, because the creation of new libs would be minimal... and this would NOT attract new users.
( and if somebody doesn't like a lib, because it's not coded by Fred - don't use it! )


My opinion on this is to make it possible that PureBasic not only can make Executables (EXE) and Dynamic Libraries (DLL) BUT ALSO Static Libraries (OBJ).
This would enable to have user libs made with PureBasic itself, the assembler source file would be fully commented (because the PureBasic code would be there in a comment line - in addition to normal comments).

So if YOU like to incorporate a user lib in the PureBasic Package, you would get the whole source, and it would be an easy task for YOU to find bugs.

Think about it, PureLIBs written in PureBasic itself would kick a$$ :idea:
And attract new users as well :wink:

I am to provide the public with beneficial shocks.
Alfred Hitshock
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Post by tinman »

fsw wrote:Think about it, PureLIBs written in PureBasic itself would kick a$$ :idea:
And attract new users as well :wink:
What about this (semi-alternative): the user codes their own procedures as normal, and sticks them in an include file. Fred provides some way for them to have "init" and "shutdown" procedures which automatically get called at program startup and exit. At some point, Fred was going to implement the removal of unused code.

Instant library without the hassle of libraries. Kind of :)
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
Fred
Administrator
Administrator
Posts: 18226
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Keep in mind than the libraries are the core of every programs written in PureBasic. And even if the generated PureBasic code is good, it's far to match an hand optimized asm one, that's why I'm a bit restrictive while doing lib in PB. But why not, I could consider it.
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

Fred wrote: But why not, I could consider it.
8) YES PLEEEEEEEEAAAAASSSSEEE :!:
Fred wrote:Keep in mind than the libraries are the core of every programs written in PureBasic. And even if the generated PureBasic code is good, it's far to match an hand optimized asm one, that's why I'm a bit restrictive while doing lib in PB.


I can fully grasp your thoughts and understand what you are saying.

But it's the same with DLL's.
You never know how good it's coded.

Example: For now I code some functions in a dll and call the dll functions, what works well, but I have always to copy the dll to the exe to keep it going (or copy the dll to the system folder - arghh).

If PureBasic could make DLL's OR OBJ's - it's exactly the same code.
So hand optimation is never done. Not as DLL and not as OBJ.
And if the user can understand the asm code and optimize it - that's excellent for DLL's and OBJ's.

I am to provide the public with beneficial shocks.
Alfred Hitshock
Post Reply