background image

8

47D Series Modbus Reference Guide  EM-9501-C Rev.4

2.4.3  CRC CALCULATION ALGORITHM

The following shows Visual Basic 6.0 sources to calculate the CRC16.

Function CRC16(Message() As Byte, Size As Integer) As Integer
 

Dim I As Integer, N As Integer, CarryBit As Boolean

 

CRC16 = &HFFFF

 

For I = 0 To Size - 1

 

 

CRC16 = (CRC16 And &HFF00) Or ((CRC16 And 255) Xor Message(I))

 

 

For N = 1 To 8

 

 

 

CarryBit = CRC16 And 1

 

 

 

CRC16 = ((CRC16 And &HFFFE) \ 2) And &H7FFF

 

 

 

If CarryBit Then CRC16 = &HA001 Xor CRC16

  Next
 Next
End Function

START

0xFFFF 

 CRC16

END

CRC16 XOR BYTE 

 CRC16

 N

Shift CRC16 by 1 LSB

Carry Over

N + 1 

 N

YES

NO

NO

YES

YES

N ≥ 8

End of Message

CRC16 XOR 0xA001 

 CRC16

Figures starting with 0x are hexadecimal.

NO

Following BYTE

Содержание 47D Series

Страница 1: ...BUS REGISTERS 9 3 1 DEVICE INFORMATION 9 3 2 I O DATA 10 3 3 DEVICE CONTROL 11 3 4 LOCKOUT SETTING 11 3 5 INPUT SETTING 12 3 5 1 COMMON SETTING 12 3 5 2 FORCED ZERO TARE ADJUSTMENT V M AC 12 3 5 3 DC...

Страница 2: ...ymbols are as signed to Other descriptions with no specific symbol are applied to all 47D Series models Model No Function Symbol 47DV DC voltage input VV DC current input VA DC voltage current input V...

Страница 3: ...table via the control buttons at the front of the device It is also possible to change these settings via Modbus communication COMM PROPERTY SELECTION Modbus address 1 to 247 Factory setting 1 Baud ra...

Страница 4: ...for all devices connected via the RS 232C RS 485 Converter Parity bit Identical setting for all devices connected via the RS 232C RS 485 Converter Stop bit Identical setting for all devices connected...

Страница 5: ...ng Surge Protector for RS 485 422 model MD74R or MDP 4R 1 1 Insert lightning surge protectors recommended in this example if necessary Max Min FZ TZ NG Zro Spn TG Hld Tch HH H P L LL Max Min FZ TZ NG...

Страница 6: ...function code is used to read the contents of a contiguous block of holding registers measured values and set tings in the remote device REQUEST FORMAT FIELD LENGTH RANGE 1 Device address 1 byte 1 to...

Страница 7: ...123 5 Byte count 1 byte N x 2 N Number of registers 6 Register value N x 2 bytes 7 CRC 2 bytes RESPONSE FORMAT FIELD LENGTH RANGE 1 Device address 1 byte 1 to 247 2 Function code 1 byte 16 3 Starting...

Страница 8: ...CarryBit As Boolean CRC16 HFFFF For I 0 To Size 1 CRC16 CRC16 And HFF00 Or CRC16 And 255 Xor Message I For N 1 To 8 CarryBit CRC16 And 1 CRC16 CRC16 And HFFFE 2 And H7FFF If CarryBit Then CRC16 HA001...

Страница 9: ...e 0 2nd character 1st character 1 4th character 3rd character 2 6th character 5th character 3 8th character 7th character 4 10th character 9th character 5 12th character 11th character 6 14th characte...

Страница 10: ...Under scale Burnout Burnout Loop Test Loop Test mode Analog Analog output provided 3 2 Measured value 1 2 5 2 Measured value MAX 1 2 7 2 Measured value MIN 1 2 9 2 Reserved 11 2 Reserved 13 2 Reserve...

Страница 11: ...d at the last value and status before it has been turned 1 With 0 these outputs respond to the input signal 902 1 Alarm setting lockout 0 Completely unlock alarm settings 1 Partially unlock alarm sett...

Страница 12: ...s 1003 1 High pass filter 0 High pass filter OFF 1 High pass filter ON 1011 1 Low end cutout 0 Low end cutout OFF 1 Low end cutout ON 2 Low end cutout by absolute value 1012 1 Low end cutout value 0 9...

Страница 13: ...e Span Refer to Input scaling value Zero for selectable ranges Factory setting VV 50000 VA 20000 1057 2 Display scaling value Zero 20000 100000 Factory setting VV 10000 VA 04000 1059 2 Display scaling...

Страница 14: ...setting 0 F 100 5 Input compensation is not executed when the A and B values are equal 3 5 6 THERMOCOUPLE INPUT T ADDR WORD CONTENTS UNIT 1051 1 Input type 0 PR 1 K CA 1 2 K CA 2 3 E CRC 4 J IC 1 5 J...

Страница 15: ...20000 V 100 ACA 0 to 0 2mA 000000 to 002000 mA 1000 0 to 2mA 000000 to 002000 mA 1000 0 to 20mA 000000 to 020000 mA 1000 0 to 200mA 000000 to 020000 mA 100 Factory setting 000000 000000 1055 2 Input s...

Страница 16: ...UT SETTING ADDR WORD CONTENTS UNIT 3001 1 Analog output type 0 0 to 5V 1 5 to 5V 2 10 to 10V 3 0 to 20mA 4 4 to 20mA 3002 1 Analog output function mode 0 Proportional to the display value 1 Proportion...

Страница 17: ...t latched Measuring continued 2 Output and measuring latched 4006 1 Standby sequence 0 Output standing by until the input signal comes into P zone after the power is turned on 1 Output is immediately...

Страница 18: ...1 Enable 4109 2 Bank 1 H setpoint 20000 100000 V M AC V M AC Decimal point position setting 99999 999999 T R T R C 100 or F 100 Factory setting VV 38000 VA 15200 T 7000 R 7000 M 4000 AC 14000 14000 4...

Страница 19: ...H alarm trip action Identical to LL setting 4201 4206 4226 4231 6 HH alarm trip action Identical to LL setting 4201 4206 4236 4243 1 P ON delay time seconds 10 0 999 Factory setting 0 4244 1 P OFF del...

Страница 20: ...value 6006 1 Backlight brightness 1 dark 3 bright Factory setting 2 6007 1 LCD Contrast 1 low 10 high Factory setting 5 3 11 MODBUS SETTING Modbus setting is enabled only after the device has been res...

Страница 21: ...low M System will at its sole option and expense either 1 repair the defective product 2 replace the defective product or 3 refund the purchase price for the defective product paid by the purchaser Ex...

Отзывы: