Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I use two ports in the same time?

My application need one pc use two ports the same time.But when I open one port and my systerm is running the other port can't be opened.
I use the frame API in VC++6.0.
My OS is win2000 server;
The functions I used are ncOpenObject();
0 Kudos
Message 1 of 4
(4,027 Views)

Hi Whycan,

In General it should be possible to use both ports at the same time. See the attached example which uses both ports in a loopback test at the same time.

Did you get any error message you can provide?

DirkW

0 Kudos
Message 2 of 4
(4,012 Views)
Hi DickW
Thank you for your help!
I have tried the example.But the example shows how to connect one CAN network with two ports.
I want each port connect to the net can both read and write;
I want to apply the function like this:
1.config the port1 and port2
2,open port1 and port2
But after I open port1 or port2 the other port can't be opened;
After I open the second port it always returns negative.
In the codes I use CAN0 and CAN1 as the CAN objects.
0 Kudos
Message 3 of 4
(4,004 Views)

Hi WhyCAN,

In this case there is no big difference. You need to configure both ports only ones to read and write on the same port.

attached you can find an example showing how to do so in ANSI C. But it should be similar for C++.

DirkW

0 Kudos
Message 4 of 4
(3,995 Views)