Sign in to follow this  
Followers 0
MikeP

RS232 Multiple Connections

4 posts in this topic

Good Afternoon everyone, I have an application where i need to take mutliple RS232 connections back to a PC for Data collection. Example; in one machine we have we have 3 terminals that independantly record data. We want to take all the data off them back to a PC and place that information in an excel sheet. Is there a converter box that cna take each connection to an ethernet connection and gather that information say using hyperterminal. Hope this makes sense. Thanks for any help you may be able to give me. Mike

Share this post


Link to post
Share on other sites
The bigger issue here is not just making the connections. That's actually fairly easy. The bigger issue is even when you've got all these data streams going to the PC, have you considered how you are going to deal with them? The "converter box" you are referring to is probably a "serial server". Take a look at www.digi.com. They sell several versions including a couple that have multiple RS-232 ports on them. There are a couple ways you could use this. You can write your own code to directly access serial servers via TCP/IP connections. Or if you wanted to take a more crude approach, several of these systems (including Digi) create "virtual" COM ports on a PC. So at the PC end of things, a special software driver will make it appear that the PC has several additional serial ports, corresponding to your multiple RS-232 devices. Crude, but effective if that's what you are after. I'm not sure that this is the direction you'd want to go though since you mentioned Excel. Hyperterminal does not directly send data into Excel, so you've got to write some sort of interface program anyway. Here's a huge hint for you: OSwinsck. This is a DLL that is free that can interface directly to TCP/IP from VBA. VBA is the programming language that is built into Excel specifically for writing macros. This gives you the capability of directly talking to your Ethernetted serial devices from Excel. Microsoft sells a similar library (via a VB license) but in my experience, it has a LOT of limitations and issues. OSwinsck is a much better implementation of the same thing. This is assuming you stick with a Microsoft world. If you are feeling more adventurous, then I recommend one of two languages. First up, Python. It's one of the easiest languages to learn and very powerful. Stay away from the 3.0 stuff...it's really not ready for prime time yet. Python has dozens of modules that can interface back to Microsoft programs, handle serial or Ethernet networking in a variety of ways, interface to databases and web servers, you name it. Very, very flexible. It's essentially a very fast scripting language at it's core so you can develop/test things as easily as online programming on a PLC. Otherwise if you want something more rigid and structured, then by all means, go with Java. Java has a steeper learning curve than Python but once you get over it, and the parts where the language police got hold of it, it really is a wonderful system. Just like Python, there is an unbelievable amount of support for it out there. If I'm doing web or database-based programming, or I need to develop something with a user interface these days, I reach for Java. Only time I use Microsoft-based languages anymore is when I'm working strictly in a Microsoft-Office based environment. There are two IDE's for Java that are very popular, Eclipse and Netbeans. Eclipse has a lot of nifty tricks and myriads of plugins and add-ons but that's also the maddening part about it. Netbeans comes with most of the add-ons "out of the box" and feels more polished than Eclipse. I recommend Netbeans if you are just starting out. Another approach in terms of hardware is RS-485. You can get level converters (see www.bb-elec.com) which convert an RS-232 to an RS-485 port. You can easily wire RS-485 in a "party line" system...if any one device transmits, all others receive. If two devices transmit at the same time, the result is garbled. RS-485 forms the basis for several PLC I/O systems. Modbus/RTU is probably the most well known. However, there is a problem. Somehow, you've got to multiplex those comms and then demultiplex them, and then peel them back apart. It's not necessarily intuitive how to do that. So unless you have a protocol or some way to designate who is talking, this one can get ugly really quickly. Another approach that can potentially be even better is to write your own multiple-serial port data collection system and try to coax the data into something useful external to the PC. Again, Digi would be a good answer for that but there are several others to consider, too. You'd be looking for an "embedded system" in this case. There are hundreds of vendors, and this is one area where you'd better be a crack programmer because you've got to have a pretty good handle on writing hardware/software systems. For instance, consider www.micromint.com (an old name in the business for probably close to 30 years), or www.rabbit.com, or even www.gumstix.com. Another approach would be to forget all that stuff and buy an industrial PC with a lot of serial ports. The UNO PC (www.advantech.com, also sold through www.bb-elec.com) is good for that sort of thing. It will set you back about $1K (compared to hundreds of dollars at most for embedded equipment) but you have a full blown PC that doesn't require as much in the way of soldering-iron type work to deal with. Another approach would be to install a PLC that is capable of supporting several ASCII I/O boards. An example here would be the ASCII I/O DeviceNet cards from Allen Bradley. Then the PC would be dealing with the PLC, and the data collection/aggregation/multiplexing function would occur in the PLC. The code would be very ugly and this is one time where I'd probably break out the structured text to do it sanely. I'd only recommend this approach if you feel more comfortable with PLC's than ANY PC programming at all, because so far from your description (trying to somehow do things with Hyperterminal and Excel), I think you are going down a road of frustration.

Share this post


Link to post
Share on other sites
Or you could get a rocketport card for the computer. It goes to a breakout panel that has 10 additional com ports on it. We use these frequently with Accusort systems here. Probably the easiest way to add com ports, just pop in the card and install the drivers.

Share this post


Link to post
Share on other sites
Great information everyone. Thank you all for your help. I really appreciate it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0