Articles on: Learning & FAQ

PR Series Stepper Drive RS485 Communication Operation Example Code

1. Initial Connection and Establishing Communication


Prerequisites


  • A PR series stepper drive with the motor and power cables connected;
  • An RJ45 Ethernet cable;
  • An RS485-to-USB converter cable (If you are unsure which one to choose, we recommend using our product: https://www.omc-stepperonline.com/1-5m-59-06-usb-to-rs422-rs485-serial-port-converter-adapter-cable-rs485-1);
  • A serial port software or controller capable of sending RS485 commands.


Wiring


Find the definition of the RS485 interface in the PR series stepper drive manual as follows:



Compare with the pinout of the RJ45 Ethernet cable:



It can be seen that we need to select wires 1, 2, and 5 to connect to the RS485-to-USB converter cable. For the RJ45 Ethernet cable, keep one end with the RJ45 connector to plug into the drive's CN3 port. Cut off the connector at the other end, strip wires 1, 2, and 5 (brown, brown-white, and blue), and connect them in the following order:


485+ ----------------TXD+

485- ----------------TXD-

GND ---------------GND



After wiring, insert both ends into the drive and PC interfaces respectively. Power on the drive and open the serial port software to establish communication. (If communication fails to establish, please refer to this troubleshooting article:


Note:

Before entering the code, set SW1 to ON and SW2-5 to OFF! This sets the RS485 address to 01.


If you need to save the written RS485 command, write the following as the last command:

01 06 00 2D 00 42 CRC CRC

Otherwise, the written parameters will revert to their default values after the drive is powered off!

When using speed mode, after saving and restarting the drive, you must re-enter a start command. The motor will not rotate immediately upon power-up.


  1. Operation Modes


2.1. Speed Control Mode


Commend

Description

01 06 00 2D 00 12 CRC CRC

Set Enable (default is enabled; if disabled, enter this code first)

01 06 00 1D 00 3C CRC CRC

Set running speed to 60rpm

01 06 00 1E 00 64 CRC CRC

Set acceleration time to 100ms

01 06 00 1F 00 64 CRC CRC

Set deceleration time to 100ms

01 10 00 27 00 02 CRC CRC

Set the drive to start in speed mode

01 10 00 27 01 00 CRC CRC

Stop command


Please note the following:

Take the command 01 06 00 2D 00 12 CRC CRC as an example:


  • 01 is the axis address (set SW1 to ON, SW2-5 to OFF).
  • 06 is the write command.
  • 00 2D is the parameter address to write to.
  • 00 12 is the value to write.


  • CRC CRC is the checksum.

Some serial port tools may not require a checksum, while others may require manual calculation. Please pay attention to this.


Sometimes, multiple registers can be written with a single command. For example, the content from line 2 to line 4 in the above code can be represented as:

01 10 00 1D 00 03 06 00 3C 00 64 00 64 CRC CRC


  • 01 is the axis address (default is 1).
  • 10 is the command to write multiple registers.
  • 00 1D is the starting parameter address (subsequent addresses follow sequentially after two bytes).
  • 00 03 06 indicates the number of parameters and bytes to write.
  • 00 3C is the value for the rotation speed.
  • 00 64 is the value for acceleration/deceleration time.
  • CRC CRC is the checksum.


2.2. Multi-Speed Operation


Commend

Description

01 06 00 2D 00 12 CRC CRC

Set Enable (default is enabled; if disabled, enter this code first)

01 06 00 C0 00 0A CRC CRC

Set running speed to 10 rpm

01 06 00 C1 00 64 CRC CRC

Set first-stage speed acceleration time to 100 ms

01 06 00 C2 00 64 CRC CRC

Set first-stage speed deceleration time to 100 ms

01 10 00 C3 00 C8 CRC CRC

Set running speed to 200 rpm

01 10 00 C4 00 64 CRC CRC

Set second-stage speed acceleration time to 100 ms

01 10 00 C5 00 64 CRC CRC

Set second-stage speed deceleration time to 100 ms

01 10 00 45 00 0D CRC CRC

Set input terminal X4 as the PV trigger signal

01 10 00 41 00 0E CRC CRC

Set input terminal X1 as PIN0

01 10 00 42 00 0F CRC CRC

Set input terminal X2 as PIN1

01 10 00 43 00 10 CRC CRC

Set input terminal X3 as PIN2

01 10 00 44 00 11 CRC CRC

Set input terminal X4 as PIN3

01 10 00 40 27 10 CRC CRC

Start at first-stage speed

01 10 00 40 27 11 CRC CRC

Start at second-stage speed

01 10 00 40 00 00 CRC CRC

Stop command


Note:

Some drive peripherals only support X0 to X3, totaling 4 input signals. Therefore, position segment selection supports up to 8 segments at most.


2.3. Absolute Position Movement of 5000 pulses(Default setting: 10000 pulses/rev)


Commend

Description

01 06 00 2D 00 12 CRC CRC

Set Enable (default is enabled; if disabled, enter this code first)

01 06 00 20 00 0A CRC CRC

Set running speed to 10 rpm

01 06 00 21 00 64 CRC CRC

Set first-stage speed acceleration time to 100 ms

01 06 00 22 00 64 CRC CRC

Set first-stage speed deceleration time to 100 ms

01 10 00 23 00 3C CRC CRC

Set maximum speed to 60 rpm

01 10 00 24 00 00 CRC CRC

Set the high bit of total pulses to 0

01 10 00 25 13 88 CRC CRC

Set the low bit of total pulses to 5000 pulses

01 10 00 27 00 01 CRC CRC

Start in relative positioning mode

01 10 00 27 01 00 CRC CRC

Stop prematurely


Note:

It is important to note that if the total pulse quantity you set is less than the minimum pulse quantity calculated based on the acceleration/deceleration time and maximum speed, the drive will not reach the maximum speed you configured.


2.4. Multi-Position Operation under Absolute Positioning(First segment: 1000 pulses; Second segment: 5000 pulses)


Note: In this mode, the first segment moves from the origin (0) to the position of 1 revolution, and the second segment moves an additional 5 revolutions relative to the first segment.

In multi-segment mode, the 0x0050 Relative/Absolute Position Register controls whether each position segment operates in relative or absolute positioning mode.


Command

Description

01 06 00 2D 00 12 CRC CRC

Set Enable (default is enabled; if disabled, enter this code first)

01 10 00 60 00 02 04 00 00 03 E8 CRC CRC

Set total pulses to 1000 pulses

01 06 00 62 00 32 CRC CRC

Set the first segment positioning speed to 50 rpm

01 06 00 63 00 64 CRC CRC

Set first-stage speed acceleration time to 100 ms

01 06 00 64 00 64 CRC CRC

Set first-stage speed deceleration time to 100 ms

01 10 00 66 00 02 04 00 00 13 88 CRC CRC

Set total pulses to 5000 pulses

01 06 00 68 00 64 CRC CRC

Set the first segment positioning speed to 100 rpm

01 06 00 69 00 64 CRC CRC

Set first-stage speed acceleration time to 100 ms

01 06 00 70 00 64 CRC CRC

Set first-stage speed deceleration time to 100 ms

01 06 00 45 00 0C CRC CRC

Set input terminal X4 as the PT trigger signal

01 06 00 41 00 0E CRC CRC

Set input terminal X1 as PIN0

01 06 00 42 00 0F CRC CRC

Set input terminal X2 as PIN1

01 06 00 43 00 10 CRC CRC

Set input terminal X3 as PIN2

01 06 00 44 00 11 CRC CRC

Set input terminal X4 as PIN3

01 06 00 40 27 10 CRC CRC

Start the first segment positioning

01 06 00 40 00 00 CRC CRC

Clear the PT trigger signal

01 06 00 40 27 11 CRC CRC

Start the second segment positioning

01 06 00 40 00 00 CRC CRC

Stop command


Note:


* When using PIN terminals for segment selection, the signal must remain valid for 5ms before and 5ms after the "PT trigger signal".

* Some drive peripherals only support X0 to X3 where 4 input signals in total, so the position segment selection supports up to 8 segments at most.


3. Common Commands


Motor Enable:

01 06 00 2D 00 12 CRC CRC


Motor Disable:

01 06 00 2D 00 11 CRC CRC


Restore Factory Settings:

01 06 00 2D 00 41 CRC CRC


Save All Parameters:

01 06 00 2D 00 42 CRC CRC


Stop Command:

01 06 00 27 01 00 CRC CRC


Emergency Stop Command:

01 06 00 27 02 00 CRC CRC


Motor Maximum Effective Current 150mA:

01 06 01 02 05 DC CRC CRC




Updated on: 26/08/2025

Was this article helpful?

Share your feedback

Cancel

Thank you!