Sunday, August 27, 2017

Connecting a CNC to a PC wireless over WiFi

This guide describes how to wireless connect a CNC machine to a PC using WiFi, thereby being able to send programs from the PC to the 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 WF5000B 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.

Many CNC machines (Fadal, Mazak, Okuma, Haas, Mori Seiki and more) have a serial RS232 port connector; this is usually a female 25-pin connector or a female 9-pin connector (some 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 WF5000B directly to your CNC with a null modem 9-pin serial cable (included with the WF5000B).
If your CNC has a 25-pin female connector then you will need a 25-pin male to 9-pin female adapter to be able to connect it to the WF5000B:

db25-db9-changer

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

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

serial-rs232-wifi-on-cnc

 

The Setup step by step

Start by connecting the WF5000B to your CNC’s serial port and also turn on the 5VDC power supply to the WF5000B (120VAC/5VDC power adapter is included with the WF5000B).

Once the WF5000B is connected to your CNC’s serial port you can check the CNC’s serial port settings on the user panel. Here is an example screenshot of the settings from a Haas CNC:

haas-cnc-settings

Write down the settings, you will need them later. In this example the settings are: 115200, none, 1, 8.

Now turn on the PC. 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 WF5000B through a wireless router. Please refer to the section called “How to connect the WF5000B using a wireless router”.

Now your PC needs to find the WF5000B on the wireless network and then you need to configure the WF5000B’s serial port parameters so they match the CNC’s port parameters. This is described below.


Connecting and accessing the parameters over WiFi

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

pc-wifi-manager

Once your computer is connected successfully to the WF5000B you can open a web browser and enter the WF5000B’s IP address which by default is 10.10.100.254.

login-window

A login window will open. Enter the user name and password.
User: admin
Password: admin

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

main-settings-window

In most cases you can keep all default settings except the serial port parameters.
Navigate to the “WiFi-Uart Setting” page and change the baud rate, data bits, parity and stop bits so they match your CNC’s port settings. Click the “Apply” button and reset the WF5000B on the “Device Management” page once you have changed the parameters:

serial-port-settings


How to create a virtual COM port

To create a virtual COM port in Windows which your CNC software can use to send programs through, you need to use a virtual COM port software. This software can be downloaded for free from www.usconverters.com. The software is called USR-VCOM.

Start the VCOM software and click the “Add COM” button:

virtual-com-port-window

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

virtual-com-port-window-2

The 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-com-por

Now you need to point your CNC 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 CNC software you use. Here is a screenshot 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.
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 below.


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 WF5000B must be connected to each CNC. Your PC’s WiFi will search and find each WF5000B. The virtual COM port software for the WF5000B will create a COM port for each WF5000B which your CNC software on the PC can use to send programs through.
Once each WF5000B 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 WF5000B using a wireless router

The setup looks like this:

cnc-over-wireless-wifi-router

First set the IP of your wireless connection to the same sub-net as the WF5000B, which is 10.10.100.xxx:

ip-settings

Connect to the WF5000B using an access point. In this example we use a wireless USB network adapter from TP-Link:

wifi-connected

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 “STA Interface Setting” page and click the “Search” button:

sta-settings

In this example the SSID is “Buffalo” and the encryption is AES with WPA2PSK authentication. Select the wireless router and click the “Apply” button:

device-search

Check that the wireless router settings are correct, enter the password and click the “Apply” button.

sta-settings-2

Do not go to the Device Management page and reset the unit yet.

reset

Go to the Mode Selection page, select STA mode and click the “Apply” button.

apply-button

Now go to the Device Management page and reset the unit.

reset-2

Click the “Restart” button for the changes to take effect.

device-management

rebooting

After the reboot is complete the “Ready” light will be steady on. 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:

wireless-router-status

Troubleshoot by making a loop-back test

To become familiar with the WF5000B or to troubleshoot if something is not working as expected, we recommend making a loop-back test. This will confirm if the WF5000B is working properly and the COM port has been successfully created in Windows.
Disconnect the WF5000B from the CNC’s serial port and carefully use a paper clip or similar to jump the RX (pin 2) and TX (pin 3) pins at the end of the included null modem cable and connect the cable to the WF5000B 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 2, and click the OK button:

loopback-test-1

The port will now open.

loopback-test-2

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 2, over WiFi to the WF5000B module, out on the TX pin, back into the RX pin, back over WiFi, back into virtual COM port 2 and should appear in AccessPorts upper (receive) window.

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

The WF5000B obviously should be connected over WiFi to your computer when performing this test.
Making this loopback test will confirm that the COM port has been successfully created and that the WF5000B 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 or otherwise occupied by the operating system you will get the following error message from AccessPort. Using a different port is the easiest solution.

error-message

Connecting a CNC to a Computer wireless over WiFi