Previous in Forum: Hard-Wired Telephone Dilema   Next in Forum: DC POWER SUPPLY
Close
Close
Close
28 comments
Rate Comments: Nested
Associate

Join Date: Feb 2007
Location: USA
Posts: 43

Data Logging from RS232 Device

08/06/2009 10:10 PM

Hello Friends,

Is there a simple way to log data at a certain rate, say one sample every 10 seconds from a device that you can send a command and get a reading to log some test data.

Best Regards,

Carlos

Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

Good Answers:

These comments received enough positive votes to make them "good answers".

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 16512
Good Answers: 670
#1

Re: Need to log data from an RS232 device

08/07/2009 3:25 AM

Plug it into a printer

Or in the old days you could have written a Quick basic program to store it in a file. But uncle Bill doesn't want the proles writing software, he doesn't want user friendly computers.
He wants computers that appear to be user friendly.
Del

__________________
health warning: These posts may contain traces of nut.
Register to Reply
Guru
Hobbies - Musician - Engineering Fields - Chemical Engineering - New Member Engineering Fields - Control Engineering - New Member Engineering Fields - Instrumentation Engineering - New Member

Join Date: Jan 2007
Location: Moses Lake, WA, USA, Thulcandra - The Silent Planet (C.S. Lewis)
Posts: 4216
Good Answers: 194
#2
In reply to #1

Re: Need to log data from an RS232 device

08/07/2009 9:12 AM

Proles? What does that mean; I've just never heard it before.

__________________
"Reason is not automatic. Those who deny it cannot be conquered by it. Do not count on them. Leave them alone." - Ayn Rand
Register to Reply
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 16512
Good Answers: 670
#3
In reply to #2

Re: Need to log data from an RS232 device

08/07/2009 10:01 AM

Abrev' for Proletariat.
Come the revolution Bill Gates will be there with my financial advisor
Del

__________________
health warning: These posts may contain traces of nut.
Register to Reply
Commentator

Join Date: Jun 2009
Posts: 58
Good Answers: 1
#6
In reply to #1

Re: Need to log data from an RS232 device

08/08/2009 12:16 AM

Wow! Dell, Quick Basic?!!!!

Certainly showing your age there. I didn't know cats lived that long!!!

Quick Basic, I haven't heard those words in god knows how long.

Don't fret though, I have a Windows 98 desktop with QBasic installed on it. Don't use the QBasic, but the desktop comes in real handy for programming older controllers through the serial port.

Register to Reply
Guru
Panama - Member - New Member Hobbies - CNC - New Member Engineering Fields - Marine Engineering - New Member Engineering Fields - Retired Engineers / Mentors - New Member

Join Date: Dec 2006
Location: Panama
Posts: 4273
Good Answers: 213
#10
In reply to #1

Re: Need to log data from an RS232 device

08/08/2009 12:45 AM

Del-

Uncle Bill does not want you to do anything with your computer that he does not personally approve of. Uncle Steve is the same. If you want to do serious work with a computer, you are generally on your own...

Register to Reply Off Topic (Score 5)
Power-User

Join Date: Mar 2007
Posts: 284
Good Answers: 6
#14
In reply to #10

Re: Need to log data from an RS232 device

08/08/2009 6:15 AM

Anyone who absolutely insists on self sufficiency can (at a fairly modest price) buy a programming language that functions within, for instance , WINXP. The one I use is very versatile, quick and powerful. I'll gladly offer name and address to anyone venturesome enough to try. BTW, it monitors both RS232 and USB ports.

__________________
Constant change is here to stay!
Register to Reply
Guru
Panama - Member - New Member Hobbies - CNC - New Member Engineering Fields - Marine Engineering - New Member Engineering Fields - Retired Engineers / Mentors - New Member

Join Date: Dec 2006
Location: Panama
Posts: 4273
Good Answers: 213
#15
In reply to #14

Re: Need to log data from an RS232 device

08/08/2009 10:02 AM

If one is really wanting to explore the true power of the PC, one should investigate the Forth programming language. NOT for the feint of heart, but able to unlock the native speed of your hardware...Daunting for monitoring and manipulating ports, but, once you grasp the essentials, tremendous power.

Register to Reply
Power-User

Join Date: Mar 2007
Posts: 284
Good Answers: 6
#16
In reply to #15

Re: Need to log data from an RS232 device

08/08/2009 11:54 AM

Being definitely faint of heart, at least where Forth is concerned, I prefer a more 'normal' language. The one I've mentioned is convenient for me because it is fast and accepts multi dimensional matrices of any size within memory size restrictions. Also matrix manipulations. This helps a lot in data acquisition. This language has most direct commands that are used in communication which enables redirection of both raw and processed data. Unfortunately I'm not a shareholder.

__________________
Constant change is here to stay!
Register to Reply
Guru
Panama - Member - New Member Hobbies - CNC - New Member Engineering Fields - Marine Engineering - New Member Engineering Fields - Retired Engineers / Mentors - New Member

Join Date: Dec 2006
Location: Panama
Posts: 4273
Good Answers: 213
#17
In reply to #16

Re: Need to log data from an RS232 device

08/08/2009 12:32 PM

Dovy-

I would like to have a look at the software you are recommending. By the way, SciLab has similar capabilities, although I have not used it to communicate with my meters as yet. SciLab is a free (as in beer) answer to MatLab. Also, if you are into Linux, QTDMM offers a quick and easy solution to monitoring DMM's, creating real-time plots, ets. Unfortunately, it currently works only with certain DMM's, but, since it is written in c, it is pretty easy to hack to work with most meters...

Register to Reply
Power-User

Join Date: Mar 2007
Posts: 284
Good Answers: 6
#18
In reply to #17

Re: Need to log data from an RS232 device

08/08/2009 1:00 PM

Hi cwarner,

Theoretically I'm into Linux of course, but practically...

Try looking into PowerBasic. It is not free. They have a comprehensive site explaining the varieties offered. The program is a modern and much improved descendent of the late lamented TurboBasic. It is very fast, so that quite a lot can be accomplished between data frames.

For a data acquisition project it was acquiring 4 channels at 1 Hz via an RS232 port with an on-line output of the data and its running statistics via a USB port. This was done without any need for sophisticated programming.

__________________
Constant change is here to stay!
Register to Reply
Guru
Engineering Fields - Electrical Engineering - Analog and Digital Circuit Design Engineering Fields - Electromechanical Engineering - Transformers, Motors & Drives, EM Launchers Engineering Fields - Engineering Physics - Applied Electrical, Optical, and Mechanical

Join Date: Jan 2008
Location: NY
Posts: 1207
Good Answers: 119
#4

Re: Data Logging from RS232 Device

08/07/2009 3:03 PM

I have used these before for low rate data logging. Have not found anything better for the prices offered. Starter serial port and UBS versions are available. Best wishes.

http://www.dataq.com/products/startkit/di194rs.htm

Register to Reply
Power-User

Join Date: Sep 2007
Location: Christchurch, New Zealand
Posts: 168
Good Answers: 18
#5

Re: Data Logging from RS232 Device

08/07/2009 11:25 PM

Can you be a bit more specific about what you want to log.

If this device is outputting data on an RS232 port, you could simply connect it to the RS232 port of a computer and use a program like CrossTalk which will monitor the port and log the data to a text file.

I have done a lot of work on this kind of thing but you need to be a bit more specific about the application.

Register to Reply
Guru

Join Date: May 2006
Location: Placerville, CA (38° 45N, 120° 47'W)
Posts: 6215
Good Answers: 248
#7
In reply to #5

Re: Data Logging from RS232 Device

08/08/2009 12:19 AM

What about laptops that have no RS232 port? The RS232 to USB converters I've tried didn't work with older RS232 devices that don't identify themseves.

__________________
Teaching is a great experience, but there is no better teacher than experience.
Register to Reply
Guru
Panama - Member - New Member Hobbies - CNC - New Member Engineering Fields - Marine Engineering - New Member Engineering Fields - Retired Engineers / Mentors - New Member

Join Date: Dec 2006
Location: Panama
Posts: 4273
Good Answers: 213
#9
In reply to #7

Re: Data Logging from RS232 Device

08/08/2009 12:43 AM

dkwarner (interesting name...)

I have had good luck with older equipment through RS232 to USB converters, including some that don't identify themselves. There are a number of tools out there that can help. If you have a specific need, contact me by private message, and maybe I can help point you in the right direction...

cwarner

Register to Reply Score 1 for Good Answer
2
Guru
Panama - Member - New Member Hobbies - CNC - New Member Engineering Fields - Marine Engineering - New Member Engineering Fields - Retired Engineers / Mentors - New Member

Join Date: Dec 2006
Location: Panama
Posts: 4273
Good Answers: 213
#8

Re: Data Logging from RS232 Device

08/08/2009 12:40 AM

I have written a macr5o in Excel that reads a multimeter over RS-232 and generates a spread sheet and real-time plot of data received, and will share it with you gratis. If you can give me some idea as to the protocol required (i.e., commands to send to the instrument, and format of returned data), I can help you customize the program to meet your specific application. I have shared this in the past here on CR4. Contact me by private message.

Register to Reply Good Answer (Score 2)
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 16512
Good Answers: 670
#13
In reply to #8

Re: Data Logging from RS232 Device

08/08/2009 2:58 AM

I have written a macr5o in Excel that reads a multimeter over RS-232 and generates a spread sheet and real-time plot of data received,
Cool...Nice one.
Del

__________________
health warning: These posts may contain traces of nut.
Register to Reply
Commentator

Join Date: Jun 2009
Posts: 58
Good Answers: 1
#11

Re: Data Logging from RS232 Device

08/08/2009 12:54 AM

Yes, as Del said you can use the printer port. There is a DLL called inpout32.dll. I have used it with Delphi 7 for monitoring and controlling AC Units. You can create a text file to store your data in a format that can be exported to Excel. You can use Activex Serial Com port to write your COM program. They also have the code for VB, C++, etc.

There are many serial port loggers available for free. Some with source code, some without. The only problem you will encounter will data logging directly from the computer is that if there is a power outage or the program gets terminated, then you lose your data logger. If what you are connecting to isn't buffered, you could loose your COM port. If you are into microcontrollers, you can build a simple data logger with either Atmel or Freescale controllers.

You can also use the good old Hyperterminal to log inputs on the serial port

Serial Port Datalogging

Register to Reply Score 1 for Good Answer
Power-User

Join Date: Jan 2009
Location: Currently on break at home in Houston, Texas USA
Posts: 268
Good Answers: 20
#12
In reply to #11

Re: Data Logging from RS232 Device

08/08/2009 2:07 AM

"If what you are connecting to isn't buffered, you could loose your COM port." - your mind, your reputation, your job, etc., etc., etc..

Register to Reply
Power-User

Join Date: Dec 2006
Posts: 442
Good Answers: 32
#19
In reply to #12

Re: Data Logging from RS232 Device

08/08/2009 2:16 PM

I used to work with some instrumentation that communicated through the serial port, using a language called ASYST.

One day, I hooked up an instrument to the computer, but it would not communicate. So I tried the same computer on second instrument, and still no communication. Figuring that there was something wrong with the computer port, I tried a different computer on the first instrument. No communication. I tried a third computer on a third instrument. Success!

I then tried the third computer on the first instrument. No communication. Just to double check, I again tried the third computer on the third instrument (the combination had just previously worked), and now that didn't work either!

Well, I don't remember if I continued beyond this or not, but I finally figured it out.

The first instrument had a bad port. When the instrument port was connected to the computer, it fried the computer's port. The failure was such that the fried computer port would now fry the next instrument port that it was connected to. Which also left the instrument port in a state that would fry the next computer port, and so on.

So, 1 bad instrument port ended up taking out at least two other instruments, and at least 3 different computers.

What a nightmare!

Tad

Register to Reply Off Topic (Score 4)
Guru
Panama - Member - New Member Hobbies - CNC - New Member Engineering Fields - Marine Engineering - New Member Engineering Fields - Retired Engineers / Mentors - New Member

Join Date: Dec 2006
Location: Panama
Posts: 4273
Good Answers: 213
#20
In reply to #19

Re: Data Logging from RS232 Device

08/08/2009 6:04 PM

Why is this rated off topic? If one is interested in data acquisition, this sort of information is quite valuable. Actually, I think this sort of event was pretty common in the early days, and my be one reason why RS232 has been pretty much abandoned in the industry. I still prefer it, however, over USB- much more control possible, much more flexibility. I haven't figured out how to drive a set of stepper motors from USB without an external PIC- one can drive such devices directly from the old RS232 port (or the old Centronics Printer port, which also seems to be on the way out...)

Register to Reply Off Topic (Score 4)
Commentator

Join Date: Jun 2009
Posts: 58
Good Answers: 1
#21
In reply to #20

Re: Data Logging from RS232 Device

08/08/2009 9:51 PM

Here is the answer to that problem. Maxim has a chip that now allows you to abandon the RS232 and move onto USB...isn't it about time?! You can connect USB to Anything, so they claim.

I requested samples and got them. Just register at their site and your set. They are one of the better companies if you are doing any small design work. I think they ship anywhere in the world, plus you can order right from their site, cutting out the middle people.

It's the MAX3420E and you should be able to connect directly to anything. No more fried COM ports. I'm going to see if I can write a small datalogging program for it using it's dedicated IO lines.

I'll keep you posted. Let me know if you can get samples to where you are.

Greenja

Register to Reply Off Topic (Score 4)
Power-User

Join Date: Jan 2007
Location: Berlin (Germany)
Posts: 332
Good Answers: 1
#22
In reply to #19

Re: Data Logging from RS232 Device

08/09/2009 6:19 AM

ASYST was one of the most powerful systems for data acquisition and evaluation I`ve ever programmed. It was based on FORTH language with highest stability and least space, unfortunately overrun by these clicky-clicky graphical systems with that windows-overhead noone needs really if he/she wants a stable and reliable application.

__________________
The sum of intelligence on earth is a constant. And the population grows and grows and .....
Register to Reply
Guru
Panama - Member - New Member Hobbies - CNC - New Member Engineering Fields - Marine Engineering - New Member Engineering Fields - Retired Engineers / Mentors - New Member

Join Date: Dec 2006
Location: Panama
Posts: 4273
Good Answers: 213
#23
In reply to #22

Re: Data Logging from RS232 Device

08/09/2009 11:09 AM

I like Forth, because it gives me CONTROL. One can shut down all the eye candy so that the machine is dedicated to only the process at hand- and that is where the stability comes from (and stability and speed can be very important for data acquisition). I have never tried ASYST- got introduced to Forth when I decided to try to use my Palm Tungsten for some data acquisition projects- and went on to use it on my DOS boxes (I still prefer c, but that is mostly because of familiarity with c- Forth is a whole lot more powerful).

Register to Reply
Commentator

Join Date: Jul 2008
Location: LA, CA
Posts: 97
#24

Re: Data Logging from RS232 Device

08/09/2009 4:06 PM

Well, there are too many unknowns... And the Op hasn't posted another responce... And one person noted that many laptops today do not have an RS232 port, even some desktops too.

Here's some suggestions for an RS232 to USB converter - down near the bottom...

http://cr4.globalspec.com/thread/40250/RS232-Cables-and-Long-Distance-Transmissions

I think there's info on why 'generic' USB to RS232 converters do not work - especially with legacy devices.

Other factors could include that this data may be needed for Validation... Too many factors un-noted by the Op.

__________________
Bla - de - bla - de - BLA!!! "That's Me!!!"
Register to Reply
Commentator
Technical Fields - Technical Writing - New Member Engineering Fields - Environmental Engineering - New Member

Join Date: May 2009
Location: The 'Hub of the South Pacific'; 18.15°S, 178.45°E
Posts: 68
Good Answers: 1
#25

Re: Data Logging from RS232 Device

08/09/2009 10:08 PM

I assume you have a data logger that you need to program. If so, do you have the support software (Windows-based perhaps?) that would enable you to program the unit? Do you have a direct connection to your logger (from your notebook PC) or do you communicate via telemetry? Either way, if you were for example, using loggers from Campbell Scientific Inc., (like me) you could - while programming, set your execution interval to 10s, write in your measurement (I/O) instruction(s) and then immediately follow it (them) up with your program control instructions (e.g. DO - set output flag high) and output processing instructions (set active storage area, sample, average, etc.). Once you've successfully compiled your program, just send it down the line to the station (logger). Wait one minute and then retrieve your six sets of test data. Other loggers (brands) most probably work along similar lines regardless of whether they execute in sequential or pipeline mode.

__________________
VT
Register to Reply
2
Associate

Join Date: Nov 2006
Posts: 30
Good Answers: 1
#26

Re: Data Logging from RS232 Device

08/10/2009 7:24 AM

Dear Moreirc,

Simple, all you need is a PC with Windows and a serial port. If your PC (or laptop) does not come with a serial port (new ones often don't these days) then you can use a Serial to USB converter (approx. Euro/USD 25)

Run the program (included with Windows) called HyperTerminal.

Create a new connection and specifiy Connect using COM1 (or whatever your USB/Serial converter has asigned itself to (i.e. COM4).

Specifiy the baud rate, data bits parity etc. to suit your app.

The most common settings are: (baud rate this will depend on your device)

Data bits: 8

Parity None.

Stop bits 1.

Handshaking: None.

Some of these may vary but in my experience these account for 90% of serials comms settings.

You should see data now appearing on the screen.

If you see garbage characters this indicates that the COMs settings above might need fiddling with. -The manufacturer of the device should be able to advise you of the data format if you don't already know it.

Once you see data that looks to what you after you can select "Capture Text" from the "Transfer" menu and everything received from the device will be stored into the file that you specify.

The downside of this method is that you don't have an timestampting in the data -but if you just need to capture for later review then it is very simple and involves no extra spending!

Hope it helps.

Ian

Register to Reply Good Answer (Score 2)
Guru
Engineering Fields - Electrical Engineering - Been there, done that. Engineering Fields - Control Engineering - New Member

Join Date: Dec 2008
Location: Long Island NY
Posts: 15600
Good Answers: 981
#27

Re: Data Logging from RS232 Device

08/10/2009 2:50 PM

Wow, 26 entries at the time that I make this response and none of them bring up the "homework" clause. I must be getting over sensitive.

__________________
"Don't disturb my circles." translation of Archimedes last words
Register to Reply Off Topic (Score 5)
Guru
Panama - Member - New Member Hobbies - CNC - New Member Engineering Fields - Marine Engineering - New Member Engineering Fields - Retired Engineers / Mentors - New Member

Join Date: Dec 2006
Location: Panama
Posts: 4273
Good Answers: 213
#28
In reply to #27

Re: Data Logging from RS232 Device

08/10/2009 5:38 PM

Even if this is homework, it is likely not something that is going to be covered in most school curricula...

Register to Reply Off Topic (Score 5)
Register to Reply 28 comments

Good Answers:

These comments received enough positive votes to make them "good answers".

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Copy to Clipboard

Users who posted comments:

cwarner7_11 (8); dkwarner (1); dovy (3); Greenja (3); Ian (1); Maths_Physics_Maniac (1); Mikerho (1); mjb1962853 (1); redfred (1); Tad (1); tropicalspeed (1); user-deleted-1105 (3); uweka (1); VT (1); Walts_Worker (1)

Previous in Forum: Hard-Wired Telephone Dilema   Next in Forum: DC POWER SUPPLY

Advertisement