EasyManuals Logo

YASKAWA G7 User Manual

YASKAWA G7
92 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #30 background imageLoading...
Page #30 background image
30
CRC-16 Calculation
The last two bytes of a message contain the CRC-16 (Cyclical Redundancy Check). The CRC-16 is one method for verifying the validity of the
message contents and is part of the protocol. The CRC-16 field checks the contents of the entire message, regardless of any parity check method
used for the individual characters of the message.
The CRC-16 field is a 16-bit binary value consisting of two 8-bit bytes. The CRC-16 value is calculated by the transmitting device, which
appends the CRC-16 to the message. The receiving device recalculates a CRC-16 during receipt of the message, and compares this calculated
value to the value received in the transmitted CRC-16 field. If the two values are not equal, the entire message is invalid.
Detailed examples of a CRC-16 generation using Quick Basic and C are shown below.
CRC-16 Calculation Example in Basic
crcsum# = &HFFFF&
crcshift# = &H0&
crcconst# = &HA001&
CLS
PRINT “***************************************************”
PRINT
PRINT “ CRC-16 calculator”
PRINT
PRINT “***************************************************”
PRINT “If entering data in hex, preceed the data with &H’”
PRINT “ Example: 32decimal = 20hex = &H20”
PRINT “***************************************************”
PRINT
INPUT “Enter the number of bytes in the message: “, maxbyte
FOR bytenum = 1 TO maxbyte STEP 1
PRINT “Enter byte ; bytenum; “:”:
INPUT byte&
byte& = byte& AND &HFF&
crcsum# = (crcsum# XOR byte&) AND &HFFFF&
FOR shift = 1 TO 8 STEP 1
crcshift# = (INT(crcsum# / 2)) AND &H7FFF&
IF crcsum# AND &H1& THEN
crcsum# = crcshift# XOR crcconst#
ELSE
crcsum# = crcshift#
END IF
NEXT shift
NEXT bytenum
lower& = crcsum# AND &HFF&
upper& = (INT(crcsum# / 256)) AND &HFF&
PRINT “Lower byte (1
st
) = “, HEX$(lower&)
PRINT “Upper byte (2
nd
) = “, HEX$(upper&)

Other manuals for YASKAWA G7

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the YASKAWA G7 and is the answer not in the manual?

YASKAWA G7 Specifications

General IconGeneral
TypeDC Drive
Enclosure RatingIP20
Overload Capacity150% for 60 seconds
Protection FunctionsOvercurrent, Overvoltage, Undervoltage, Overtemperature, Short Circuit
Communication InterfaceRS-485
Humidity5 to 95% (non-condensing)
Storage Temperature-20°C to 60°C (-4°F to 140°F)

Related product manuals