views:

50

answers:

1

I am looking for something to test my app. The app is a weight logger, built in .net 3.5 - it is connected by rs232 to an electronic weight, but the problem is that I don't have it at home.

I wanted to emulate the traffic and data with my app, but I have a problem: I can't get 2 apps on 1 port.

Please help.

A: 

These are the tools you need:

  • com0com: Creates two virtual COM Ports which are connected to each other
    • Just connect your receiver application with the first one and your mock weight application with the second one.
  • Serial Port Monitor: If you need to sniff into some serial port connection to find out how another application communicates with some serial device.

Update

The storing and filtering is just to specific to your concrete project, so that you wouldn't find anything "out of the box". But you have two possibilities to store the data.

  1. Within your application implement some kind of wrapper class for your serial port. Every read and write access to the serial connection goes through this class. Then this class sees everything and can dump the whole traffic into a file or somewhere else. Additionally you could also implement some kind of filter mechanism.
  2. Instead of putting the dump and filter logic into your program, write it as an application. This application connects to two COM ports. The first is the real serial port. The other is a virtual from the com0com driver. Your application that normally communicates with your serial device will now be connected to the second com0com driver. So you're able to dump and filter anything that flows through your serial port.
Oliver
Great :) but i have Another Problem :)I need to store the data that are send via rs232. I don't know how to store them in a database(SQL would be prefect). Tried google for 2h but didn't find any anweser. How to filter the data that i need ? Do i need to use regexp ? Please help me. Would be great if some code source will be added with the soultuion :)
siranen