Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

how to access com port from two different applications?

Hello hardwireworkers,

here is my situation,
i have an application which controls a specific device using COM port. I want to write Labview application which would be able to send commands to the same device using same COM port. The problem for now is that either my (Labview) application works or that other application works. They can not access the same COM port resource simultaneously. So the question is how to do the trick.

I've used serial port monitoring program and it works just fine. I can also use that program to send commands to the device while main control application is running.

I remember that back in old versions of Labview there have been low level commands for the serial port. I believe they may work. Unfortunately i don't have LV 4 or 5, so i can not look inside these functions. I wonder if anyone has it?

Another solution to this problem would be wire splitter. But i'm trying to find software way for now.

Any ideas would be highly appreciated.

Thank you in advance.

www.xinstruments.com - Custom Software for Industrial Automation

www.hdrconverter.com - Picture processing made easy

0 Kudos
Message 1 of 5
(26,364 Views)
I've solved this kind of problem by creating a server application that administrates the access to the port and devices on the port. This "Port Share"-application allows multiple applications to share the same ports (the middleware is the only application that actually use the ports), and it has commands that enables the apps to reserve a port and/or a spesific device (on a multidrop link) if they are in an operation that requires exclusive access for a while (ports are reserved during heavy data transfers, devices are reserved when they are used for tasks that cannot be interrupted by commands from others). In my apps the serial communication is handles by a comhandler-plugin with a que-based interface so all I had to do to switch to the port share system was to replace that comhanler.vi with one that acts as a port-share client instead...(off course to fully use the port/device reserve functions you typically need to implement that at a higher level though).

I've thought about releasing this software to the public, however there are some rights-issues to solve for that to happen....The idea is free though:-)
0 Kudos
Message 2 of 5
(26,346 Views)

I would be interested in more information on sharing ports.  I have 1 program as the working program and another as a diagnoses testing program that needs information and sending commands from the same com port.

 

Thank You

0 Kudos
Message 3 of 5
(25,732 Views)

I think this is all you need:

http://com0com.sourceforge.net/

 

You can find similar programs for sifferent platforms too here: http://en.wikipedia.org/wiki/COM_port_redirector

0 Kudos
Message 4 of 5
(25,637 Views)

Such apps as Serial Splitter https://www.eltima.com/products/serialsplitter/ create virtual copies of the real serial port (you can say it "splits" the port, hehe), which then can be later open with different software. Each app sends data to its virtual port, then it is redirected to the real one and vice versa

0 Kudos
Message 5 of 5
(20,175 Views)