Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » About RS232
Re: About RS232 [message #18640 is a reply to message #18639] Mon, 13 October 2008 23:25 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 916
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Of course. Since 2008.1 there where big number of improvements (thanx to Mirek) and QTF as well as TheIDE Help system is upgraded. I recommend to use Projects > SVN synchronize ability to obtain latest sources and recompile TheIDE.
I use latest SVN sources and manual was developed under latest version.

[Updated on: Mon, 13 October 2008 23:26]

Report message to a moderator

Re: About RS232 [message #18773 is a reply to message #18640] Mon, 20 October 2008 19:27 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1071
Registered: March 2006
Location: Italy
Experienced Contributor
Hello,

I'm trying to simplify your application (using only methods from tutorial_1-4) to read the temperature of a sensor connected to a micro controller. Here is a picture of this stuff http://quozl.netrek.org/ts/

I have tried the program tsl-1.2.tar.gz in C given by the author (same link above) that run under windows in consolle mode and works OK.
His short code uses the termios lib available under linux.
I would like to replicate it with your library and add a GUI that should even draw a graph during the reading (other three sensors are coming and this increase the fun Smile ).

At the moment I was not able to wake up the micro controller. Please let me ask you if DTR in set ON automatically or I must add "dtr=on" in the comString.

Thanks,
Luigi
Re: About RS232 [message #23657 is a reply to message #3788] Wed, 11 November 2009 08:44 Go to previous messageGo to next message
gxl117 is currently offline  gxl117
Messages: 71
Registered: March 2009
Location: China
Member
I'm try to compile your example Kran,but compiler show a error:
main.cpp
f:\MyApps\siral\Kran\../COMMON\RS232Thread.h(103) : error C2664: 'ConveyorThread<T>::Request' : cannot conver
	t parameter 1 from 'Upp::Gate' to 'Upp::Callback1<P1>'
        with
        [
            T=RS232RequestElement
        ]
        and
        [
            P1=const RS232RequestElement &
        ]
        No constructor could take the source type, or constructor overload resolution was ambiguous
        F:\MyApps\siral\Kran\main.cpp(164) : see reference to function template instantiation 'void RS232Thre
	ad::RequestIOSlave<Kran::Triad>(const RS232RequestElement &)' being compiled


How to fix that?
Re: About RS232 [message #23666 is a reply to message #23657] Wed, 11 November 2009 21:05 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 916
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Sorry, it was a long time since Kran was developed. It looks like ConveyorThread is of much newer version than RS232Thread you use. I'm afraid for now I have no time to support it, as completely new version of RS232 library is under heavy development (it is crossplatform and based on 3rd part lib).
Re: About RS232 [message #23682 is a reply to message #23666] Fri, 13 November 2009 04:40 Go to previous messageGo to next message
gxl117 is currently offline  gxl117
Messages: 71
Registered: March 2009
Location: China
Member
Look it like a VC7.1's RTTI problem.
Re: About RS232 [message #24408 is a reply to message #23682] Fri, 15 January 2010 00:10 Go to previous messageGo to next message
nixnixnix is currently offline  nixnixnix
Messages: 415
Registered: February 2007
Location: Kelowna, British Columbia
Senior Member
Hi,

I'm wondering if there was ever any progress made on getting a Linux version to work. I have a serial port class for windows which I didn't post as it seems like it got overtaken by other posts.

Seems like there should be plenty of open-source code out there but I'm not finding it.If I find a way before this gets answered then I'll post what I find.

Nick
Re: About RS232 [message #24633 is a reply to message #24408] Tue, 26 January 2010 04:39 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
I would also like something in U++ to work with serial ports.

The example for sockets is very good and I will be using that.
If something similar for serial ports could be done that would be great.

I have worked with serial ports for GPS data using:

Python with PySerial

Java with rxtx

Windows with:
#using <System.dll>
using namespace System;
using namespace System::IO::Ports;
using namespace System::Threading;
using namespace System::IO;
using namespace std;

I have tried and have the code for wxTerminal but digging through the code and trying to get something to work with U++ is something I have not tried.

Something to work with serial ports for Win and Linux in U++ would be a real plus.

[Updated on: Tue, 26 January 2010 04:46]

Report message to a moderator

Re: About RS232 [message #24672 is a reply to message #24633] Tue, 26 January 2010 22:54 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 488
Registered: November 2008
Location: France
Senior Member
I have a basic serial port package for linux only (sorry) but it works well.
I'll post it as soon as possible

Re: About RS232 [message #24673 is a reply to message #24672] Tue, 26 January 2010 23:21 Go to previous messageGo to next message
nixnixnix is currently offline  nixnixnix
Messages: 415
Registered: February 2007
Location: Kelowna, British Columbia
Senior Member
Hi Didier,

That would be great as then its just a case of preprocessor directives to choose between my windows serial code and the linux serial code.

Cheers,

Nick
Re: About RS232 [message #24928 is a reply to message #24673] Fri, 05 February 2010 00:19 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 488
Registered: November 2008
Location: France
Senior Member
Hi nixnixnix,

sorry for delay, but I'm missing time.

Here is my very basic serial port package for linux.

There is only open(port, speed)/close and read/read_timed/write.

But with that you can treat 90% of the cases.
Re: About RS232 [message #25030 is a reply to message #24928] Mon, 08 February 2010 21:45 Go to previous messageGo to next message
nixnixnix is currently offline  nixnixnix
Messages: 415
Registered: February 2007
Location: Kelowna, British Columbia
Senior Member
Thanks Didier,

Will give it a shot. Am just reading NMEA sentences from GPS so it should be more than I need Smile

Cheers,

Nick
Re: About RS232 [message #25650 is a reply to message #24928] Sat, 06 March 2010 02:31 Go to previous messageGo to next message
nixnixnix is currently offline  nixnixnix
Messages: 415
Registered: February 2007
Location: Kelowna, British Columbia
Senior Member
Hi Didier,

Works fine although one needs to know of course that the serial ports are named

/dev/ttyS1
/dev/ttyS2

etc.

Also, its more useful to return whether the port is open or not. I will post my modification of your serial port class once I've had time to clean them up but if anyone else wants serial port code, post here and I will pull my finger out.

Nick
Re: About RS232 [message #25652 is a reply to message #25650] Sat, 06 March 2010 11:38 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
It would be good to get this implemented in upp.
Maybe
If win ports = COM7, COM8, ...

If unix ports = /dev/ttyS7, /dev/ttyS8, ...

As posted on 26, January I have used serial ports extensively on Win. Getting something that is cross platform would be great.

Getting rid of the requirement for:
using namespace System::IO::Ports;
and using something that works on Win and Linux.

All the parsing, etc. is no problem.
Re: About RS232 [message #25661 is a reply to message #25652] Sat, 06 March 2010 18:42 Go to previous messageGo to next message
Reini is currently offline  Reini
Messages: 28
Registered: April 2009
Location: Berlin
Promising Member
Hello NL,

Since I red a lot of it in the past that U++ Users request RS232 support I just thaught of trying the challenge.

Several years ago I programmed the RS232 with Visual Basic and had the common problem that most VB Users can code 95% of the features in 10% of the time or so Very Happy

Back then the whole PC was at 100% CPU load, stuck completely and I had data loss packages if I went above 56k Laughing

It was a nightmare and in the end I couldn't solve it with VB since it does not allow threading and stuff.

Anyway because I spent back then a lot of time with RS232 and designed an RS232 Monitoring Program for filtering characters my Idea would be to publish an updated version in C++ for this.
So I could try to get all my knowledge from then into an RS232 Lib for Upp could be a challenge.

Do you have already some code ?
If you are interested I could provide also the old VB Version.

Greetings
Re: About RS232 [message #25665 is a reply to message #25661] Sun, 07 March 2010 00:33 Go to previous messageGo to next message
nixnixnix is currently offline  nixnixnix
Messages: 415
Registered: February 2007
Location: Kelowna, British Columbia
Senior Member
Ok here is what I've got. Its clumsy but it works for both Windows and Linux. I have attempted to modify Didier's code to provide a more unified interface but it could be done a lot better.

Basically it does what I need just now and like I say it works on both platforms. My main addition is to provide a common Open function as well as an IsOpen function.

Nick
  • Attachment: Serial.cpp
    (Size: 7.74KB, Downloaded 985 times)
  • Attachment: Serial.h
    (Size: 2.61KB, Downloaded 685 times)
Re: About RS232 [message #25671 is a reply to message #25665] Sun, 07 March 2010 12:58 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
Reini: The code I use just follows after the connection.

For the connection on Win it's System::IO::Ports
With Java it's rxtx
With Python it's PySerial

With your experience and what Nick has maybe something can
be put together that Mirek and others can check and possibly have that included in Upp.

I will look closer at Nick's code, I couldn't find termios.h, is that included in C++ ?

Neil

[Updated on: Sun, 07 March 2010 13:14]

Report message to a moderator

Re: About RS232 [message #25673 is a reply to message #25671] Sun, 07 March 2010 13:38 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 488
Registered: November 2008
Location: France
Senior Member
Hi Nick and others,

I'm happy to see that that you managed to use my linux serial port package and even added the windows support.

It would be a good idea to continue the effort and make a complete management of the serial port, add support for:
- handshake
- parity
- ....

Also, I think it would be a good idea to have SerialConfig struct that would enable easy management of predefined configs.

We could use the port number instead of /dev/tts0 or COM1 to make it fully portable.


I can manage the linux version enhancements, can you manage the windows version ?

What do you think Nick.

Re: About RS232 [message #25679 is a reply to message #25673] Sun, 07 March 2010 17:25 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 916
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Why don't use wxSerial from wxWidgets?
icon14.gif  Re: About RS232 [message #25681 is a reply to message #25679] Sun, 07 March 2010 19:50 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 488
Registered: November 2008
Location: France
Senior Member

Why don't use wxSerial from wxWidgets?


If there are no links to wxWidgets inside the code that can get very simple to do.
But even if there are some links to wxWidgets, we will probably find some corner cases linked with porting issues that we would also have to resolve.

So taking a look will probably get very instructive.

I'll try to find the time to look at it.

Thank's for the tip
Re: About RS232 [message #25683 is a reply to message #25681] Sun, 07 March 2010 20:56 Go to previous messageGo to previous message
Didier is currently offline  Didier
Messages: 488
Registered: November 2008
Location: France
Senior Member
I've just looked at wxSerial.
OK it's a serial port Smile

But I'm not sure the wxWindows license is compatible with the BSD of UPP ?

Anyway a serial port is simple enough to do it without copying it.

Previous Topic: templated callback
Next Topic: Memory Mapped Files
Goto Forum:
  


Current Time: Mon Dec 09 20:10:15 CET 2019

Total time taken to generate the page: 0.01594 seconds