
178
Command code: 06h, write data
For example, to write
“100”
(
0064h
)
into the drive which device number 1 and start address 0200h.
Command(host)
:
Response(slave)
:
ADR
01h
ADR
01h
CMD
06h
CMD
06h
DA
T
A
start address
02h
DA
T
A
start address
02h
00h
00h
written data
00h
written data
00h
64h
64h
CRC_L
89h
CRC_L
89h
CRC_H
99h
CRC_H
99h
CRC calculation
:
RTU mode uses CRC (Cyclical Redundancy Check) to detect errors.
CRC method to decide the check value is described below.
Step 1: Load a 16-bit register (called CRC register) with FFFFh.
Step 2: Exclusive OR the first 8-bit byte of the command message with the lower byte of CRC register,
putting the result in the CRC registers.
Step 3: Check the LSB of CRC register. If it is 0, shift the CRC register one bit to the right. If it is 1, shift
the CRC register one bit to the right then Exclusive OR the CRC register with A001h.
Step 4: Repeat step 3 until eight shifts have been performed. When this is done, a complete 8-
bit byte will have been processed, then perform step 5.
Step 5: Repeat step 2 to step 4 for the next 8-bit byte of the command message.
Continue doing this until all bytes have been processed. The final contents of the CRC register
are the CRC value. It should be noticed that the low-byte should be transmitted before
high-byte.
For example, reading 2 words from address 0101h of the drive with address 01H. The final content of
the CRC register from ADR to last data character is 3794H, and then the command message is shown
as follows. What should be noticed is that 94H have to be transmitted before 37H.
ADR
01h
CMD
03h
DA
T
A
start address
01h
01h
written data
00h
02h
CRC_L
94h
CRC_H
37h
Summary of Contents for SDE Series
Page 13: ...5 1 6 Function block diagram ...
Page 26: ...18 3 3 3 CN1 pin name list ...
Page 223: ...215 SME L040 SME L075 SME L100 SME L150 ...
Page 224: ...216 SME L200 SME L300 SME M100 SME M150 Continuous running range ...
Page 227: ...219 ...
Page 231: ...223 4 Wiring example with peripheral equipment CN2 Encoder socket ...
Page 242: ...234 12 4 Version information Version V1 01 Issue date Aug 2017 Proofreader Yaochou Shu ...