Siemens PLC Modbus Setup

PLC Part Numbers

MachMotion primarily uses these three Siemens PLC cards:

CPU: 6ES7214-1BG40-0XB0

https://mall.industry.siemens.com/mall/en/us/Catalog/Product/6ES72141BG400XB0

IO Module: 6ES7223-1PL32-0XB0

https://mall.industry.siemens.com/mall/en/us/Catalog/Product/6ES72231PL320XB0

Analog Module: 6ES7234-4HE32-0XB0

https://mall.industry.siemens.com/mall/en/WW/Catalog/Product/6ES7234-4HE32-0XB0

 

If you view the full MachMotion Control part number on a BOM or Sales order, the last two digits are the PLC version. If the last two digits end in 00 then there isn't a standard siemens PLC on this system. 

Below are the standard configurations a CNC will have:

PLC Part Number

 Description

 Part Number(s)

 01

 14/10 I/O + 2 Anlg In. Tool Changers

6ES7214-1BG40-0XB0

 02

 30/26 I/O + 2 Anlg In. Tool Changers

6ES7214-1BG40-0XB0

6ES7223-1PL32-0XB0

 03

 46/42 I/O + 2 Anlg In. Tool Changers

6ES7214-1BG40-0XB0

2 of 6ES7223-1PL32-0XB0

 04

 62/58 I/O + 2 Anlg In. Tool Changers

6ES7214-1BG40-0XB0

3 of 6ES7223-1PL32-0XB0

 05

 14/10 I/O + 2 Anlg In. (IO Expansion)

6ES7214-1BG40-0XB0

 06

 30/26 I/O + 2 Anlg In. (IO Expansion)

6ES7214-1BG40-0XB0

6ES7223-1PL32-0XB0

 07

 46/42 I/O + 2 Anlg In. (IO Expansion)

6ES7214-1BG40-0XB0 

2 of 6ES7223-1PL32-0XB0

 08

 62/58 I/O + 2 Anlg In. (IO Expansion)

6ES7214-1BG40-0XB0

3 of 6ES7223-1PL32-0XB0

 09

 14/10 I/O + 6/2 Analog I/O Tool Changers

6ES7214-1BG40-0XB0

6ES7234-4HE32-0XB0

 0A

 30/26 I/O + 6/2 Analog I/O Tool Changers

 6ES7214-1BG40-0XB0 

6ES7223-1PL32-0XB0

6ES7234-4HE32-0XB0

 0B

 46/42 I/O + 6/2 Analog I/O Tool Changers

6ES7214-1BG40-0XB0

2 of 6ES7223-1PL32-0XB0

6ES7234-4HE32-0XB0

 0C

 62/58 I/O + 6/2 Analog I/O Tool Changers

6ES7214-1BG40-0XB0

3 of 6ES7223-1PL32-0XB0

6ES7234-4HE32-0XB0

 

Enable the PLC

Enable the Siemens PLC as shown below.

image-1597422373646.png

 

Outputs

For siemens 1200 Using write coil 0X5 or write coils 0X15 works

  • Reg 1 is Q0.0
  • Reg 9 is Q1.0
  • Reg 65 is Q8.0
  • Reg 73 is Q9.0
  • Reg 81 is Q10.0

 

Adding Outputs

To add a new output, click on the "modbus0" on the function tree and then click the Add Function button.

image-1597422500356.png

Enter in the data as shown here. Change the Function Name and Modbus register per the output you want to control shown in the table above. Then press Next. 

image-1597421857748.png

 

Then enter in the Name and Description where it says <edit>. This can be anything, but I recommend using the PLC output name (Q0.5 for example) so we can track it in the future. 

image-1597421878651.png

 

For example, this configuration writes to the PLC output module Q8.0. 

image-1594218463197.png

 

To confirm that the PLC program isn't writing to the same output, you can open MachMotion Diagnostics. Select the new output you just mapped. Then select the corresponding output in the MachMotionModbusDevice. Q0.2 = Output2. Q1.0 = Output8. Remember the PLC is octal based (8 based numbering) and the MachMotionModbusDevice is decimal (10 base numbering). 

When you double click on the State for Q0.2, you should see Output2 turn on and stay on. Note: Q0.2 cannot be mapped in Mach4 to a signal for this test. If it is, use Input Signals -> Output number to test turning on the output. You cannot have the MachMotionDiagnostics window and Mach4 signals trying to write to the same output either. Only one device can ever control an output at the same time. 

image-1597422192058.png

 

Removing Outputs

To control an output from the PLC directly, the output cannot be mapped in the CNC control. Follow this procedure to unmap an output. 

In the main software select Configure->Plugins->Modbus. 

image-1600706700689.png



Select the output you no longer want controlled from the CNC. 
image-1597421878651.png

Then select "Remove a Modbus Function". The output should disappear immediately. 

image-1600706765475.png

When you restart the software you should be able to control the output directly from the PLC. 

For example, select Q0.3 and then click "Remove a Modbus Function". Q0.3 should disappear. 

 

Inputs

Device: MachMotionModbusDevice
Input Name:

  • Input 0-7 i0.0 - i0.7
  • Input 8-15 i1.0 - i1.7
  • Input 16-23 i8.0-i8.7
  • Input 24-31 i9.0-9.7

For example, Input 10 is I1.2:

image-1594218635943.png

 

 

 

Registers

PLCData[1] Spindle Load

PLCData[2] Gear range

 

ContData[3] Sub spindle analog for lester grinder

ContData[1] Analog Pressure for water jet

ContData[0] Selected Pocket

ContBitData[2] Reset Current Pocket

 

ContData[1] wheelhead analog (0-1000) Kaydon

ContData[2] dresser analog (0-1000) Kaydon

PLCData[2] wheelhead analog Kaydon