Looking for the opposite direction? To bring a network (Ethernet or TCP/IP) device into software that expects a local COM port, see Convert TCP/IP to RS232 with TCP-Com.
How the two sides fit together
TCP-Com runs on both PCs in opposite roles. On the PC with the instrument, TCP-Com acts as a TCP server: it opens the real COM port and makes the data available at a network address. On the other PC, TCP-Com acts as a TCP client: it connects to that address and creates a virtual COM port that behaves like real hardware. Data flows in both directions, so software that sends commands to the instrument also works.Step 1: Set up the PC with the instrument
- Install and open TCP-Com on the PC where the instrument is connected.
- In the converter window, select the real COM port of the instrument. Leave the “Create virtual COM port” box unchecked. If you are not sure which port the instrument uses, see Identify your device’s COM port.
- Set the serial settings (baud rate, parity, data bits, stop bits) to match the instrument.
- Configure the connection as a TCP/IP server, and enter a TCP port number that is not in use, for example 8000.
- Click Activate. TCP-Com now waits in Listen Mode for a connection from the other PC.
ipconfig in a Command Prompt window.
Step 2: Set up the PC with the software
- Install and open TCP-Com on the PC where your software runs.
- In the converter window, check Create virtual COM port and choose a COM port number that does not already exist on this PC, for example COM10. A number that matches a real port disables that real port.
- Configure the connection as a TCP/IP client. Enter the IP address of the first PC and the same TCP port number (8000 in this example). If your network assigns IP addresses dynamically, you can enter the first PC’s computer name instead, and TCP-Com resolves it for you.
- Click Activate. TCP-Com creates the virtual COM port and connects to the first PC. If the server is not available yet, TCP-Com retries until it connects.
Step 3: Point your software at the virtual COM port
In your application on the second PC, select the virtual COM port (COM10 in this example) as the device connection. Use the same serial settings as the instrument. The application now receives the instrument’s data through the network, and commands it sends travel back to the instrument.If the connection does not work
- If the client cannot connect, make sure that the Windows firewall on the server PC allows the TCP port you chose. Add an inbound rule for that port, or for TCP-Com.
- Make sure that both PCs are on the same network, or that your network routes between them.
- If data is garbled, make sure that the serial settings match the instrument on both sides.
- If the virtual COM port does not appear, restart TCP-Com and choose a different unused port number.