m menu image  m home m cart

Your header in Here

banner

Connecting a CNC to a PC wireless over WiFi using Flow Control

Download PDF connecting cnc wireless serial port Download this article as PDF

This guide describes how to wireless connect a CNC machine (Haas, Fadal, Mazak, Okuma, Mori Seiki, Haas or other) with software (XON/XOFF) or hardware (CTS/RTS) flow control to a PC wireless using the USCHF2211 Serial to WiFi converter, thereby being able to send programs from a PC to a CNC machine.

Connecting-CNC-to-PC-wireless-over-WiFi

To be able to send programs to your CNC machine over WiFi you will need to connect a Serial to WiFi Converter such as the USCHF2211 from U.S. Converters LLC to your CNC machine. This will allow you to communicate with your CNC from a PC for up to 300 feet. As in any regular WiFi network you can use signal repeaters/boosters or Access Points to extend the range.
The reason we recommend the USCHF2211 is because it supports XON/XOFF software flow control which many CNC machines use for drip feeding programs from a PC and because it is an industrial grade and reliable product.
Most CNC machines (Fadal, Mazak, Okuma, Haas, Mori Seiki and others) have a serial RS232 port connector; this is usually a female 25-pin connector or a female 9-pin connector (a few CNC’s have male connectors instead of female connectors) as shown below:

serial-port-25-pin serial-port-9-pin

If your CNC machine has a 9-pin female serial connector then you can connect the USCHF2211 directly to your CNC with a null modem 9-pin serial cable (included with the USCHF2211) and a male/male gender changer:

db9 male male changer

If your CNC has a 25-pin female connector then you will need a 25-pin male to 9-pin female adapter and the male/male changer to be able to connect it to the USCHF2211:

db25-db9-changer db9 male male changer

If the 25-pin connector on your CNC is a male version then you will need a 25-pin female to 9-pin male adapter. 

Here is an example of how to connect and mount the Serial WiFi adapter to a CNC lathe:

serial-rs232-wifi-on-cnc

While you are at the CNC machine, check the CNC’s serial port settings on your CNC machines monitor. Here is an example of the settings from a Haas CNC:

haas-cnc-settings

And here is an example of Fanuc settings (these first needs to be decoded according to the user manual to make sense):
cnc monitor settings

You will need to know the following:

  • Baud rate
  • Parity
  • Flow control (hardware CTS/RTS, software XON/XOFF or None)
  • Stop bit
  • Data bits

Write down the settings, you will need them later.
Now turn on your PC. To communicate with the USCHF2211 we recommend that you use a PC which has its own WiFi card. If your PC does not have this then you can use a simple USB WiFi dongle to WiFi enable it:

usb-wifi-dongle

We highly recommend a good quality USB WiFi dongle such as Cisco, Linksys, Asus, Belkin or similar.
Alternatively it is possible to communicate with the USCHF2211 through a wireless router. Please refer to the section called “How to connect the USCHF2211 using a wireless router”.
Now your PC needs to find the USCHF2211 on the wireless network so you can configure the USCHF2211’s serial port parameters to match the CNC’s port parameters. This is described below.

Connecting and accessing the USCHF2211’s parameters over WiFi

First connect to the USCHF2211 over WiFi using your operating system’s default wireless network manager. In this example we use Windows 10’s wireless manager:

windows device manager

Once your computer is connected successfully to the USCHF2211 you can open a web browser and enter the USCHF2211’s IP address which by default is 10.10.100.254.
A login window will open.  Enter the user name and password.
User: admin
Password: admin

wifi login

The main menu will open from where you can access all the parameters:

uschf2211 status screen

In most cases you can keep all default settings except the serial port parameters.

Navigate to the “Serial Port Settings” page and change the baud rate, data bits, parity and stop bits so they match your CNC’s port settings.
Click the “Submit” button at the bottom of the once you have changed the parameters.

uschf2211 serial port settings

If your CNC and CNC software is using XON/XOFF flow control then you need to enable this in the USCHF2211 under ‘Serial Port Settings’ -> ‘Flow Control’ -> ‘software Flow Control’, otherwise you can leave this setting to ‘Flow Control’ which is default.
Click the “Submit” button at the bottom of the page once you have changed the parameters.

flow control setting

Now go to “Others” and check ‘SYS’, ‘UART’ and ‘SOCK’ and click the Restart button:

other settings

How to create a Virtual COM port with XON/XOFF

You now need to create a virtual COM port which the USCHF2211 can communicate through via your CNC software on your PC. If your CNC communicates using hardware flow control or no flow control you can skip to the next section called ‘How to create a virtual COM port with CTS/RTS’.
We recommend using the virtual COM port software called USC-VCOM (version 3.7.2.535 or higher) or ‘Fabulatech Serial Port Redirector’ as these are fully compatible with software flow control. USC-VCOM can be downloaded from www.usconverters.com for free. Fabulatech can be purchased directly from fabulatech.com.

In this example we use USC-VCOM. Download USC-VCOM from www.usconverters.com, unzip the downloaded file and run the file called ‘USC-VCOM_V3.7.2.525_Setup.exe’.
Click the ‘Add COM’ button and enter the USCHF2211’s IP address and port number:

vcom setting

Click the ‘OK’ button and the virtual COM port will be created:

virtual com port setting
Communicating using XON/XOFF flow control requires the following:

  • RTS must be enabled/high at the USCHF2211. This can be accomplished by putting a jumper wire from RTS (pin 7) to CTS (pin 8) in the DB9 cable connector connected to the USCHF2211:
  • pin configuration


    In some cases enabling 'RTS' can be achieved by software if your software is capable of this.
    Notice that some devices also require RTS high at the serial device side.

  • USC-VCOM virtual COM port software version 3.7.2.535 or higher or ‘Fabulatech Serial Port Redirector’.

  • XON/XOFF software flow control must be enabled in your CNC software and in the CNC’s parameters.

  • Notice that some devices require BOTH ends (the serial device and the USCHF2211 side) to send a XON command (11) before communication can start.

Now you need to point your DNC software on your computer to the created virtual COM port and select the correct serial port parameters. The port parameters window looks different depending on which DNC software you use. Here is an example of what it could look like (SurfCAM software):

SurfCAM-software-screenshot
You should now be ready to send programs wireless from your PC to your CNC machine over WiFi, using software flow control. 
If for any reason you are unable to communicate or send programs at this point, we recommend troubleshooting by making a loop-back test as described later in this guide.  


How to create a virtual COM port with CTS/RTS


If your CNC and CNC software on your PC is not using XON/XOFF software flow control but instead is using CTS/RTS hardware flow control or no flow control, then you can use the virtual COM port software called USC-VCOM which can be downloaded from www.usconverters.com for free. Alternatively you can use Fabulatech however this must be purchased directly from Fabulatech.  

In this example we use USC-VCOM. Download USC-VCOM from www.usconverters.com, unzip the downloaded file and run the file called ‘USC-VCOM_V3.7.2.525_Setup.exe’.
Click the ‘Add COM’ button:

vcom port program

Select which COM port number you want to create and set USCHF2211’s IP address and port number:

virtual com-software settings

Click the ‘OK’ button and the virtual COM port will now be created:

com port created

Check in Windows Device Manager to see if the COM port has been successfully created:

windows-device-manager

Now you need to point your DNC software on your computer to the created virtual COM port and select the correct serial port parameters. The port parameters window looks different depending on which DNC software you use. Here is an example of what it could look like (SurfCAM software):

SurfCAM-software-screenshot

You should now be ready to send programs wireless from your PC to your CNC machine over WiFi, using no flow control or RTS/CTS hardware flow control.
If for any reason you are unable to communicate or send programs at this point, we recommend troubleshooting by making a loop-back test as described later in this guide.   
Besides above, communicating using CTS/RTS flow control requires the following:

  • CTS/RTS hardware flow control must be enabled in your CNC software and in the CNC’s parameters.
  • Wire connections:
    The wires from the CNC to the USCHF2211 must be as following:

CNC                                                      USCHF2211
TX (pin 3)-----------------------------------RX (pin 2)
RX (pin 2)-----------------------------------TX (pin 3)
RTS (pin 7)---------------------------------CTS (pin 8)
CTS (pin 8)---------------------------------RTS (pin 7)
GND (pin 5)--------------------------------GND (pin 5)



Connecting multiple CNC’s to one PC

Connecting-Multiple-CNC-to-PC--wireless-over-WiFi

The setup procedure for connecting multiple CNC machines to one PC is the same as for connecting one CNC machine to a PC.
One USCHF2211 must be connected to each CNC. Your PC’s WiFi will search and find each USCHF2211. The virtual COM port software for the USCHF2211 will create a COM port for each USCHF2211 which your CNC software on the PC can use to send programs through.
Once each USCHF2211 is connected and setup the user would need to select the correct COM port in the CNC software on the PC to send a program to a specific CNC. Very easy and convenient.

How to connect the USCHF2211 using a wireless router

 

The setup looks like this:

setup wireless serial port

Connect to the USCHF2211 using Windows network manager. Your computer needs a WiFi network card or USB WiFi dongle in order to do this:

windows-wifi-manager

Open a web-browser and go to 10.10.100.254, and enter the credentials which is “admin” for both the user name and password:

wifi login

Go to the “System Settings” page and select STA under “WiFi Settings”:

uschf2211-wifi-settings

Click the Scan button and select your routers SSID:

wireless-scan

Enter the STA Key if required and click the Submit button:

enter-sta-key

Under Others: check ‘SYS’, ‘UART’ and ‘SOCK’ and click the Restart button:

reseet device

After the reboot and if you have entered the correct network settings and password then the converter will now automatically join the network, and the “Link” light will be on. 

To check/verify if the adapter has joined the network successfully you may be able to login to your wireless routers admin status page and see the converter:

check ip address

Alternatively you can use an IP scanner such as Advanced IP Scanner: https://www.advanced-ip-scanner.com/

 

Create a virtual COM port.

Open the USC-VCOM virtual COM port software and click the ‘Add COM’ button:

vcom port program

Enter the IP address which your router has assigned to the converter:

virtual com-software settings

Click OK.

The virtual COM port should now be created:

virtual com created

You should now be able to see the virtual COM port in Windows Device Manager:

windows-device-manager

Verify communication by making a loop-back test.
Loop the TX and RX pins on the DB9 interface of the USCHF2211 and open Access Port. Enter the following settings and click the OK button:

accessport test

Enter a text string in the lower windows and click the “AutoSend” button. The data from the lower window should now be sent to the USCHF2211 and back again and appear in the upper window:

loopback test

Troubleshoot by making a loop-back test

To become familiar with the USCHF2211 or to troubleshoot if something is not working as expected, we recommend making a loop-back test. This will confirm if the USCHF2211 is working properly and the COM port has been successfully created in Windows.  
Disconnect the USCHF2211 from the CNC’s serial port and carefully use a paper clip or similar to short the RX (pin 2) and TX (pin 3) pins at the end of the included null modem cable and connect the cable to the USCHF2211 module’s DB9 connector.
Open AccessPort (can be downloaded for free from http://www.usconverters.com).

Configure AccessPort’s parameters to match the virtually created COM port (the COM port created by the VCOM software), in this example COM 3, and click the OK button:

accessport test

The port will now open.

com port loopback

In the VCOM software the ‘COM State’ column should now show ‘Open’:

virtual com created

Enter a text string in the lower (send) window in AccessPort and click the AutoSend button. The characters should now be sent via virtual COM 3, over WiFi to the USCHF2211 module, out on the TX pin, back into the RX pin, back over WiFi, back into virtual COM port 3 and should appear in AccessPorts upper (receive) window:

serial port loopback test

If you remove the jumper at the end of the serial cable connected to the USCHF2211 the data flow should stop.

The USCHF2211 module obviously must be joining a network when performing this test.
Making this loopback test will confirm that the COM port has been successfully created and that the USCHF2211 can send and receive data, ensuring that the module has been setup correctly.

If you try to open the port but it is already in use, not existing or otherwise occupied by the operating system you will get the following error message from AccessPort. Using a different port is the easiest solution. 

serial port error