0% found this document useful (0 votes)
11 views

WJ66 - Machine Translated

WJ66 - Machine Translated

Uploaded by

sjfaustino
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

WJ66 - Machine Translated

WJ66 - Machine Translated

Uploaded by

sjfaustino
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Machine Translated by Google

Encoder pulse counter, angular velocity displacement measurement, Modbus RTU module WJ66

Encoder pulse counter, angular velocity displacement measurement, Modbus RTU module WJ66

Features:

• Encoder decoding and conversion into standard Modbus RTU protocol

•Can be used as encoder counter or speed measurement

• Supports 4 encoders counting simultaneously and can identify forward and reverse rotations

• Built-in 8 DOs can be used as encoder upper and lower limit alarm outputs

• Automatically save counter data when power is off

• Each channel of built-in DO can independently output PWM signal

• Count value can be cleared and set through RS-485/232 interface

• Wide power supply range: 8 ~ 32VDC • High reliability,

easy programming and easy application

• Standard DIN35 guide rail installation, convenient for centralized wiring

• Users can programmably set the module address, baud rate, etc.

• Low cost, small volume modular design

• Overall dimensions: 120 mm x 70 mm x 43mm

typical application:

• Encoder pulse signal measurement

• Displacement or angle measurement

• Motor speed measurement and control Figure 1 WJ66 module appearance diagram

• Replace meter counter to control multiple

devices • Remotely transmit encoder signals to industrial computers

• Smart factory and industrial Internet of Things

• Replace PLC and directly transmit data to the control center

product description:

The WJ66 product realizes signal acquisition between the sensor and the host, and is used to decode the encoder signal and control the device. WJ66 series products can be used in

RS-232/485 bus industrial automation control system, automated machine tools, industrial robots, three-coordinate positioning system, displacement measurement, stroke measurement, angle

Measurement, speed measurement, etc.

Products include pulse signal capture, signal conversion and RS-485 serial communications. Each serial port can connect up to 255 WJ66 series modules. The communication method

Adopting ASCII code communication protocol or MODBUS RTU communication protocol, the baud rate can be set by code, and can be hung on the same platform as control modules from other manufacturers.

On the RS-485 bus, it facilitates computer programming.

Figure 2 Internal block diagram of WJ66 module

WJ66 series products are intelligent monitoring and control systems based on microcontrollers. All user-set addresses, baud rates, data formats, checksums

Shenzhen Wayjun Technology Co., Ltd. www.wayjun.cn Tel: 0755-83356002 Page 1 of 22


Machine Translated by Google

Modbus RTU
Encoder pulse counter, angular velocity displacement measurement, module WJ66

Configuration information such as status is stored in the non-volatile memory EEPROM.

WJ66 series products are designed and manufactured according to industrial standards, with strong anti-interference ability and high reliability. Working temperature range - 45ÿÿ+85ÿ.

Function introduction:

The WJ66 remote I/O module can be used to measure four encoder signals and has eight switching outputs. Can be used as 4-channel encoder counter or 4-channel speed

For measurement, it can also output 8 PWM signals.

1. Signal input and output

4 channels of encoder signal input, which can be connected to dry contacts and wet contacts. Please refer to the wiring diagram for details; 8 channels of switch signal output are open collector outputs.

2. Communication protocol

Communication interface: 1-way standard RS-485 communication interface or 1-way standard RS-232 communication interface, please indicate when ordering and selecting.

Communication protocol: Supports two protocols, the character protocol defined by the command set and the MODBUS RTU communication protocol. The module automatically identifies the communication protocol,

It can realize network communication with various brands of PLC, RTU or computer monitoring systems.

Data format: 10 bits. 1 start bit, 8 data bits, 1 stop bit.

Communication address (0~255) and baud rate (2400, 4800, 9600, 19200, 38400, 57600, 115200bps) can be set; communication

The maximum distance of the network is up to 1200 meters, connected through twisted pair shielded cables.

The communication interface has high anti-interference design, ±15KV ESD protection, and communication response time is less

than 100mS. 3. Anti-interference

Checksums can be set as needed. There is a transient suppression diode inside the module, which can effectively suppress various surge pulses and protect the module.

Word filtering can also effectively suppress power frequency interference from the power grid.

product model:

WJ66 - ÿ

Communication Interface

485: Output is RS-485 interface 232:

Output is RS-232 interface

Selection example 1: Model: WJ66 -232 means the output is RS-232 interface

Selection example 2: Model: WJ66 -485 means the output is RS-485 interface

WJ66 general parameters:

(typical @ +25ÿ, Vs is 24VDC) Input type: Encoder

AB signal input, 4 channels (A0/B0~ A3/B3).

Low level: Input < 1V; High level: Input 3.5 ~ 30V Frequency range 0-50KHz

Counting range - 2147483647

~ +2147483647, automatically saved when power is off

Input resistance: 30Kÿ Output

type: Open collector output, voltage 0~30V, maximum load current 30mA, 8 channels (DO0~DO7).

PWM frequency 1~65535Hz, duty cycle 0%~100%

Communication: Protocol RS-485 or RS-232 standard character protocol and MODBUS RTU communication protocol

Baud rate (2400, 4800, 9600, 19200, 38400, 57600, 115200bps) can be selected by software

Address (0~255) can be selected by software

Communication response time: 100 ms

Maximum working power supply: +8 ~ 32VDC Wide power supply range, internal anti-reverse connection and

overvoltage protection circuit Power

consumption: less than 0.5W Working

temperature: - 45 ~ +80ÿ Working humidity: 10 ~ 90% (no condensation)

Shenzhen Wayjun Technology Co., Ltd. www.wayjun.cn Tel: 0755-83356002 Page 2 of 22


Machine Translated by Google

Modbus RTU
Encoder pulse counter, angular velocity displacement measurement, module WJ66

Storage temperature: - 45 ~ +80ÿ

Storage humidity: 10 ~ 95% (no condensation)

Overall dimensions: 120 mm x 70 mm x 43mm

Pin definition:

pin name description Pin name description

1 DO7 channel 7 switching signal output terminal 11 DO1 channel 1 switching signal output terminal

2 DO6 channel 6 switching signal output terminal 12 DO0 channel 0 switching signal output terminal

3 DO5 channel 5 switching signal output terminal 13 A0 Encoder 0 signal A input terminal

4 DO4 channel 4 switching signal output terminal 14 B0 Encoder 0 signal B input terminal

5 DO3 channel 3 switching signal output terminal 15 A1 Encoder 1 signal A input terminal

6 DO2 channel 2 switching signal output terminal 16 B1 Encoder 1 signal B input terminal

7 DATA+ RS-485 signal positive terminal 17 A2 Encoder 2 signal A input terminal

8 DATA- RS-485 signal negative terminal 18 B2 Encoder 2 signal B input terminal

9 PW+ power supply positive terminal 19 A3 Encoder 3 signal A input terminal

10 GND Negative terminal of power supply, signal ground 20 B3 Encoder 3 signal B input terminal table 1 pin

definition

Figure 3 WJ66 module wiring diagram

Encoder alarm output port

Encoder 0 Upper limit alarm output DO0

port Encoder 1 Upper limit alarm DO1

output port Encoder 2 Upper limit DO2

alarm output port Encoder 3 Upper DO3

limit alarm output port Encoder 0 DO4

Lower limit alarm output port Encoder DO5

1 Lower limit alarm output port DO6

Encoder 2 Lower limit alarm output port code Device 3 lower limit alarm output port DO7

Shenzhen Wayjun Technology Co., Ltd. www.wayjun.cn Tel: 0755-83356002 Page 3 of 22


Machine Translated by Google

Modbus
Encoder pulse counter, angular velocity displacement measurement, RTU module WJ66

Encoder signal input wiring diagram

NPN type encoder NPN encoder with pull-up resistor

The internal pull-up resistor needs to be turned on, and the 40082 register is set toThe internal pull-up resistor needs to be turned off, and the 40082 register is set to 0.

1, or send the character command $01Q1X Or send the character command $01Q0X

PNP type encoder push-pull encoder

The internal pull-up resistor needs to be turned off, and the 40082 register is set to The internal pull-up resistor needs to be turned off, and the 40082 register is set to 0.

0, or send the character command $01Q0X Or send the character command $01Q0X

Note: The factory default is to turn off the pull-up

Switching signal output wiring diagram

Drive Relay Level output

The external power supply can be selected from The output high level is equal to the supply voltage

5 ~ 30VDC, or it can be the power supply for the module. It is necessary to turn on the internal pull-up resistor, set the 40083 register to 1, or send

The operating current of the transistor is less Send character command $01QX1.

than 30mA. The internal pull-up resistor needs to be turned off, and the 40083 register is set to 0, or

or send the character command $01QX0

Note: The factory default is to turn off the pull-up

Shenzhen Wayjun Technology Co., Ltd. www.wayjun.cn Tel: 0755-83356002 Page 4 of 22


Machine Translated by Google

Modbus RTU
Encoder pulse counter, angular velocity displacement measurement, module WJ66

WJ66 character protocol command set:

The factory initial settings of the module are as

follows: The address

code is 01. The baud rate

is 9600 bps. The

checksum is disabled. If the RS-485 network is used, a unique address code must be assigned. The address code value is a hexadecimal number between 00 and between FF,

Since the address codes of new modules are all the same, their addresses will conflict with other modules, so when you build the system, you must reconfigure each

A WJ66 module address. After connecting the WJ66 module power cord and RS485 communication line, you can modify the address of the WJ66 module through configuration commands.

The baud rate, checksum status also need to be adjusted according to the user's requirements. Before modifying the baud rate and checksum status, the module must first enter the default setting.

status, otherwise it cannot be modified.

How to put the module into the default state:

There is an INIT switch on the side of the WJ66 module, located on the side of the module. Turn the INIT switch to the INIT position and then turn on the power.

The module enters the default state. In this state, the module is configured as follows:

The address code is 00,

the baud rate is 9600 bps,

and the checksum

is disabled. At this time, the baud rate, checksum status and other parameters of the WJ66 module can be modified through configuration commands. When you are unsure about the specific configuration of a m

You can also turn the INIT switch to the INIT position to put the module into the default state, and then reconfigure the module.

Note: During normal use, please turn the INIT switch to the NORMAL position.

The character protocol command consists of a series of characters, such as a prefix, address ID, variables, optional checksum bytes, and a command end character (cr) used to display the command.

The host can only command one WJ66 module at a time, except for the synchronization command with the wildcard address "**".

Command format: (Leading Code)(Addr)(Command)[data][checksum](cr)

(Leading code) The leading code is the first letter in the command. All commands require a command prefix, such as %, $, #, @,... etc. 1- character

(Addr) Module address code, if not specified below, the value range is from 00 to FF (hexadecimal). 2- characters

(Command) displays the command code or variable value. Variable length [data] Some data required by the output command. variable length

[checksum] The Checksum (checksum) in brackets shows an optional parameter and is only required when checksum is enabled. 2- A control code character used for character

(cr) recognition, (cr) is used as the carriage return terminator, and its value is 0x0D. 1- character

[Checksum] is required when checksum is enabled. It takes up 2-characters. Both commands and responses must have a checksum attribute attached. Checksum

Used to check all input commands to help you find host-to-module command errors and module-to-host response errors. The checksum character is placed in the command or

After the response character and before the carriage return character.

Calculation method: two characters, a hexadecimal number, which is the sum of the ASCII code values of all previously sent characters, and then ANDed with the hexadecimal number 0xFF.

Application example: disabling checksum (checksum)

user command $002(cr)

Module response !00020600 (cr)

Enable checksum (checksum) user

command $002B6 (cr)

Module answer !00020600 A9 (cr)

‘$’ = 0x24 ‘0’ = 0x30 ‘2’ = 0x32

B6=(0x24+0x30+0x30+0x32) AND 0xFF ‘!’ = 0x21 ‘0’ = 0x30 ‘2’

= 0x32 ‘6’ = 0x36

A9=(0x21+0x30+0x30+0x30+0x32+0x30+0x36+0x30+0x30) AND 0xFF

Response to command:

The response message depends on various commands. The response also consists of several characters, including the first code, variables and end identifier. The first part of the response signal

Shenzhen Wayjun Technology Co., Ltd. www.wayjun.cn Tel: 0755-83356002 Page 5 of 22


Machine Translated by Google

Modbus RTU
Encoder pulse counter, angular velocity displacement measurement, module WJ66

There are two types of codes, '!' or '>' represents a valid command and '?' represents an invalid command. By checking the response information, you can monitor whether the command is valid

Note: 1. In some cases, many commands use the same command format. Make sure you use the correct address in a command. If you use the wrong

If the address is wrong, and this address represents another module, then the command will take effect in the other module, so an error occurs.

2. Commands must be entered in capital letters.

3. (cr) represents the carriage return character on the keyboard. Do not write it directly. You should press the Enter key (Enter key).

1. Read switch status command

Description: Read back all output channel switching status, switching reset status and encoder input channel switching status from the module.

Command format: #AA(cr)

Parameter description: # delimiter. Hexadecimal is 23H AA

module address, the value range is 00~FF (hexadecimal). The factory address is 01, converted to hexadecimal as ASCII for each character

code. For example, address 01 is converted into hexadecimal 30H and 31H.

(cr) Terminator, the carriage return key of the host computer, the hexadecimal value is 0DH.

Response format: > AAAAAAAA,BBBBBBBB,CCCCCCCC(cr) command is valid.

?01(cr) The command is invalid or illegal operation.

Parameter description: > delimiter. The hexadecimal value is 3EH

AAAAAAAA, which represents the read output switch status, 8 numbers, and the order is DO7~DO0.

The value is 0: the output transistor is disconnected; the value is 1: the output transistor is connected

BBBBBBBB represents the read output switch status after reset, 8 numbers, the order is DO7~DO0, a value of 0: the

output transistor is disconnected; a value of 1: the output transistor is connected

CCCCCCCC represents the read encoder input switch status, 8 numbers, the order is B3A3 B2A2 B1A1 B0A0, the value is 0: input low level; the

value is 1: input high level

(cr) Terminator, the carriage return key of the host computer, the hexadecimal value is 0DH.

Application example: User command (character format) #01(cr) Module

response (character format) >00011000,00001010,00000111(cr) Description: The module output

switch status is 00011000, and the arrangement sequence is DO7~DO0 Channel 0: Transistor is

disconnected Channel 1: Transistor off Channel 2: Transistor off Channel 3: Transistor on Channel 4: Transistor on Channel 5: Transistor

off Channel 6: Transistor off Channel 7: Transistor off

After the module is reset, the output switch state is 00001010, and the order is DO7~DO0

Channel 0: Transistor is off Channel 1: Transistor is on Channel 2: Transistor is off Channel 3: Transistor is on Channel 4: Transistor is

off Channel 5: Transistor is off Open Channel 6: Transistor is disconnected Channel 7: Transistor is disconnected

The module input switch status is 00000111 and


, the order is B3A3 B2A2 B1A1 B0A0 A0: high level B0:

high level A1: high level B1: low level

A2: low level B2: low level A3: low level B3: low level

2. Set the transistor output command

Description: Set the transistor status of all output channels. The factory setting for all channels is 00000000.

Command format: #AA1ABCD(cr)

Parameter description: # delimiter. Hexadecimal is 24H AA

module address, the value range is 00~FF (hexadecimal). The factory address is 01, converted to hexadecimal as ASCII for each character

code. For example, address 01 is converted into hexadecimal 30H and 31H.

1 means setting the transistor output command

AB channel selection, you can select all output channels or a single output channel.

Set output: Set AB to 00, which means setting all output channels. If setting for a single channel, the character A

Must be set to 1, character B can be set to 0-7, representing 8 triode DO output channels.

Set reset output: Setting AB to FF means setting the reset output value of all channels. For example, if the reset output of a single channel is

Shenzhen Wayjun Technology Co., Ltd. www.wayjun.cn Tel: 0755-83356002 Page 6 of 22


Machine Translated by Google

Modbus RTU
Encoder pulse counter, angular velocity displacement measurement, module WJ66

Line setting, then character A must be set to E, character B can be set to 0-7, representing 8 transistor DO output channels.

CD output value.

1. If it is set for all channels (AB=00 or AB=FF)

Then it is two hexadecimal numbers, as shown on the right

C stands for channel 7~4 C D

and D stands for channel 3~0. DO7 DO6 DO5 DO4 DO3 DO2 DO1 DO0

Bit value is 0: Bit7 Bit 6 Bit 5 Bit 4 Bit 3 Bit2 Bit 1 Bit 0

Set the output transistor to disconnect

Bit value is 1:

Set the output transistor to turn on

2. If it is set for a single channel (AB=1X or AB=EX, X represents the channel to be set), it can only be set to 00 or 01.

00: Set the X channel output transistor to be disconnected

01: Set the X channel output transistor to be turned

on (cr). The end character is the enter key of the host computer. The hexadecimal value is 0DH.

Response format: !01(cr) The command is valid.

?01(cr) The command is invalid or illegal operation.

Application example 1: User command (character format) #011000F(cr) Module response

(character format) !01(cr) Description: Set the output of

all channels (AB=00) to 0FH, which converted to binary is 0000 1111.

Then the switch status of the module output

is: Channel 0: Transistor on Channel 1: Transistor on Channel 2: Transistor on Channel 3: Transistor on Channel 4: Transistor off Channel 5:

Transistor off Channel 6: Transistor off Channel 7: Transistor disconnected

Application example 2: User command (character format) #0111201(cr) Module

response (character format) !01(cr) Description: Set the

transistor of channel 2 to be turned on.

Application example 3: User command (character format) #011FFFF(cr) module response

(character format) !01(cr)

Description: Set the reset output of all channels (AB=FF) to FFH, which converted to binary is 1111 1111.

Then after the module is reset, the transistors of all channels are turned on.

3. Read encoder counter data command

Description: To read the data of the encoder counter, you can read all encoders or a single encoder. '+' means forward rotation, '-' means reverse rotation.

Command format: #AA2(cr)

AA module address, value range 00~FF (hexadecimal). The factory address is 01, converted to hexadecimal as ASCII for each character

code. For example, address 01 is converted into hexadecimal 30H and 31H.

2 means reading the encoder 0~encoder 3 counter data command.

(cr) Terminator, the carriage return key of the host computer, the hexadecimal value is 0DH.

Response format: !+AAAAAAAAA, +AAAAAAAAAA, +AAAAAAAAAA, +AAAAAAAAAA (cr) Command format: #AA2N(cr)

AA module address, value range 00~FF (hexadecimal). The factory address is 01, converted to hexadecimal as ASCII for each character

code. For example, address 01 is converted into hexadecimal 30H and 31H.

2 represents the read counter data command.

N represents the read encoder N counter data command.

(cr) Terminator, the carriage return key of the host computer, the hexadecimal value is 0DH.

Shenzhen Wayjun Technology Co., Ltd. www.wayjun.cn Tel: 0755-83356002 Page 7 of 22


Machine Translated by Google

Modbus RTU
Encoder pulse counter, angular velocity displacement measurement, module WJ66

Response format: !+AAAAAAAAA(cr) Application

example 1: User command (character format) #012(cr) Module response

(character format) !+0012345678, +0012345678, +0012345678, +0012345678 (cr) Description: All encoders The count value is forward

+12345678.

Application example 2: User command (character format) #0120(cr) Module

response (character format) !-0012345678(cr) Description: The count

value of encoder 0 is inverted -12345678.

4. Read input frequency command

Description: Read the input frequency, you can read all encoders, or you can read a single encoder. '+' means forward rotation, '-' means reverse rotation.

Command format: #AA3

AA module address, value range 00~FF (hexadecimal). The factory address is 01, converted to hexadecimal as ASCII for each character

code. For example, address 01 is converted into hexadecimal 30H and 31H.

3 means reading the input frequency command of encoder 0~encoder 3.

(cr) Terminator, the carriage return key of the host computer, the hexadecimal value is 0DH.

Response format: !+AAAAAA.AA,+AAAAAA.AA,+AAAAAA.AA,+AAAAAA.AA (cr) Command format: #AA3N Read

encoder N input frequency

AA module address, value range 00~FF (hexadecimal). The factory address is 01, converted to hexadecimal as ASCII for each character

code. For example, address 01 is converted into hexadecimal 30H and 31H.

3 means read input frequency command.

N means reading the encoder N input frequency command.

(cr) Terminator, the carriage return key of the host computer, the hexadecimal value is 0DH.

Response format: ! +AAAAAA.AA (cr) Application

example 1: User command (character format) #013 (cr) Module response

(character format) !+001000.00,+001000.00,+001000.00,+001000.00 (cr) Description: All The input frequency value of the

encoder is forward +1KHz.

Application example 2: User command (character format) #0130(cr) Module

response (character format) !-001000.00(cr) Description: The input

frequency value of encoder 0 is inverted -1KHz.

5. Read output PWM command

Description: To read the output PWM, you can read all channels, you can also read a single channel, and you can also read the reset PWM

value. Command format: #AA4(cr) Read the PWM value of channel 0~channel 7

Parameter description: AA module address, value range 00~FF (hexadecimal). The factory address is 01, converted to hexadecimal as ASCII for each character

code. For example, address 01 is converted into hexadecimal 30H and 31H.

(cr) Terminator, the carriage return key of the host computer, the hexadecimal value is 0DH.

Response format: ! AAA.AA, AAA.AA, AAA.AA, AAA.AA, AAA.AA, AAA.AA, AAA.AA, AAA.AA(cr) Command format: #AA4S(cr) Read channel

0~ Channel 7 reset PWM value

Response format: ! AAA.AA, AAA.AA, AAA.AA, AAA.AA, AAA.AA, AAA.AA, AAA.AA, AAA.AA(cr) Command format: #AA4N(cr) Read channel

N PWM value

Response format: ! AAA.AA (cr)

Command format: #AA4SN(cr) Read the reset PWM value of channel N

Response format: ! AAA.AA (cr)

Application example 1: User command (character format) #014(cr) Module

response (character format) ! 050.00,050.00,050.00,050.00,050.00,050.00,050.00,050.00(cr)

Shenzhen Wayjun Technology Co., Ltd. www.wayjun.cn Tel: 0755-83356002 Page 8 of 22


Machine Translated by Google

Modbus RTU
Encoder pulse counter, angular velocity displacement measurement, module WJ66

Note: The PWM value of all channels is 50%.

Application example 2: User command (character format) #0140(cr) Module response

(character format) !050.00(cr) Description: The PWM value of

channel 0 is 50%.

6. Set PWM command

Note: When setting the output PWM value or setting the reset PWM value, only a single channel can be set. The factory setting for all channels is 050.00.

Command format: #AA5NAAA.AA(cr) Set the PWM value of channel N. Parameter description:

AA module address, value range 00~FF (hexadecimal). The factory address is 01, converted to hexadecimal as ASCII for each character

code. For example, address 01 is converted into hexadecimal 30H and 31H.

N channel, value range is 0~7.

AAA.AA sets the output PWM value, the value range is 000.00~100.00

(cr) Terminator, the carriage return key of the host computer, the hexadecimal value is 0DH.

Response format: ! AA(cr) means the setting is successful

Command format: #015SNAAA.AA(cr) Set the reset PWM value of channel N

Response format: !AAcr) indicates successful setting

Application example 1: User command (character format) #0150050.00(cr) Module response

(character format) ! 01(cr) Description: Set the PWM

value of channel 0 to 50%.

Application example 2: User command (character format) #015S0050.00(cr) Module response

(character format) !01(cr) Description: Set the reset

PWM value of channel 0 to 50%.

7. Read the frequency command of PWM

Description: Read the output PWM frequency, and you can also read the reset PWM frequency.

Command format: #AA6(cr) Read PWM frequency parameter

description: AA module address, value range 00~FF (hexadecimal). The factory address is 01, converted to hexadecimal as ASCII for each character

code. For example, address 01 is converted into hexadecimal 30H and 31H.

(cr) Terminator, the carriage return key of the host computer, the hexadecimal value is 0DH.

Response format: ! AAAAA, BBBBB (cr) AAAAA represents the frequency of channels 0~3, BBBBB represents the frequency of channels 4~7 Command

format: #AA6S Read reset PWM value

Response format: ! AAAAA, BBBBB (cr) AAAAA represents the reset frequency of channels 0~3, BBBBB represents the reset frequency of channels 4~7 Application

example 1: User command (character format) #016 (cr) module response (character

format ) ! 01000,02000(cr) Description: The PWM frequency of channels

0~3 is 1KHz, and the PWM frequency of channels 4~7 is 2KHz.

Application example 2: User command (character format) #016S(cr) Module response

(character format) ! 00100,00200 (cr) Description: The PWM reset

frequency of channels 0~3 is 100Hz, and the PWM reset frequency of channels 4~7 is 200Hz.

8. Set PWM frequency command

Note: When setting the output PWM frequency or setting the reset PWM frequency, only a single channel can be set. Range 00000~65535, set to 00000

Indicates that the PWM output is turned off and the output is a switching level output. The factory setting for all channels is 00000.

Command format: #AA7NAAAAA(cr) N=0 means to set the PWM frequency of channels 0~3, N=1 means to set the PWM frequency of channels 4~7. Parameter description:

AA module address, value range 00~FF (hexadecimal). The factory address is 01, converted to hexadecimal as ASCII for each character

code. For example, address 01 is converted into hexadecimal 30H and 31H.

(cr) Terminator, the carriage return key of the host computer, the hexadecimal value is 0DH.

Shenzhen Wayjun Technology Co., Ltd. www.wayjun.cn Tel: 0755-83356002 Page 9 of 22


Machine Translated by Google

Modbus RTU
Encoder pulse counter, angular velocity displacement measurement, module WJ66

Response format: ! AA(cr) means the setting is successful

Command format: #AA7SNAAAAAA(cr) N=0 means setting the PWM reset frequency of channels 0~3.

N=1 means setting the PWM reset frequency of channels 4~7.

Response format: ! AA(cr) means the setting is successful

Application example 1: User command (character format) #017000100(cr) Module response

(character format) ! 01(cr) Description: Set the PWM

frequency of channels 0~3 to 100Hz.

Application example 2: User command (character format) #017S100500(cr) Module response

(character format) !01(cr) Description: Set the reset PWM

frequency of channels 4~7 to 500Hz.

9. Read input speed command

Description: Read the input speed, you can read all encoders, or you can read a single encoder. '+' means forward rotation, '-' means reverse rotation. Command

format: #AA8

AA module address, value range 00~FF (hexadecimal). The factory address is 01, converted to hexadecimal as ASCII for each character

code. For example, address 01 is converted into hexadecimal 30H and 31H.

8 means reading the encoder 0~encoder 3 input speed command.

(cr) Terminator, the carriage return key of the host computer, the hexadecimal value is 0DH.

Response format: !+AAAA,+AAAA,+AAAAA,+AAAA (cr) Command format: #AA8N Read

encoder N input speed

AA module address, value range 00~FF (hexadecimal). The factory address is 01, converted to hexadecimal as ASCII for each character

code. For example, address 01 is converted into hexadecimal 30H and 31H.

8 means reading the input speed command.

N means reading the encoder N input speed command.

(cr) Terminator, the carriage return key of the host computer, the hexadecimal value is 0DH.

Response format: ! +AAAAA (cr)

Application example 1: User command (character format) #018 (cr) Module response

(character format) !+01000,+01000,+01000,+01000 (cr) Description: All encoders The input speed

value is forward +1000 rpm.

Application example 2: User command (character format) #0180(cr) Module response

(character format) !-01000(cr) Description: The input speed

value of encoder 0 is reverse -1000 revolutions.

10. Modify the numerical command of the encoder counter

Description: Modify the value of the encoder counter, or set it to zero and start counting again. The alarm will be cleared automatically after modifying the count value.

Command format: $AA1N+AAAAAAAAAA(cr) Modify the count value of encoder N. N is the encoder code. When N is set to 'A', it means

Set the counters for all encoders simultaneously.

Parameter description: AA module address, value range 00~FF (hexadecimal). The factory address is 01, converted to hexadecimal as ASCII for each character

code. For example, address 01 is converted into hexadecimal 30H and 31H.

(cr) Terminator, the carriage return key of the host computer, the hexadecimal value is 0DH.

Response format: ! AA(cr) means the setting is successful

Application example 1: User command (character format) $0113+0000000000(cr) Module response

(character format) ! 01(cr) Description: Set the count value

of encoder 3 to 0. If there is an alarm, the alarm will be cleared automatically.

Application example 2: User command (character format) $011A+0000000000(cr) Module response (character

format) ! 01(cr)

Shenzhen Wayjun Technology Co., Ltd. www.wayjun.cn Tel: 0755-83356002 Page 10 of 22


Machine Translated by Google

Modbus RTU
Encoder pulse counter, angular velocity displacement measurement, module WJ66

Description: Set the count value of all encoders to 0.

Application example 3: User command (character format) $011A+0000003000(cr) Module response (character

format) ! 01(cr) Description: Set the count value of all

encoders to +3000. If there is an alarm, the alarm will be cleared automatically.

11. Set the PWM output inversion command

Description: Set whether the PWM output should be output after inverting the high and low levels. The factory setting is 00000000.

Command format: $AA3BBBBBBBB(cr) sets whether the PWM output is inverted.

Parameter description: AA module address, value range 00~FF (hexadecimal). The factory address is 01, converted to hexadecimal as ASCII for each character

code. For example, address 01 is converted into hexadecimal 30H and 31H.

(cr) Terminator, the carriage return key of the host computer, the hexadecimal value is 0DH.

Response format: ! AA(cr) means the setting is successful

Parameter description: BBBBBBBB represents the switch status, 8 numbers, the order is DO7~DO0

The value is 0: the PWM of this channel is normal output; the value is 1: the PWM of this channel is inverted output.

Application example: User command (character format) $01300000000(cr) Module response

(character format) ! 01(cr) Description: Set all channel PWM

normal output.

12. Read the PWM output to see if the command is inverted.

Description: Read whether the PWM output has set inversion.

Command format: $AA4(cr) Read whether the PWM output is inverted.

Parameter description: AA module address, value range 00~FF (hexadecimal). The factory address is 01, converted to hexadecimal as ASCII for each character

code. For example, address 01 is converted into hexadecimal 30H and 31H.

(cr) Terminator, the carriage return key of the host computer, the hexadecimal value is 0DH.

Response format: ! BBBBBBBB (cr) indicates whether the PWM output is set to inversion

Parameter description: BBBBBBBB represents the switch status, 8 numbers, the order is DO7~DO0

The value is 0: the PWM of this channel is normal output; the value is 1: the PWM of this channel is inverted output.

Application example: User command (character format) $014(cr) Module response

(character format) ! 11111110(cr) Description: Channel 0 PWM is

output normally, channel 1~7 PWM is inverted and output.

13. Set the number of pulses per revolution of the encoder

Description: Set the number of pulses per revolution of the encoder. Set according to the connected encoder parameters. The factory default value is 1000. Set the correct number of pulses.

Only then can the encoder speed be read.

Command format: $AA5NAAAAA (cr) Set the number of pulses per revolution of the encoder.

Parameter description: AA module address, value range 00~FF (hexadecimal). The factory address is 01, converted to hexadecimal as ASCII for each character

code. For example, address 01 is converted into hexadecimal 30H and 31H.

5 Set the encoder pulse number per revolution command.

N encoder code, value 0 ~ 3.

AAAAA represents the number of pulses, such as 1000, 800 or 600, etc.

(cr) Terminator, the carriage return key of the host computer, the hexadecimal value is 0DH.

Response format: ! AA(cr) means the setting is successful

Application example: User command (character format) $015100300 (cr) Module response

(character format) ! 01 (cr) Description: Set the number of

pulses per revolution of encoder 1 to 300.

Shenzhen Wayjun Technology Co., Ltd. www.wayjun.cn Tel: 0755-83356002 Page 11 of 22


Machine Translated by Google

Modbus RTU
Encoder pulse counter, angular velocity displacement measurement, module WJ66

14. Read the number of pulses per revolution of the encoder

Description: Read the number of pulses per revolution of all encoders.

Command format: $AA6(cr) Read the number of pulses per revolution of all encoders, arranged in order 0~3.

Parameter description: AA module address, value range 00~FF (hexadecimal). The factory address is 01, converted to hexadecimal as ASCII for each character

code. For example, address 01 is converted into hexadecimal 30H and 31H.

(cr) Terminator, the carriage return key of the host computer, the hexadecimal value is 0DH.

Response format:! AAAAA, AAAAA, AAAAA, AAAAA (cr) indicates the number of pulses per revolution of encoder 0~encoder 3.

Application example: User command (character format) $016 (cr) Module response

(character format) ! 01000, 01000, 01000, 01000 (cr) Note: The number of pulses per revolution of

all encoders is 1000.

15. Set the working mode of the encoder

Description: Set the working mode of the encoder.

Command format: $AA7NAA (cr) Set the working mode of the encoder.

Parameter description: AA module address, value range 00~FF (hexadecimal). The factory address is 01, converted to hexadecimal as ASCII for each character

code. For example, address 01 is converted into hexadecimal 30H and 31H.

7 Set the encoder working mode command.

N encoder code, value 0 ~ 3.

AA stands for working mode. The range is 00~05. In alarm mode, DO is used as a switch alarm output and cannot be used as PWM output.

00, default value, normal mode

01, upper limit alarm mode

02, lower limit alarm mode

03, both upper limit and lower limit alarm mode

04, standby mode, not used temporarily

05, standby mode, not used temporarily

(cr) Terminator, the carriage return key of the host computer, the hexadecimal value is 0DH.

Response format: ! AA(cr) means the setting is successful

Application example: User command (character format) $017101(cr) Module response

(character format) ! 01(cr) Description: Set encoder 1 to

the upper limit alarm mode.

16. Read the working mode of the encoder

Description: Read the working modes of all encoders.

Command format: $AA8(cr) Read the working modes of all encoders, arranged in order 0~3.

Parameter description: AA module address, value range 00~FF (hexadecimal). The factory address is 01, converted to hexadecimal as ASCII for each character

code. For example, address 01 is converted into hexadecimal 30H and 31H.

(cr) Terminator, the carriage return key of the host computer, the hexadecimal value is 0DH.

Response format: ! AA, AA, AA, AA (cr) indicates the working mode of encoder 0~encoder 3.

Application example: User command (character format) $018 (cr) Module response

(character format) ! 03, 03, 03, 03 (cr) Description: All encoders are in upper

and lower limit alarm mode.

17. Set the upper limit alarm value and lower limit alarm value of the encoder

Description: Set the upper limit alarm value and lower limit alarm value of the encoder, and activate the alarm according to different working modes.

Command format: $AASN+ AAAAAAAAAA,+BBBBBBBBBB (cr) Set the upper limit alarm value and lower limit alarm value of the encoder.

Parameter description: AA module address, value range 00~FF (hexadecimal). The factory address is 01, converted to hexadecimal as ASCII for each character

Shenzhen Wayjun Technology Co., Ltd. www.wayjun.cn Tel: 0755-83356002 Page 12 of 22


Machine Translated by Google

Modbus RTU
Encoder pulse counter, angular velocity displacement measurement, module WJ66

code. For example, address 01 is converted into hexadecimal 30H and 31H.

S Set encoder alarm value command.

N encoder code, value 0 ~ 3.

+AAAAAAAAA represents the upper limit alarm value.

+BBBBBBBBBB represents the lower limit alarm value.

(cr) Terminator, the carriage return key of the host computer, the hexadecimal value is 0DH.

Response format: ! AA(cr) means the setting is successful

Application example: User command (character format) $01S0+0123456790, -0000012345 (cr)

Module response (character format) ! 01(cr) Description:

Set encoder 0 as the upper limit alarm value is 1234567890, and the lower limit alarm value is -12345.

18. Set the alarm time of the encoder

Description: Set the encoder alarm time command. Alarm time, the default value is 0, which means that both the alarm signal and the counter need to be cleared by instructions issued by the host computer.

remove. If it is another value, multiply it by 0.01 seconds to get the actual continuous alarm time. After reaching the alarm time, the alarm signal will automatically

Cleared, the encoder's count value will also be automatically cleared.

Command format: $AATNAAAA,BBBBB (cr) Set the upper limit alarm time and lower limit alarm time of the encoder.

Parameter description: AA module address, value range 00~FF (hexadecimal). The factory address is 01, converted to hexadecimal as ASCII for each character

code. For example, address 01 is converted into hexadecimal 30H and 31H.

T sets the encoder alarm time command.

N encoder code, value 0 ~ 3.

AAAAA represents the upper limit alarm time. Range 0~65535.

BBBBB represents the lower limit alarm time. Range 0~65535.

(cr) Terminator, the carriage return key of the host computer, the hexadecimal value is 0DH.

Response format: ! AA(cr) means the setting is successful

Application example: User command (character format) $01T105000,02000(cr) Module response

(character format) ! 01(cr) Description: Set encoder 1 to

the upper limit alarm time of 50 seconds and the lower limit alarm time of 20 seconds.

19. Read the upper limit alarm value, lower limit alarm value and alarm time of the encoder

Description: Read the upper limit alarm value, lower limit alarm value and alarm time of the specified encoder.

Command format: $AAR(cr) Read the alarm time of all encoders, the upper limit is 0~3, the lower limit is 0~3.

Parameter description: AA module address, value range 00~FF (hexadecimal). The factory address is 01, converted to hexadecimal as ASCII for each character

code. For example, address 01 is converted into hexadecimal 30H and 31H.

(cr) Terminator, the carriage return key of the host computer, the hexadecimal value is 0DH.

Entertainment:! +AAAAAAAAAA, +AAAAAAAAAA, +AAAAAAAAAA, +AAAAAAAAAA, +BBBBBBBBBB, +BBBBBBBBBB, +BBBBBBBBBB, +BBBBBBBBBB, CCCCC,

CCCCC, CCCCC, CCCCC, DDDDD, DDDDD, DDDDD, DDDDD(cr);

+AAAAAAAAA represents the upper limit alarm value of encoder 0~encoder 3

+BBBBBBBBBB represents the lower limit alarm value of encoder 0~encoder 3

330 Indicates the upper limit alarm time of encoder 0~encoder 3.

DDDDD Indicates the lower limit alarm time of encoder 0~encoder 3.

application example: User command (character format) $01R(cr) Module

response (character format) ! +0000012345, +0000012345, +0000012345, +0000012345, -0000002000, -0000002000, -0000002000, -000000200 0,03000,

03000, 03000, 03000,03000, 03000, 03000, 03000 (cr) Description: The upper limit alarm value of all encoders is +12345, and the lower limit alarm

value is -2000.

The upper and lower alarm limits are both 30 seconds.

Shenzhen Wayjun Technology Co., Ltd. www.wayjun.cn Tel: 0755-83356002 Page 13 of 22


Machine Translated by Google

Modbus RTU
Encoder pulse counter, angular velocity displacement measurement, module WJ66

20. Set whether the encoder count value is automatically saved when the power is off.

Description: Set whether the count value of the encoder is automatically saved when the power is turned off. The factory default value is 1 (automatically saved when the power is turned off).

Command format: $AAXW

Parameter description: AA module address, value range 00~FF (hexadecimal). The factory address is 01, converted to hexadecimal as ASCII for each character

code. For example, address 01 is converted into hexadecimal 30H and 31H.

X Set whether the encoder's count value is automatically saved when the power is turned off.

W 0: No automatic saving, reset when power is off; 1: Automatically save the encoder count value when power is off.

Response format: ! 01(cr) means the setting is successful

Application example: User command (character format) $01X0

Module response (character format) ! 01(cr) Description:

Set the encoder not to save the count value, and the count will be automatically cleared after power failure.

21. Set the pull-up switches of DI and DO

Description: Set the pull-up switches of DI and DO. The factory default value is 00 (both DI and DO turn off the pull-up function).

Command format: $AAQXY

Parameter description: AA module address, value range 00~FF (hexadecimal). The factory address is 01, converted to hexadecimal as ASCII for each character

code. For example, address 01 is converted into hexadecimal 30H and 31H.

Q Set the pull-up switch command of DI and DO.

X 0: DI turns off the pull-up voltage; 1: DI turns on the pull-up voltage. X: Keep the original settings.

Y 0: DO turns off the pull-up voltage; 1: DO turns on the pull-up voltage. X: Keep the original settings.

Response format: ! 01(cr) means the setting is successful

Application example: User command (character format) $01Q11 module response

(character format) ! 01(cr) Description: Set both DI and DO

to turn on the pull-up voltage. When DI is an NPN input, it can be set to turn on the DI pull-up voltage.

When DO needs voltage output, you can set the DO pull-up voltage to be turned on.

22. Set all parameters set by the above character command to restore to factory settings.

Description: Set the parameters set by the module using the above character command to restore to factory settings. After completion, the module will automatically restart.

Command format: $AA900(cr) Set parameters to restore factory settings.

Parameter description: AA module address, value range 00~FF (hexadecimal). The factory address is 01, converted to hexadecimal as ASCII for each character

code. For example, address 01 is converted into hexadecimal 30H and 31H.

(cr) Terminator, the carriage return key of the host computer, the hexadecimal value is 0DH.

Response format: ! AA(cr) means the setting is successful and the module will automatically restart.

Application example: User command (character format) $01900 Module response

(character format) ! 01(cr) Description: The parameters are

restored to factory settings.

Shenzhen Wayjun Technology Co., Ltd. www.wayjun.cn Tel: 0755-83356002 Page 14 of 22


Machine Translated by Google

Modbus RTU
Encoder pulse counter, angular velocity displacement measurement, module WJ66

23. Configure WJ66 module commands

Description: Set address, baud rate, checksum status for a WJ66 module. Configuration information is stored in non-volatile memory EEPROM.

Command format: %AANNTTCCFF(cr)

Parameter description: % delimiter.

AA module address, value range 00~FF (hexadecimal).

NN represents the hexadecimal address of the new module, and the value NN ranges from 00 to FF.

TT represents the type code in hexadecimal. WJ66 products must be set to 00.

CC represents the baud rate encoding in hexadecimal.

baud rate code baud rate

04 2400 baud

05 4800 baud

06 9600 baud

07 19200 baud

08 38400 baud

09 57600 baud

0A 115200 baud

Table 2 Baud rate code

FF uses 8 hexadecimal digits to represent the data format and checksum. Note that bits2 to bits5 do not have to be set to zero.

Bit7 Bit 6 Bit 5 Bit 4 Bit 3 Bit2 Bit 1 Bit 0

Table 3 Data format, checksum code

Bit7: Reserved bit, must be set to zero Bit6:

Checksum status, 0: prohibited; 1: allowed

Bit5-bit2: Not used, must be set to zero.

Bit1-bit0: data format bits. 00: Engineering Units

10: Hexadecimal twos complement (cr) terminator,

host computer’s enter key, hexadecimal is 0DH.

Response format: !AA(cr) command is valid.

The ?AA(cr) command is invalid or illegal, or the configuration jumper is not installed before changing the baud rate or checksum.

Parameter description: ! delimiter, indicating that the command is valid.

? delimiter, indicating that the command is invalid.

AA represents the input module address

(cr) Terminator, the carriage return key of the host computer, the hexadecimal value is 0DH.

Other notes: If you configure the module for the first time, AA=00, NN equals the new address. If the module is reconfigured to change the address, input range, number

According to the format, AA equals the currently configured address and NN equals the current or new address. If you want to reconfigure the module to change the baud rate

or checksum status, you must install the configuration jumper to make the module enter the default status. At this time, the module address is 00H, that is, AA=00H.

NN equals the current or new address.

If there is a format error or communication error or the address does not exist, the

module will not respond. Application example: User command %0011000600(cr)

Module response !11(cr)

Description: % delimiter.

00 means that the original address of the WJ66 module you want to configure is 00H.

11 means the hexadecimal address of the new module is 11H.

Shenzhen Wayjun Technology Co., Ltd. www.wayjun.cn Tel: 0755-83356002 Page 15 of 22


Machine Translated by Google

Modbus RTU
Encoder pulse counter, angular velocity displacement measurement, module WJ66

00 type code, WJ66 products must be set to 00.

06 means the baud rate is 9600 baud.

00 indicates that the data format is engineering units and checksums are disabled.

24. Read configuration status command

Description: Read the configuration of a specified WJ66 module.

Command format: $AA2(cr)

Parameter description: $ delimiter.

AA module address, value range 00~FF (hexadecimal).

2 represents the end character of the read

configuration status command (cr), the host computer's Enter key, and the hexadecimal value is 0DH.

Response format: !AATTCCFF(cr) command is valid.

?AA(cr) The command is invalid or illegal.

Parameter description: ! Delimiter.

AA represents the input module address.

TT stands for type encoding.

CC stands for Baud Rate Coding. See Table 2

FF See Table 3 (cr)

Terminator, host computer’s Enter key, hexadecimal is 0DH.

Other instructions: If there is a format error or communication error or the address does not exist, the module will not respond.

Application example: User command $302(cr)

Module response !300F0600(cr)

Description: ! delimiter.

30 means the WJ66 module address is 30H. 00

represents the input type code.

06 means the baud rate is 9600 baud.

00 means checksum is disabled.

Shenzhen Wayjun Technology Co., Ltd. www.wayjun.cn Tel: 0755-83356002 Page 16 of 22


Machine Translated by Google

Modbus RTU
Encoder pulse counter, angular velocity displacement measurement, module WJ66

Modbus RTU communication protocol:

The factory initial settings of the module are as follows:

Modbus address is 01

baud rate 9600 bps

How to put the module into the default state:

There is an INIT switch on the side of the WJ66 module, located on the side of the module. Turn the INIT switch to the INIT position and then turn on the power.

The block enters the default state. In this state, the module temporarily returns to the default state: address 01, baud rate 9600. When unsure about a module

During specific configuration, the user can query the address and baud rate registers 40201-40202 to obtain the actual address and baud rate of the module, or as needed

To modify the address and baud rate.

Note: During normal use, please turn the INIT switch to the NORMAL position.

Supports Modbus RTU communication protocol, and the command format follows the standard Modbus RTU communication protocol.

The function codes supported by WJ66 are as follows:

Function code Name illustrate

01 Read Coil Status reads coil status 1 means high level, 0 means low level.

03 Read Holding Register Read Holding Register Write Single 1 means high level, 0 means low level.

05 Write Single Coil Coil 1 means the transistor is on, 0 means the transistor is off.

06 Write Single Register Write a single register 1 means the transistor is on, 0 means the transistor is off.

15 Write Multiple Coils Write multiple coils

16 Write Multiple Registers Write multiple registers

Shenzhen Wayjun Technology Co., Ltd. www.wayjun.cn Tel: 0755-83356002 Page 17 of 22


Machine Translated by Google

Modbus RTU
Encoder pulse counter, angular velocity displacement measurement, module WJ66

The register address description of

WJ66 supports the register address 0X (PLC) of

function codes 01, 05 and 15. Address (PC, DCS) Data content Attribute data description

00001 0 Output switching value read/write Output status of channels 0~7

00002 1 Output switching value read/write 0 means the transistor is disconnected,

00003 2 Output switching value read/write 1 means the transistor is on

00004 3 Output switching value read/write

00005 4 Output switching value read/write

00006 5 Output switching value read/write

00007 6 Output switching value read/write

00008 7 Output switching value read/write

00009 8 Output switching value read/write Reset output status of channels 0~7

00010 9 Output switching value read/write (default value is 0)

00011 10 Output switching value read/write 0 means the transistor is disconnected after reset.

00012 11 Output switching value read/write 1 means the transistor is turned on after reset

00013 12 Output switching value read/write

00014 13 Output switching value read/write

00015 14 Output switching value read/write

00016 15 Output switching value read/write

00017 16 Channel 0 output inverted read/write Channel 0 ~ 7, (default value is 0)

00018 17 Channel 1 output inverted read/write 0 means PWM normal output,

00019 18 Channel 2 output inversion read/write 1 means PWM inversion output

00020 19 Channel 3 output inverted read/write

00021 20 Channel 4 output inverted read/write

00022 21 Channel 5 output inverted read/write

00023 22 Channel 6 output inversion read/write

00024 23 Channel 7 output inverted read/write

00033 32 A0 input switch value is read-only Level status of encoder input point

00034 33 B0 input switch value is read-only 0 means low level input,

00035 34 The switching value of A1 input is read-only 1 means high level input

00036 35 B1 input switch value is read-only

00037 36 A2 input switch value is read-only

00038 37 B2 input switch value is read-only

00039 38 A3 input switch value is read-only

00040 39 B3 input switch value is read-only

Shenzhen Wayjun Technology Co., Ltd. www.wayjun.cn Tel: 0755-83356002 Page 18 of 22


Machine Translated by Google

Modbus RTU
Encoder pulse counter, angular velocity displacement measurement, module WJ66

Supports register address 4X (PLC) address (PC,

DCS) of function codes 03, 06 and 16 data content Attribute data description

40001 0 PWM0 read/write Output channels 0~7, PWM output value,

40002 1 PWM1 read/write Integer, range 0 ~ 10000 read/write

40003 2 PWM2

40004 3 PWM3 read/write

40005 4 PWM4 read/write

40006 5 PWM5 read/write

40007 6 PWM6 read/write

40008 7 PWM7 read/write

40009 8 Channel 0~3 pulse frequency read/write Output PWM pulse frequency, (default value is 0)

40010 9 Channel 4~7 pulse frequency read/write Integer, range 0 ~ 65535 Hz. Set to 0,

indicating switch output

Set to 1~65535, indicating PWM output

40017~40018 16~17 Encoder 0 Counting read/write Encoder 0~3 Counter

40019~40020 18~19 Encoder 1 Counting read/write The data is a signed long integer in hexadecimal format.

40021~40022 20~21 Encoder 2 Counting read/write Negative numbers use two's complement,

40023~40024 22~23 Encoder 3 Counting read/write Positive number (0x00000000~0x7FFFFFFF),

Negative number (0xFFFFFFFF~0x80000001),

To clear the counter, write 0 directly to the corresponding register.

Other values can also be written as needed. If there is a report

Alarm, the alarm will be cleared automatically after modifying the count value.

40027 26 Count clear register read/write unsigned integer, default is 0

Modify this register to clear the encoder count

value. The register will automatically return to 0 after modification.

Write 10: Set the encoder 0 count value to 0,

Write 11: Set the encoder 1 count value to 0,

Write 12: Set the encoder 2 count value to 0,

Write 13: Set the encoder 3 count value to 0,

Write 14: Set all encoder count values to 0,

Writing other values has no effect and does not clear the encoder. if

If there is an alarm, the alarm will be cleared automatically after clearing the count value.

40029 28 Read/write the pulse number of encoder 0 unsigned integer (factory default is 1000), root

40030 29 Encoder 1 pulse number read/write Set according to the number of pulses per revolution of the encoder. After setting, send

40031 30 Encoder 2 pulse number reading/writing Registers 40101~40104 are the conversion of the corresponding channels.

40032 31 Encoder 3 pulse number reading/writing Fast.

40033 32 Encoder 0 working mode read/write Integer, range 0x0000-0x0005 0x0000,

40034 33 Encoder 1 working mode read/write default value, normal mode

40035 34 Encoder 2 working mode read/write 0x0001, upper limit alarm mode

40036 35 Encoder 3 working mode read/write 0x0002, lower limit alarm mode

0x0003, both upper and lower limits are in alarm mode

0x0004, backup mode, not used temporarily

0x0005, backup mode, not used temporarily

Note: In alarm mode, DO is used as a switch alarm

Alarm output, cannot be used as PWM output.

Shenzhen Wayjun Technology Co., Ltd. www.wayjun.cn Tel: 0755-83356002 Page 19 of 22


Machine Translated by Google

Modbus RTU
Encoder pulse counter, angular velocity displacement measurement, module WJ66

Address 4X (PLC) Address (PC, DCS) Data content Attribute data description

40041~40042 40~41 Encoder 0 upper limit value read/write Encoder 0~3 upper limit alarm value and lower limit alarm value,

40043~40044 42~43 Encoder 1 upper limit value read/write The default value is 0.

40045~40046 44~45 Encoder 2 upper limit value read/write The data is a signed long integer in hexadecimal format.

40047~40048 46~47 Encoder 3 upper limit value read/write Negative numbers use two's complement,

40049~40050 48~49 Encoder 0 lower limit value read/write Positive number (0x00000000~0x7FFFFFFF),

40051~40052 50~51 Encoder 1 lower limit value read/write Negative number (0xFFFFFFFF~0x80000001),

40053~40054 52~53 Encoder 2 lower limit value read/write

40055~40056 54~55 Encoder 3 lower limit value read/write

40057 56 Encoder 0 upper limit time read/write Unsigned integer, range 0x0000-0xFFFF alarm

40058 57 Encoder 1 upper limit time read/write time, default value is 0, indicating alarm signal

40059 58 Encoder 2 upper limit time read/write Both the host computer and the counter need to modify the counter pointer.

40060 59 Encoder 3 upper limit time read/write Order to clear. If it is another value, multiply by 0.01

40061 60 Encoder 0 lower limit time read/write Seconds later is the actual duration of the alarm time. arrival report

40062 61 Encoder 1 lower limit time read/write After the alarm time, the alarm signal will be automatically cleared and the code

40063 62 The count value of the device will also be automatically cleared.
Encoder 2 lower limit time read/write

40064 63 Encoder 3 lower limit time read/write

40065 64 PWM0 reset output value read/write Channel 0~7 PWM reset output value,

40066 65 PWM1 reset output value read/write (Default value is 5000)

40067 66 PWM2 reset output value read/write Integer, range 0 ~ 10000

40068 67 PWM3 reset output value read/write

40069 68 PWM4 reset output value read/write

40070 69 PWM5 reset output value read/write

40071 70 PWM6 reset output value read/write

40072 71 PWM7 reset output value read/write

40073 72 Channel 0~3 frequency reset value read/write Pulse frequency reset output value, (default value is 0)

40074 73 Channel 4~7 frequency reset value read/write Integer, range 0 ~ 65535 Hz. Set to 0,

indicating switch output

Set to 1~65535, indicating PWM output

40081 80 The encoder count value is automatically maintained Read/write 0: No automatic saving, reset when power off;

live 1: Automatically save the encoder count value when power is off. (default

value is 1)

40082 81 DI's pull-up switch reads/writes 0: DI turns off the pull-up voltage; (default value is 0)

1: DI turns on the pull-up voltage.

40083 82 DO's pull-up switch reads/writes 0: DO turns off the pull-up voltage; (default value is 0)

1: DO turns on the pull-up voltage.

40089 88 The parameters are restored to factory settings and the read/write setting is FF00, then the parameters of all registers of the module

Restore to factory settings, the module will automatically restart after completion

40101 100 The speed of encoder 0 is read-only Signed integers, positive and negative represent positive and negative inversions.

40102 101 The speed of encoder 1 is read-only The speed is set according to registers 40029~40032

40103 102 Encoder 2 speed read-only It is obtained by converting the number of pulses.

40104 103 The speed of encoder 3 is read-only

Shenzhen Wayjun Technology Co., Ltd. www.wayjun.cn Tel: 0755-83356002 Page 20 of 22


Machine Translated by Google

Modbus RTU
Encoder pulse counter, angular velocity displacement measurement, module WJ66

Address 4X (PLC) Address (PC, DCS) Data content Attribute data description

40129~40130 128~129 Encoder 0 frequency read only 32-bit floating point number, the collected frequency.

40131~40132 130~131 Encoder 1 frequency read only The storage order is CDAB.

40133~40134 132~133 Encoder 2 frequency read only

40135~40136 134~135 Encoder 3 frequency read only

40201 200 Module Read/write integer, effective after restart, range 0x0000-0x00FF

40202 201 address baud rate Read/write integer, effective after restart, range 0x0004-0x000A

0x0004 = 2400 bpsÿ

0x0005 = 4800 bps 0x0006

= 9600 bpsÿ

0x0007 = 19200 bps 0x0008

= 38400 bpsÿ

0x0009 = 57600 bps 0x000A

= 115200bps Read only high

40211 210 Module name bit: 0x00 low bit: 0x66

table 5 Modbus Rtu register description

Communication example 1: If the module address is 01, send it in hexadecimal: 010300000001840A to obtain the register data.

01 03 00 00 00 01 84 0A

Module address read holding register register address high register address low register number high register number low CRC check low CRC check high

If the module replies: 0103020333F8A1 , the read data is 0x0333, which is converted to decimal 819, which means the current PWM output of channel 0

is 8.19%.

01 03 02 03 33 F8 A1

Module address read holding register data byte number data high bit data low bit CRC check low bit CRC check high bit

Communication example 2: If the module address is 01, send it in hexadecimal: 010300100002C5CE to obtain the register data.

01 03 00 10 00 02 C5 THIS

Module address read holding register register address high register address low register number high register number low CRC check low CRC check high

If the module replies: 010304CA90FFFFC476 , the read data is 0XFFFFCA90, which is -13680 in decimal, which means the current encoding

The count value of device 0 is -13680.

01 03 04 THAT 90 FF FF C4 76

Module address read holding register data byte number data 1 high-bit data 1 low-bit data 2 high-bit data 2 low-bit CRC check low-bit CRC check high-bit

Communication example 3: If the module address is 01, send it in hexadecimal: 0106001A000A280A , which means clearing the count value of encoder 0.

01 06 00 1A 00 0A 28 0A

Module address write single holding register register address high register address low data high data low CRC check low CRC check high

If the module replies: 0106001A000A280A, it means the setting is successful. The count value of encoder 0 is modified to 0. If there is an alarm, it will be automatically cleared.

01 06 00 1A 00 0A 28 0A

Module address write single holding register register address high register address low data high data low CRC check low CRC check high

Shenzhen Wayjun Technology Co., Ltd. www.wayjun.cn Tel: 0755-83356002 Page 21 of 22


Machine Translated by Google

Modbus RTU
Encoder pulse counter, angular velocity displacement measurement, module WJ66

Overall dimensions: (Unit: mm)

Can be installed on standard DIN35 rails

Warranty:

Within two years from the date of sale of this product, if the user complies with the storage, transportation and use requirements, and the product quality is lower than the technical specifications, it can be returned to the factory for free.

Free maintenance. If damage is caused due to violation of operating regulations and requirements, device fees and maintenance fees will need to be paid.

copyright:

Copyright © 2021 Shenzhen Weijunrui Technology Co., Ltd.

No part of this manual may be copied, distributed, translated or transmitted without permission. This manual is subject to modification and update without prior notice.

trademark:

Other trademarks and copyrights mentioned in this manual belong to their respective owners.

Version number:

V1.1 Date: March 2022

Shenzhen Wayjun Technology Co., Ltd. www.wayjun.cn Tel: 0755-83356002 Page 22 of 22

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy