Intercepting data from a serial device

T

Thread Starter

Tom Reaney

I interface to a wind instrument that measures wind speed and direction. It outputs a reading every second on a RS-232 port. The wind instrument connects to a PC where proprietary software displays this info graphically.

Log files are created on the PC. So far so good. What I now need to do is to access the real time data so I can display it in my HMI. How do you suggest I go about this? Can the contents of the COM port used somehow be echoed? All suggestions welcomed.
 
Is there a reason you need to use the proprietary software? Displaying your own wind speed, direction, and logging to a file should be very easy if the incoming data format is known or can be reverse engineered. This would be my first choice.

Second choice, and to answer your question more directly is that you can have two serial "listeners". The easiest way I know of is to use a serial splitter so that the reported value gets written to two different COM ports. This could be a "Y" cable on the serial line that sends data from your remote device to the computer. Then in your custom written software you just open your mirrored COM port and read the data stream and do with it as you wish.

I'd try to cut out the middle man and write your application to handle everything if you can and ditch the proprietary software.

KEJR
 
R
Your RS-232 link can have several receivers but only one transmitter. If you are just monitoring the signal simply wire in parallel.

Roy
 
C

curt wuollet

If I understand correctly, you would like to "tee" into the data, leaving the existing stuff working. This can be done with a setup much like a datascope. If you are interested in only one direction, you can simply make a Y cable and read the same data sent to the proprietary program with another PC. You could try this with Terminal or Minicom. You would have to figure out their protocol, then write a program to receive and interpret the data and send it wherever you want it to go.

Regards
cww
 
F

Fred Loveless

I have used our UCON driver in unsolicted mode to see what was coming across a wire in our channel diagnostics tool. If it is straight ASCII it is fairly easy to then decode the packet and create a profile to capture the data and pass it on to an HMI.

Fred Loveless
Kepware Technologies
 
J
A trick to hack the COM port to read the incoming data from an "in-use" opened port involve working at kernel level programming.

Another software way to intercept the data is to use serial ports redirector. With this you can create a virtual COM port that can be managed to be read by many applications (including your HMI) and mapped to the real COM port to your instrument.

The hard way is to connect a Tee which connect the Tx pin of your instrument to the Rx pin of another COM port.

 
Top