urgently required a solution in the form of code

S

Thread Starter

somya sahu

I would like to read a text string from a device which connected to the serial port and save this string into a text file or database.
My primary problem is to get the information from that buffer into a text file .

I tried with hyperturn using windows.
It was OK i WAS ABLE TO READ THE BUFFER.
I do this with linux, c, c++
 
I have not done this in a long time, but Hypertermal has a way to save the data to a text file. There are several options in the "transfer" menu. I have not used the feature to save data very frequently, but I've used a similar method to send text files to remote devices on many occasions.

KEJR
 
J

Jerry Miille

I am not exactly sure what you want to do with these strings but if what you want to do is capture them as a text file and later process the information, you could use a feature built into our free program that is normally used for configuring and then debugging the operation of our protocol converter products.

You can download a free version here http://www.miille.com/OmniiConfig.zip

Install it and start it up. Ignore all the stuff about configuring our Omnii-Comm product and click on the Communications menu item and click on the Emulator Mode button. Enable the Log File to Disk check box option at the bottom of the screen. Use the Setup button to select the Com port and communication settings. From then on, whatever comes in the serial port is logged to a disk file. New files are created at midnight every day. The maximum size of the log file is configurable. Old log files are automatically erased. The number of log files to keep is user configurable.

Might do just what you need! If you have any questions, you can contact us at the addresses located at the bottom of the home page, miille.com

Jerry Miille

Miille Applied Research Co., Inc.
http://www.miille.com/
 
For simple "save to a text file" type application, try one of these:

http://aplawrence.com/BGarlock/logger.html
http://sourceforge.net/projects/slsnif/
http://rocasa.org/ttylog

If you are trying for more elaborate behaviour tailored to you application, then the easiest way is to write a Python program that uses the "pyserial" module. Reading the serial port is just a few lines of code. If you want to format messages, handle errors, interact with the database, displaying data on a GUI etc. then that involves more work and can't be dealt with in an off the shelf program. However, I've done things like that in about 250 lines or less of Python (including a GUI).

So, the real answer to this will depend on the details of what it is you want to do.
 
Top