Skip to content

7.Appendix

7.1 Appendix1 - Use Modbus-RTU communication Protocol to Control Linear Motor

7.1.1 Modbus RTU Communication Format

The Linear Motor defaults to the standard Modbus RTU protocol at a default baudrate is 2Mbps and the slave ID is 0x01. The currently supported function codes are: 0x03 / 0x06/ 0x10.

Commonly used address for Linear Motor are: 0x0100, 0x0700, 0x0303, 0x0A0A, 0x0404, 0x004F.

If need to store EEPROM, perform an '|' operation with the communication address and 0x1000.

For example, write servo operation mode to EEPROM, the communication address(0x0A0B) should be changed to 0x1A0B.

Note: Linear Motor needs to be initialized after each powered on.

7.1.2 Read Linear Motor Register

Read Register
Request
Modbus RTU DataSlave ID (Linear Motor)1 Byte0x01
Function Code1 Byte0x03
Register Starting Address2 BytesAddress
Quantity of Register2 BytesN*
Modbus CRC162 BytesCRC*
Response
Modbus RTU DataSlave ID1 Byte0x01
Function Code1 Byte0x03
Byte Count1 ByteN*x2
Registers ValueN*x2 BytesValue
Modbus CRC162 BytesCRC*

N* = Quantity of Registers

Address = Register Starting Address

CRC* = Cyclic Redundancy Check

Resgister Starting AddressRegisters Value
Get Linear Motor status Register0x00002 BytesEnd status: 0x0000 Motion status: 0x0001 Stop status: 0x0002
Get Linear Motor position Register0x07024bytes0xFFFFFFFB-0x00000320
Get Linear Motor Error Register0x000F2 BytesAn error occurs: all other return values indicate an error(except 0)No error occurred: 0x0000

7.1.3 Write Linear Motor Register

Write Register
Request
Modbus RTU DataSlave ID (Linear Motor)1 Byte0x01
Function Code1 Byte0x10
Register Starting Address2 BytesAddress
Quantity of Register2 BytesN*
Byte Count1 ByteN*x2
Registers ValueN*x2 BytesValue
Modbus CRC162 BytesCRC*
Response
Modbus RTU DataSlave ID1 Byte0x01
Function Code1 Byte0x10
Register Starting Address2 BytesAddress
Quantity of Registers2 BytesN*
Modbus CRC162 BytesCRC*

N* = Quantity of Registers

Address = Register Starting Address

CRC* = Cyclic Redundancy Check

7.1.4 Modbus RTU Example

  1. Enable Linear Motor
enable Linear Motor
Request
Modbus RTU DataSlave ID (Linear Motor)1 Byte0x01
Function Code1 Byte0x10
Register Starting Address2 Bytes0x01,0x00
Quantity of Registers2 Bytes0x00,0x01
Byte Count1 Byte0x02
Registers Value2 Bytes0x00,0x01
Modbus CRC162 Bytes0x1D,0x00
Response
Modbus RTU DataSlave ID1 Byte0x01
Function Code1 Byte0x10
Register Starting Address2 Bytes0x01,0x00
Quantity of Registers2 Bytes0x00,0x01
Modbus CRC162 Bytes0x00,0xAC
  1. Set Linear Motor position
Set Linear Motor position
Request
Modbus RTU DataSlave ID (Linear Motor)1 Byte0x01
Function Code1 Byte0x10
Register Starting Address2 Bytes0x07,0x00
Quantity of Registers2 Bytes0x00,0x02
Byte Count1 Byte0x04
Registers Value4Bytes0x00,0x1E,0x84,0x80
Modbus CRC162 Bytes0x7B,0x62
Response
Modbus RTU DataSlave ID1 Byte0x01
Function Code1 Byte0x10
Register Starting Address2 Bytes0x07,0x00
Quantity of Registers2 Bytes0x00,0x02
Modbus CRC162 Bytes0x40,0x25
  1. Set Linear Motor Speed
Set Linear Motor Speed
Request
Modbus RTU DataSlave ID (Linear Motor)1 Byte0x01
Function Code1 Byte0x10
Register Starting Address2 Bytes0x03,0x03
Quantity of Registers2 Bytes0x00,0x01
Byte Count1 Byte0x02
Registers Value(1500r/min)2 Bytes0x17,0x70
Modbus CRC162 Bytes0xFD,0xFA
Response
Modbus RTU DataSlave ID1 Byte0x01
Function Code1 Byte0x10
Register Starting Address2 Bytes0x03,0x03
Quantity of Registers2 Bytes0x00,0x01
Modbus CRC162 Bytes0xF1,0x14
  1. Set Linear Motor to Zero position
Set Linear Motor tozero position
Request
Modbus RTU DataSlave ID (Linear Motor)1 Byte0x01
Function Code1 Byte0x06
Register Starting Address2 Bytes0x0A,0x0A
Quantity of Registers2 Bytes0x00,0x01
Modbus CRC162 Bytes0xFD,0xFA
Response
Modbus RTU DataSlave ID1 Byte0x01
Function Code1 Byte0x10
Register Starting Address2 Bytes0x0A,0x0A
Quantity of Registers2 Bytes0x00,0x01
Modbus CRC162 Bytes0xFD,0xFA
  1. Set Linear Motor speed to Zero position
Set Linear Motor speed to zero position
Request
Modbus RTU DataSlave ID (Linear Motor)1 Byte0x01
Function Code1 Byte0x10
Register Starting Address2 Bytes0x04,0x04
Quantity of Registers2 Bytes0x00,0x01
Byte Count1 Byte0x02
Registers Value(6000r/min)2 Bytes0x0B,0xB8
Modbus CRC162 Bytes0xFD,0xFA
Response
Modbus RTU DataSlave ID1 Byte0x01
Function Code1 Byte0x10
Register Starting Address2 Bytes0x04,0x04
Quantity of Registers2 Bytes0x00,0x01
Modbus CRC162 Bytes0xF1,0x14
  1. Get if Linear Motor is back to zero
Get if Linear Motor is back to zero
Request
Modbus RTU DataSlave ID (Linear Motor)1 Byte0x01
Function Code1 Byte0x03
Register Starting Address2 Bytes0x0A,0x25
Quantity of Registers2 Bytes0x00,0x01
Modbus CRC162 Bytes0xB5,0xDD
Response
Modbus RTU DataSlave ID1 Byte0x01
Function Code1 Byte0x03
Byte Count1 Byte0x02
Registers Value2 Bytes0x00,0x01
Modbus CRC162 Bytes0x79,0x84
  1. Monitor the distance between the photoelectric sensor and the fisrt Z phase
Monitor the distance
Request
Modbus RTU DataSlave ID (Linear Motor)1 Byte0x01
Function Code1 Byte0x03
Register Starting Address2 Bytes0x0A,0x28
Quantity of Registers2 Bytes0x00,0x01
Modbus CRC162 Bytes0xE4,0x1D
Response
Modbus RTU DataSlave ID1 Byte0x01
Function Code1 Byte0x03
Byte Count1 Byte0x02
Registers Value2 Bytes0x06,0xF2
Modbus CRC162 Bytes0x3A,0x61

8. Locating end range

Locating end range
Request
Modbus RTU DataSlave ID (Linear Motor)1 Byte0x01
Function Code1 Byte0x10
Register Starting Address2 Bytes0x0A,0x0B
Quantity of Registers2 Bytes0x00,0x01
Byte Count1 Byte0x02
Registers Value(1000)2 Bytes0x03,0xE8
Modbus CRC162 Bytes0x0C,0xC0
Response
Modbus RTU DataSlave ID1 Byte0x01
Function Code1 Byte0x10
Register Starting Address2 Bytes0x0A,0x0B
Quantity of Registers2 Bytes0x00,0x01
Modbus CRC162 Bytes0x73,0xD3

9. Soft emergency stop

trigger soft emergency stop
Request
Modbus RTU DataSlave ID (Linear Motor)1 Byte0x01
Function Code1 Byte0x10
Register Starting Address2 Bytes0x0A,0x0B
Quantity of Registers2 Bytes0x00,0x01
Byte Count1 Byte0x02
Registers Value(1000)2 Bytes0x00,0x01
Modbus CRC162 Bytes0xCC,0xBE
Response
Modbus RTU DataSlave ID1 Byte0x01
Function Code1 Byte0x10
Register Starting Address2 Bytes0x0A,0x0E
Quantity of Registers2 Bytes0x00,0x01
Modbus CRC162 Bytes0x63,0xD2

10. get Linear Motor SN

get Linear Motor SN
Request
Modbus RTU DataSlave ID (Linear Motor)1 Byte0x01
Function Code1 Byte0x03
Register Starting Address2 Bytes0x0B,0x10
Quantity of Registers2 Bytes0x00,0x02
Modbus CRC162 Bytes0xB5,0xDD
Response
Modbus RTU DataSlave ID1 Byte0x01
Function Code1 Byte0x03
Byte Count1 Byte0x04
Registers Value2 Bytes****
Modbus CRC162 Bytes****

11. get input SCI status

get input SCI status
Request
Modbus RTU DataSlave ID (Linear Motor)1 Byte0x01
Function Code1 Byte0x03
Register Starting Address2 Bytes0x0A,0x26
Quantity of Registers2 Bytes0x00,0x01
Modbus CRC162 Bytes0x86,0x17
Response
Modbus RTU DataSlave ID1 Byte0x01
Function Code1 Byte0x03
Byte Count1 Byte0x02
Registers Value2 Bytes****
Modbus CRC162 Bytes****

12. get output SCO status

get output SCO status
Request
Modbus RTU DataSlave ID (Linear Motor)1 Byte0x01
Function Code1 Byte0x03
Register Starting Address2 Bytes0x0A,0x27
Quantity of Registers2 Bytes0x00,0x01
Modbus CRC162 Bytes0xD7,0xD7
Response
Modbus RTU DataSlave ID1 Byte0x01
Function Code1 Byte0x03
Byte Count1 Byte0x02
Registers Value2 Bytes****
Modbus CRC162 Bytes****
  1. get status area

address start from 0x0A20

get status area
Request
Modbus RTU DataSlave ID (Linear Motor)1 Byte0x01
Function Code1 Byte0x03
Register Starting Address2 Bytes0x0A,0x20
Quantity of Registers2 Bytes0x00,0x08
Modbus CRC162 Bytes0x46,0x1E
Response
Modbus RTU DataSlave ID1 Byte0x01
Function Code1 Byte0x03
Byte Count1 Byte0x10
Registers Value16 Bytes****
Modbus CRC162 Bytes****

Registers Value - 16 Bytes: 00 00 0F A0 00 00 00 00 00 01 00 01 00 02 00 02

1-4 bytes: 00 00 0F A0 , current position(unit: number of pulses)

5-6 bytes: 00 00, get Linear Motor status(same as address 0x0000)

7-8 bytes: 00 00, error code

9-10 bytes: 00 01, enable status

11-12 bytes: 00 01, if get back to zero

12-14 bytes: 00 02, SCI status

15-16 bytes: 00 02, SCO status