Jump to content

how to access com port from two different applications?


Recommended Posts

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

P.S. i've posted a copy of this topic on NI.com

Link to comment

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:-)

QUOTE(Khodarev @ Feb 6 2008, 08:55 PM)

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

P.S. i've posted a copy of this topic on NI.com

Link to comment

QUOTE(Khodarev @ Feb 6 2008, 02:55 PM)

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

P.S. i've posted a copy of this topic on NI.com

THe last time I had to crack that nut I cheated and used two comm ports. The "other software" just used the port it wanted to use. I then ran the Xmit for that port to the receive line of the port my LV app was using. My code just echoed the messages it received from the othr software and vise versa for the recieve side.

$50 for a USB serial that my app used and some appropraitely wired cables and I was off and running.

Ben

Link to comment

QUOTE(neB @ Feb 8 2008, 12:40 AM)

THe last time I had to crack that nut I cheated and used two comm ports. The "other software" just used the port it wanted to use. I then ran the Xmit for that port to the receive line of the port my LV app was using. My code just echoed the messages it received from the othr software and vise versa for the recieve side.

$50 for a USB serial that my app used and some appropraitely wired cables and I was off and running.

Ben

I wonder what is Xmit and how to use it?

Anyway for now i've settled down with software splitter (Serial Splitter from Eltima). It seems to do the trick. The only problem is that i have to reconfigure that "other" application so it will use virtual port that Serial Splitter creates. It's not such a big deal but still it is not flawless victory:)

Link to comment
  • 2 weeks later...

QUOTE(Khodarev @ Feb 7 2008, 07:35 PM)

I wonder what is Xmit and how to use it?

Anyway for now i've settled down with software splitter (Serial Splitter from Eltima). It seems to do the trick. The only problem is that i have to reconfigure that "other" application so it will use virtual port that Serial Splitter creates. It's not such a big deal but still it is not flawless victory:)

Xmit is sometimes the name of the transmit line on the serial port.

Rolf Kalbermatter

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.