26.02.2015 Views

User Manual - CNC4PC

User Manual - CNC4PC

User Manual - CNC4PC

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

RTU Mode<br />

Query PC Servo Response Servo PC (OK) Servo PC (ERROR)<br />

ADR 01H ADR 01H ADR 01H<br />

Function Code 10H Function Code 10H Function Code 90H<br />

Register<br />

ADD<br />

(HI) 01H Register (HI) 01H<br />

(Lo)<br />

Data length<br />

(word)<br />

00H<br />

ADD<br />

Exception<br />

code<br />

02H<br />

(Lo) 00H CRC(Lo) CDH<br />

00H Data length 00H CRC(Hi) C1H<br />

02H<br />

(word)<br />

02H<br />

Byte counters 04H CRC(Lo) 40H<br />

Data<br />

(HI) 00H CRC(Hi) 34H<br />

0100H (Lo) 64H<br />

Data<br />

(HI)<br />

01H<br />

0101H (Lo) 2CH<br />

CRC(Lo)<br />

CRC(Hi)<br />

BFH<br />

ADH<br />

LRC (ASCII Mode ) and CRC (RTU Mode) Check methods<br />

LRC Checking:<br />

ASCII Mode LRC (Longitudinal Redundancy Check) checking method<br />

The LRC is calculated by adding together successive 8–bit bytes of the message, discarding any carries.<br />

Ex. add ADR, Function code, register address and data contents together, if it get the sum 19DH then discard<br />

carrier ”1” and find two’s complement for 9DH to obtain LRC code.<br />

Ex: Execute diagnostic function for Servo drive ID =01H<br />

STX ‘ : ’ ‘ A ’<br />

‘ 0 ’ ‘ 5 ’<br />

ADR<br />

Data (word)<br />

‘ 1 ’ ‘ 3 ’<br />

‘ 0 ’<br />

‘ 7 ’<br />

Function code<br />

‘ 8 ’ ‘ 1 ’<br />

LRC<br />

‘ 0 ’<br />

‘ B ’<br />

(HI)<br />

‘ 0 ’ END1 (CR) (0DH)<br />

Sub-function<br />

‘ 0 ’ END0 (LF) (0AH)<br />

(Lo)<br />

‘ 0 ’<br />

01H+08H+00H+00H+A5H+37H = E5H<br />

Two’s complement for E5H is 1BH ; derive LRC code: ‘ 1 ’ , ‘ B ’<br />

7-12

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!