LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

can i do shared io on serial port

Is there any way to have two different processes use the same serial port when using the NI serial library?  Can a serial port ever be opened on a non-exclusive basis?

I am using a mutex to serialize the i/o, so there's no problem there, really, but I can't get a second OpenComConfig to work if the port's already been opened by another process.

I suppose I could create a process who's only job was to do serial i/o and owned access to it, and that could accept rpc calls from other processes to do i/o to the port, but what a PITA to write all of that.
Do the Win32 serial port calls allow shared access to the port?  I seem to recall that they do, maybe I'm wrong.

I may be on the wrong forum with this I suppose.

Menchar

0 Kudos
Message 1 of 2
(2,903 Views)
The Win32 API only allows a process exclusive access to a COM port, so you can't easily share it. Writing a marshalling process such as you describe (or buying one of the commercially-available port-splitting drivers, if appropriate) appears to be the only way.
--
Martin
Certified CVI Developer
0 Kudos
Message 2 of 2
(2,895 Views)