How to visualise data in widows? ( serial and USB I/O )

Go To Last Post
15 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi folks :)

I am working on my project and now it is a time to jump to another part of it - communication with PC.

I made some research and I would like to connect my AVR`s via FTDI chip.
I don`t think so it would be a big problem.
I will make some tests with MAX232 chip and serial port cause it is not smd like FTDI chip and in this way easier to implement.

But my main concern is connected with visualization of the data which I would be sending via USB or serial port.

Let`s assume that I have connected with computer and I can read and send some data from the Hyper Terminal.

But how to visualize these data.
I would like to show them on the screen.
Just all i want to do is to make nice signal charts.

How would you do that?? What is the easiest approach ??
Which language would you choose ??
Maybe Matlab is a good solution ??
(They have student`s versions)

I am not so proficient in programming.
I can programm in C++, pascal but(would rather not use it)

I found nice thread from 2005:

https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=28136&highlight=matlab

After reading it I am more confused now.
But this is it what I am asking.
What is your experience with this subject ??
Maybe something changed from 2005.
Do you think Visual C# is still option no. 1

Maybe you can recommend me some books or tutorials about visualizing data from I/O device ??
or libraries for I/0 ??

Waiting for your advice. :)

Adam

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Perhaps your best bet it to try something like GNUPlot and spend your time formatting signal data for the serial port. (I've written several plotting applications in C++ and it is not trivial.)

Besides GNUPlot consider using Excel. Matlab will work but it is expensive, hence the nickname Matpig.

C: i = "told you so";

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here are two ideas..... have the avr send the data points as ascii multicharacter number (like 12345), comma, ascii number, comma. 'Capture' this data on the pc to a file. Use a comm program, or just write a simple program. Use Excel to import the 'comma delimited file' and graph it. This idea is 'non real time'... each step must be completed in order.... but you could write a program to do receive data into a buffer, graph the buffer, in a loop that repeats. This could look like a medical chart scrolling, etc.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can use Visual Basic to comm with the the Atmel & also easily calculate & put up any way you like.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hmm...

Gnuplot sounds really great !!!
But as far as I am concerned it is software for non real time ploting. Am I right ??
Excell seems to plot as well in non real time.

Yes these options are great for non real time ploting.
You just copy data from hyper terminal and paste it to the gnuplot or excel. Sounds good and not so difficult.

cpluscon wrote:
Matlab will work but it is expensive, hence the nickname Matpig.

:) :) :)
Nice nickname never heard before ;)
Yes I am a student and matlab is extremely expensive for me.

avrcandies wrote:
You can use Visual Basic to comm with the the Atmel & also easily calculate & put up any way you like.

Yes I can. I can also use Visual C#. Did you know ;)

Do you have any other suggestions how to plot data ?
How to plot graphs in real time ?

Adam

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It really depends on how many channels of data you are going to plot and if you need a lot of built-in features such as Zooming and Scrolling while plotting or annotations, cursors, etc... If this is a commercial venture I highly recommend using IOCOMP's line of products. Their PlotPack is by far the best near "real-time" product I have found. I have evaluated quite a few. Many are resource hogs and don't offer smooth scrolling with limited features.

The IOCOMP Plot pack link $859.00 http://www.iocomp.com/Products/D...

It is somewhat expensive for a hobbyist but to try to re-create what they have done in man hours would not even equate to their price unless you have a ton of spare time on your hands.

If you want something that is a little cheaper that you can use in your own applications you can try out NI Measurement Studio 8.1. It comes with plenty of controls and is made to be used with Visual Studio .NET and offers a few different varieties of plot controls. The standard edition will give you what you need and probably more controls you can use later for $499.00

http://www.ni.com/mstudio/

http://www.ni.com/mstudio/whats_...

There is also a free "Real-Time" Oscilloscope DLL Library that you can use from C# as it has some wrapper classes on their site showing you how to call it. I personally tried it out but found for what my application needed it just didn't have the feature set.

http://www.oscilloscope-lib.com/

You could even use a standard line chart using one of the bigger .NET component toolkits like "Component One", "Infragistics", "Xceed", or "Nevron"

Anyways I have more links and info if you need it as I have tried almost all of the commercial and freeware controls out. I highly recommend IOCOMP if this is something you wish to sell as I use it in my own data logging software and it has been very reliable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ifryd wrote:

But as far as I am concerned it is software for non real time ploting. Am I right ??

Well, yes, but you can make it plot "real time". I do that all the time, though, under linux. But this should work in the same way under windows, too.

Ifryd wrote:

Yes these options are great for non real time ploting.
You just copy data from hyper terminal and paste it to the gnuplot or excel. Sounds good and not so difficult.

The point is that with gnuplot you haven't got to do anything with your data, you simply plot it. So, put the data in a file, and then make your programme call gnuplot with that file whenever you have a new data point. Something like this:

echo "plot 'yourfile' using 1:2 with points" | gnuplot -persist

When you want to update your plot, you've got to kill the previous instant of gnuplot from your programme.
Hope this helps,
Zoltan

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've never used it but Labview probably provides for real-time displays, but again more $$$.

Writing a simple virtual scope with VB or C# based on serial port data would be an excellent exercise to learn from.

C: i = "told you so";

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Bray terminal has a simple graphing function.

Arthur

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am using terminal program Tera Term Pro (many thanks for Mr. Teranishi for this simple but nice program) logging together with gnuplot.
There is no need to program anything (except two simple script files and one .bat file). Just unzip the attachment, and you are ready to go (of course, if you have installed gnuplot already)

plot_log_file.bat:

REM batch file for starting data plot, from log file 
"C:\Program Files\gnuplot422\bin\pgnuplot" init_plot.gnp

script file for gnuplot initialization init_plot.gnp:

#
#### gnuplot script, which is initializing plotting process ####
#

# this variable holds value how many lines are used to plot data already
processed_lines=0

# this constant defines how many lines_from_the_end_of_file to plot (change according to your needs)
lines_from_the_end_of_file=3000

# this constant defines how many new data lines are received every second (change according to your needs)
lines_per_second_received=1

# log file to be plotted
file2plot='com_port.log'

# how data should look on a screen
set style data lines

# call script, which does real time plotting
call 'real_time_plot.gnp'

script file which runs real time plot real_time_plot.gnp:

#
#### gnuplot script, which is plotting in the real time (well, almost :)  ) ####
#

# this part expects one column of data per line (row) and is 
# plotting lines_from_the_end_of_file if started together with logging process. 
# If started later, when file is bigger than lines_from_the_end_of_file,
# it is plotting more lines. 
#if (processed_lines

Best regards,
Gintaras

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am working on a project like that, to log temperatures and display them or static or realtime.
I am using Java, RXTX api for serial communication, and JFreechart api for displaying the graph.

My biggest concern for the moment is that I am pretty new to AVR and don't know how to make a stable communication between AVR and PC.

Besides the transfer of data I will be using commands comming from java to ask for certain temperatures and even add new DS1820, Set Time etc

anyone with some knowledge about uart communication for sending commands, calculating CRC buffer overflow etc

regards Zuran

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for many solutions :)

Well I need to plot about 8 signals one below another.
These will be mainly TTL signals. (frequency is not so high)
The IOCOMP Plot pack looks really good.
But as I said I am student and spending 800$ for such software is to much for me. This at first I would like to use for my master degree work.

I think I will stay with gnuplot and Tera Term Pro.
This option seems to be the best for me cause you don`t have to program anything on PC just providing few scripts.
Really worth to try and apart from that it is for free.
I hope I gonna plot in real time. :)

What worries me is which FTDI chip should I use.
I would like to make such an usb converter (adaptor) based on this chip.

Do you have one good design for such a FTDI converter?
I mean simple schema for such adaptor?

I found some with crystal clock sometimes they have additionacl eproms. What is the best design ?

In my store I can buy only:

FT232BL
FT232RL
FT232RQ

Adam

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

FT232RL - the 'RL' version needs only a couple of external resistors to be a standalone USB to serial converter; it's 'easily' solderable (0.65mm spacing on the pins) while the 'RQ' looks like a pain; it's a nasty QFN32 package which could be difficult to reliably solder by hand.

One trick I have used - I have a range of data variable, some binary, some eight-bit, some sixteen-bit - is to send both the actual data so humans can see the real numbers, and the same data but scaled so that they all have the same full-scale range. This means they can be sensibly plotted (I use CSV into excel) without the lower range values all hiding at the bottom of the graph.

Neil

edit - for the simple schematic - check the sample circuits on the FTDI data sheet. They work.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ifryd wrote:
Hi folks :)

But how to visualize these data.
I would like to show them on the screen.
Just all i want to do is to make nice signal charts.

How would you do that?? What is the easiest approach ??
Which language would you choose ??
Maybe Matlab is a good solution ??
(They have student`s versions)

I am not so proficient in programming.
I can programm in C++, pascal but(would rather not use it)

Adam

When I read this I think Java...

In java there are classes to do:
1. A serial input stream
2. Create a nice little window
3. Plot the data in the window in real-time.

Cheers
Johan

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,
Checkout
http://www.windmillsoft.com/acat...
They have a free version of Windmill DAQ software for users who subscribe to the Monitor newsletter.
This software has LabIML a generic serial interface for DAQ data aquistion from the serial port or USB/serial virtual port. You will be able to graph and log the serial data in real time. There are some limitations if I remember correctly the sample rate may be 10Hz maximum but well worth checking out.

Regards
Dez Ellis