Mach3 E500 VFD modbus support instructions

Connecting a spindle VFD to Mach3 through the Modbus (RS-485 serial port) is not an easy task, since the required information is spread all around the internet. This post is a step by step set of instructions that hopefully will help someone else get their VFD up and running quickly.

For reference I am using Windows 10, Mach3 R3.043.066, and FDTI serial driver V2.12.16

The E500 VFD is popular on many internet sites, that is why I decided to write the necessary code to do a port including the following commands and status:

  1. CW spindle
  2. CCW spindle
  3. Stop spindle
  4. Set spindle speed
  5. Receive spindle RPM and display it in True RPM DRO
  6. Stop spindle command support

Step 1

Modify the VFD settings changes for RS-485 port control

This step will change the parameters necessary to enable the modbus communications port on the VFD so commands and status can be sent and received between the computer and the VFD. Refer to the Panel operating method section of the VFD manual for the instructions on how to use the front panel controls on the VFD to modify these parameters. They will saved across power on/off cycles, so this only needs to be done once. Please note once these settings are changed, you will no longer be able to control the motor from the VFD front panel.

The E500 required three function values to be modified from the default values.

  1. F0.00 =2 (default is 3) Frequency input channel
  2. F0.02=1002 (default is 1000) Running command channel and mode
  3. F2.19=1 (default is 2) Pairs of motor poles

The VFD is now set to receive commands and send status to/from the serial Modbus (RS-485 port on the side of the VFD) at 9600 baud, even parity.


Step 2

Mach 3 requires several settings be changed to allow commands to be sent and status to be received on the RS-485 ModBus port. Please note the computers do not implement RS-485 directly. You must purchase a USB to RS485 converter. All RS-485 data will be sent out the selected USB port on the computer through the converter, across the RS-485 cable to the VFD. The RS-485 protocol implements a differential electrical connection which provides a great deal of common mode noise immunity which is useful in the CNC environment.

First, it is necessary to install the USB to RS-485 windows driver needed for the convertor. Follow the instructions supplied with your convertor to install the driver. Once the driver is installed, note the comm port it is associated with (Com3 in this case).

The following pictures show the necessary changes to Mach 3 to enable the serial communications port. Once these changes are made they will be permanently stored in the Mach 3 settings.

Locate the engine configuration… Ports and pins menu and check the 2 check boxes shown below in the Restart if changed section.

Locate the Modbus serial control monitor and follow the example below. Change the serial port number depending on the Comm port that windows assigns to the serial converter (Com3 in this example).

Locate the Modbus configuration menu and fill it in exactly as shown below. This is used to map the addresses in the VFD to the Brain logic which will be implemented in the next step.

After all these settings are made, Mach 3 is configured to send commands and receive status from the VFD.


Step 3

Mach 3 uses, what they refer to as a brain, to implement software ladder logic. It is used to convert the higher level commands (set speed for example) to the lower level commands (and status) necessary for the E500 VFD to operate with Mach 3. The Brain file is available at the following location: request through e-mail to me at

The brain file must be downloaded then transferred to the Mach3/Brains folder.

Once it is loaded it must be selected to be used by Mach 3. go the the Brains pull down menu and select the E500 VFD Control.brn file.


Step 4

Initialization files must be added and modified to complete the installation of the VFD control.

First it is necessary to create a macro to allow the RPM of the VFD to be displayed. Using notepad, create a file called M1000.m1s with the contents exactly as shown below. .

This macro must then be installed in the Mach3/macros/Mill folder.

The last step is to call the newly created init macro and set other init. parameters as necessary. Please refer to the following screen to make the necessary changes.

Some of the check boxes on your screen might differ from this example, but the Initialization string box must be filled out as shown.



This completes the installation of the necessary files to allow you to control your E500 VFD spindle controller through the normal Mach3 control panel interface and from G code.



3 thoughts on “Mach3 E500 VFD modbus support instructions”

  1. Hi Bill,

    Also using Mach3 on Windows 10 64. I am having no luck getting my serial port to work. Using Test Modbus in the Setup Serial Modbus Control I only get timeouts. However, I know the com port works when using Simply Modbus program to communicate with my VFD.
    Would you mind sharing what Windows 10 version you are running and whether you are using “special” windows compatibility settings?

    1. Hi Marcus

      I was using windows 7 at the time with no special settings.
      Do you have the correct FDTI driver as called out for the RS485 converter, you most likely do since the other program works, but double check.
      If you can send RS485 through the converter with simply modbus, which com port are you selecting?
      Are you setting the same com port in Mach in both pages of the test menu?
      I don’t show that in the paper, but try it just in case.
      Are both checkboxes checked on the pins and ports page as shown?
      Are you setting the hex / decimal check box on the test menu?

      As I recall when you set the com port and baud rate and press the open button the status box should be clear (no error), is that where the error shows up or is it showing up when you attempt to send the command to the VFD?
      Do you see and data on the output if you attempt to send a VFD command?

      Are you in the US time zone , I could help talk you through it if you want to try.

      Sorry for all the questions, but I need to understand exactly what is happening in order to be of help to you.


Leave a Reply

Your email address will not be published. Required fields are marked *