当前位置:文档之家› 台湾艾德克斯IT8500帧格式通讯协议

台湾艾德克斯IT8500帧格式通讯协议

IT8500 Series Frame Format

Programmable DC Power Supply

Models IT8500

? Copyright 2005 All Rights Reserved Ver1.1/MAR, 2008/8500-401

Directory

Warranty Information (3)

Safety Summary (3)

Chapter 1 Remote Operation Mode (5)

1.1 IT-E131 RS232 Communication cable (5)

1.2 IT-E132 USB Communication cable (5)

Chapter 2 Communication Order for IT8500 (6)

Frame Format (6)

Communication Protocol (8)

Warranty Information

Certification

We certify that this product met its published specifications at time of shipment from the factory.

Warranty

This hardware product is warranted against defects in material and workmanship for a period of ONE year from date of delivery. IT8500 series electronic load for use with a hardware product and when properly installed on that hardware product, are warranted not to fail to execute their programming instructions due to defects in material and workmanship for a period of 90 days from date of delivery. During the warranty period our company will either repair or replace products which prove to be defective. Our company does not warranty that the operation for the software firmware or hardware shall be uninterrupted or error free.

For warranty service, with the exception of warranty options, this product must be returned to a service facility designated by our company. Customer shall prepay shipping charges by (and shall pay all duty and taxes) for products returned to our place for warranty service. Our company shall pay for return of products to Customer.

Limitation of Warranty

The foregoing warranty shall not apply to defects resulting from improper or inadequate maintenance by the Customer, Customer-supplied software or interfacing, unauthorized modification or misuse, operation outside of the environmental specifications for the product, or improper site preparation and maintenance.

Assistance

The above statements apply only to the standard product warranty. Warranty options product maintenance agreements and customer assistance agreements are also available.

Safety Summary

The following general safety precautions must be observed during all phases of operation of this instrument. Failure to comply with these precautions or with specific warnings elsewhere in this manual violates safety standards of design, manufacture, and intended use of the instrument .We assumes no liability for the customer’s failure to comply with these requirements.

Environmental Conditions

This instrument is intended for indoor use. Pollution degree 2 environments. It is designed to operate at a maximum relative humidity of 95% and at altitudes of up to 2000 meters. Refer to the specifications tables for the ac mains voltage requirements and ambient operating temperature range.

Before Applying Power

Verify that all safety precautions are taken. Note the instrument's external markings described under "Safety Symbols".

Ground the Instrument

This product is a Safety Class 1 instrument (provided with a protective earth terminal). To minimize shock hazard, the instrument chassis and cover must be connected to an electrical ground. The instrument must be connected to the ac power mains through a grounded power cable, with the ground wire firmly connected to an electrical ground (safety ground) at the power outlet. Note: Any interruption of the protective (grounding) conductor or disconnection of the protective earth terminal will cause a potential shock hazard that could result in personal injury.

DO NOT OPERATE IN AN EXPLOSIVE ATMOSPHERE

Do not operate the instrument in the presence of fumes or flammable gases.

KEEP AWAY FROM LIVE CIRCUITS

Operating personnel must not remove instrument covers except as instructed in this Guide for installing or removing electronic load modules. Component replacement and internal adjustments must be made only by qualified service personnel. Do not replace components with power cable connected. Under certain conditions dangerous voltages may exist even with the power cable removed. To avoid injuries always disconnect power, discharge circuits, and remove external voltage sources before touching components.

DO NOT SERVICE OR ADJUST ALONE

Do not try to do some internal service or adjustment unless another person capable of rendering first aid resuscitation is present.

Safety Symbols

Direct current

Alternating current

Both direct and alternating current

Protective earth (ground) terminal

Caution (refer to accompanying documents)

WARNING

The WARNING sign denotes a hazard. It calls attention to a procedure, practice, or the like, which, if not correctly performed or adhered to, could result in personal injury. Do not proceed beyond a WARNING sign until the indicated conditions are fully understood and met.

CAUTION

The CAUTION sign denotes a hazard. It calls attention to an operating procedure, or the like, which, if not correctly performed or adhered to, could result in damage to or destruction of part or all of the

Chapter 1 Remote Operation Mode

DB9 in the rear panel of electronic load could connect with RS-232 through on TTL connector. The following information may help you to know how to control the output of electronic load through PC.

1.1 IT-E131 RS232 Communication cable

The DB9 interface connector on the rear panel of electronic load is TTL voltage level; you can use the communication cable (IT-E131) to connect the DB9 interface connector of the electronic load and the RS-232 interface connector of computer for the communication.

PC

Load

cable

COMPUTER

I N S T R U M E N T

RX TX

IT-E131 ISOLATED

COMMUNICATION CABLE

TTL(5V)

RS232

ISOLATION

859666668889942311IT

1.2 IT-E132 USB Communication cable

The DB9 interface connector on the rear panel of electronic load is TTL voltage level; you can use the communication cable (IT-E132) to connect the DB9 interface connector of the electronic load and the USB interface connector of computer for the communication.

PC

Load

cable

COMPUTER

I N S T R U M E N T

RX TX

IT-E131 ISOLATED

COMMUNICATION CABLE

TTL(5V)

RS232

ISOLATION

859666668889942311IT

Chapter 2 Communication Order for IT8500 Frame Format

Frame length is 26 bytes. Details as following:

AAH Address Command 4—25bytes are information content Parity code Description :

1. Start bit is AAH,occupies one byte.

2.Address range from 0 to FE, occupies one byte.

3.Each command occupies one byte. Following is the command details.

20H Selecting the Remote control mode

21H Selecting the input on/off state

22H Setting the max input voltage

23H Reading the max setup input voltage.

24H Setting max input current

25H Reading the max setup input current.

26H Setting max input power.

27H Reading the max setup input power.

28H Selecting CC/CV/CW/CR operation mode of electronic load.

29H Reading the operation mode.

2AH Setting CC mode current value

2BH Reading CC mode current value

2CH Setting CV mode voltage value

2DH Reading CV mode voltage value

2EH Setting CW mode watt value

2FH Reading CW mode watt value

30H Setting CR mode resistance value

31H Reading CR mode resistance value

32H Setting CC mode transient current and timer parameter.

33H Reading CC mode transient parameter

34H Setting CV mode transient voltage and timer parameter.

35H Reading CV mode transient parameter

36H Setting CW mode transient watt and timer parameter

37H Reading CW mode transient parameter

38H Setting CR mode transient resistance and timer parameter

39H Reading CR mode transient parameter

3AH Selecting the list operation mode (CC/CV/CW/CR)

3BH Reading the list operation mode.

3CH Setting the list repeat mode (ONCE / REPEAT)

3DH Reading the list repeat mode.

3EH Setting the number of list steps.

3FH Reading the number of list steps

40H Setting one of the step’s current and time values.

41H Reading one of the step’s current and time values.

42H Setting one of the step’s voltage and time values.

43H Reading one of the step’s voltage and time values

44H Setting one of the step’s power and time values

45H Setting one of the step’s power and time values.

46H Setting one of the step’s resistance and time values

47H Reading one of the step’s resistance and time values

48H Setting list file name.

49H Reading list file name.

4AH Selection the memory space mode for storing list steps.

4BH Reading the memory space mode for storing list steps.

4CH Save list file in appointed area.

4DH Get the list file from the appointed area.

4EH Setting min voltage value in battery testing mode.

4FH Reading min voltage value in battery testing mode

50H Setting timer value of FOR LOAD ON

51H Reading timer value of FOR LOAD ON

52H Disable/Enable timer of FOR LOAD ON

53H Reading timer state of FOR LOAD ON

54H Setting communication address

55H Enable/Disable LOCAL control mode.

56H Enable/Disable remote sense mode.

57H Reading the state of remote sense mode.

58H Selecting trigger source.

59H Reading trigger source.

5AH Sending a trigger signal to trigging the electronic load.

5BH Saving user’s setting value in appointed memory area for recall. 5CH Recall user’s setting value in appointed memory area.

FIXED/SHORT/TRAN/LIST/BATTERY function mode. 5DH Selecting

function mode state.

5EH Getting

5FH Reading input voltage, current, power and relative state

60H Enter the calibration mode

61H Getting the calibration mode state.

62H Calibrate voltage value.

63H Sending the actual input voltage to calibration program.

64H Calibrate current value.

65H Sending the actual input current to calibration program.

66H Store the calibration data to EEPROM.

67H Setting calibration information.

68H Reading calibration information.

69H Restore the factory default calibration data.

6AH Reading product’s model, series number and version information.

6CH Setting information of bar code

12H The return information of command operation in electronic load.

2. Selecting the input on/off state (21H)

1st byte Start bit ( AAH )

2nd byte Address(0—0XFE)

3rd byte Command(21H)

4th byte Input state(0 is OFF,1is ON)

From 5th to 25th byte System reserve

From26th byte Sum code

3. Setting / Reading max input voltage(22H/23H)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command(22H/23H)

4th byte The Lowest byte of max voltage value

5th byte The lower byte of max voltage value.

6th byte The higher byte of max voltage value.

From 8th to 25th byte System reserve. 26th byte Sum code.

6. Selecting / Reading CC/CV/CW/CR operation mode of electronic load.(28H/29H)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command(28H/29H)

4th byte Mode(0 is CC mode, 1 is CV mode , 2 is CW mode , 3 is CR mode )From 5th to 25th byte System reserve

26th byte Sum code

7. Setting / Reading CC mode current value(2AH/2BH)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command (2AH/2BH)

4th byte The lowest byte of current value

5th byte The lower byte of current value.

6th byte The higher byte of current value.

7th byte The highest byte of current value.

From 8th To 25th byte System reserve

27th byte Sum code

9. Setting / Reading CW mode watt value(2EH/2FH)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command(2EH/2FH)

4th byte The lowest byte of max power value

5th byte The lower byte of max power value

6th byte The higher byte of max power value

7th byte The highest byte of max power value

8th to 25th byte System reserve

26th byte Sum code

11. Setting /Reading CC mode transient current and timer parameter. (32H/33H)1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command(32H/33H)

From 4th byte to 7th byte Setting value of current A (Lower bytes are in the front location, higher bytes

are in the later location.)

From 8th byte to 9th byte. Time value of timer A ((Lower bytes are in the front location, higher bytes are in

the later location) (1 represent 0.1mS)

From 10th to 13th byte Setting value of current B (Lower bytes are in the front location, higher bytes

are in the later location)

the later location) (1 represent 0.1mS)

16th byte Transition operation mode (0 is CONTINUES, 1 is PULSE, 2 is TOGGLED) From 17th to 25th byte System reserve

26th byte Sum code

12. Setting /Reading CV mode transient voltage and timer parameter.(34H/35H)1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command(34H/35H)

From 4th to 7th byte. Setting value of voltage A (Lower bytes are in the front location, higher bytes

are in the later location)

From 8th to 9th byte. Time value of timer A (Lower bytes are in the front location, higher bytes are in

the later location) (1represent 0.1mS)

From 10th to 13th byte Setting value of voltage B(Lower bytes are in the front location, higher bytes are

in the later location)

From 14th to 15th byte Time value of timer B (Lower bytes are in the front location, higher bytes are in

the later location) (1represent 0.1mS)

16th byte Transient operation mode (0 is CONTINUES,1 is PULSE,2 is TOGGLED) From 17th to 25th byte System reserve

26th byte Sum code

13. Setting /Reading CW mode transient watt and timer parameter(36H/37H)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command(36H/37H)

From 4th to 7th byte Setting value of power A (Lower bytes are in the front location, higher bytes are

in the later location)

From 8th to 9th byte Time value of timer A (Lower bytes are in the front location, higher bytes are in

the later location) (1 represent 0.1mS)

From 10th to 13th byte Setting value of power B(Lower bytes are in the front location, higher bytes are

in the later location)

From 14th to 15th byte Time value of timer B (Lower bytes are in the front location, higher bytes are in

the later location) (1 represent 0.1mS)

16th byte Transition operation mode (0 is CONTINUES,1is PULSE,2 is TOGGLED) From 17th to 25th byte System reserve

26th byte Sum code

14. Setting /Reading CR mode transient resistance and timer parameter

(38H/39H)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command(38H/39H)

are in the later location)

From 8th byte to 9th byte. Time value of timer A (Lower bytes are in the front location, higher bytes are in

the later location) (1 represent 0.1mS)

From 10th byte to 13th byte Setting value of resistance B (Lower bytes are in the front location, higher bytes

are in the later location)

From 14th byte to 15th byte Time value of timer B (Lower bytes are in the front location, higher bytes are in

the later location) (1 represent 0.1mS)

16th byte Transition operation mode (0 is CONTINUES,1 is PULSE,2 is TOGGLED)

17th byte to 25th byte System reserve

26th byte Sum code

15.Selecting /Reading the list operation mode (CC/CV/CW/CR)(3AH/3BH)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command(3AH/3BH)

4th byte LIST operation mode(0is CC mode,1 is CV mode ,2 is CW mode,3 is CR mode)From 5th to 25 byte System reserve

26th byte Sum code

16. Setting /Reading the list repeat mode. (3CH/3DH)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command(3CH/3DH)

4th byte LIST repeat operation mode(0 is ONCE, 1 is REPEAT)

From 5th to 25th byte System reserve

26th byte Sum code

17. Setting / Reading the number of list steps. (3EH/3FH)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command(3EH/3FH)

From 4th to 5th byte LIST steps

From 6th to 25th byte System reserve

26th byte Sum code

18. Setting / Reading one of the step’s current and time values. (40H/41H)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command(40H/41H)

From 4th byte to 5th byte Appointed one step

From 6th to 9th byte Current value of current step (Lower bytes are in the front location, higher bytes

are in the later location)

in the later location) (1 represent 0.1mS)

From 12th to 25th byte System reserve

26th byte Sum code

19. Setting / Reading one of the step’s voltage and time values. (42H/43H)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command(42H/43H)

From 4th to 5th byte Appointed one step

From 6th byte to 9th byte Voltage value of current step (Lower bytes are in the front location, higher bytes

are in the later location)

From 10th to 11th byte Time value of current step (Lower bytes are in the front location, higher bytes are in the later location) (1 represent 0.1mS)

From 12th to 25th byte System reserve

26th byte Sum code

20. Setting / Reading one of the step’s power and time values. (44H/45H)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command(44H/45H)

4th byte Appointed one step

From 5th to 8th byte Power value of current step (Lower bytes are in the front location, higher bytes

are in the later location)

From 9th to 10th byte Time value of current step (Lower bytes are in the front location, higher bytes are in the later location) (1 represent 0.1mS)

From 11th to 25th byte System reserve

26th byte Sum code

21. Setting / Reading one of the step’s power and time values. (46H/47H)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command (46H/47H)

From 4th to 5th byte Appointed one step

From 6th to 9th byte Resistance value of current step (Lower bytes are in the front location, higher

bytes are in the later location)

From 10th to 11th byte Time value of current step (Lower bytes are in the front location, higher bytes are in the later location) (1 represent 0.1mS)

From 12th to 25th byte System reserve

26th byte Sum code

22. Setting / Reading List file name (48H/49H)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command (48H/49H)

From 4th to 13th byte LIST file name (ASSIC code )

From 14th to 25th byte System reserve

26th byte Sum code

23. Selection / Reading the memory space mode for storing list steps. (4AH/4BH) 1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command(4AH/4BH)

4th byte partition mode (1 | 2 | 4 | 8)

From 5th to 25th byte System reserve

26th byte Sum code

24. Save / Get list file in appointed area.. (4CH/4DH)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command(4CH/4DH)

4th byte Storing area 1 ~ 8)

From 5th to 25th byte System reserve

26th byte Sum code

25. Setting / Reading min voltage value in battery testing mode.(4EH/4FH)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command(4EH/4FH)

4th byte The lowest byte of voltage value.

5th byte The lower byte of voltage value.

6th byte The higher byte of voltage value.

7th byte The highest byte of voltage value.

From 8th to 25th byte System reserve

26th byte Sum code

26. Setting / Reading timer value of FOR LOAD ON (50H/51H)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command(50H/51H)

4th byte The lowest byte of time value in timer. (1 represent 1S)

5th byte The highest byte of time value in timer.

From 8th to 25th byte System reserve

26th byte Sum code

Time unit in Timer is S, 1S is represented by 1.

27. Disable / Enable timer of FOR LOAD ON (52H);

Reading timer state of FOR LOAD ON (53H)

st

2nd byte Address (0—0XFE)

3rd byte Command(52H/53H)

4th byte Timer state (0 is disable ,1 is enable )

From 5th to 25th byte System reserve

26th byte Sum code

28. Setting communication address (54H)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command (54H)

4th byte New communication address (0~0XFE)

From 5th to 25th byte System reserve

26th byte Sum code

29. Enable/Disable LOCAL control mode. (55H)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command (55H)

4th byte State of LOCAL button(0:disable,1:enable “)

From 5th to 25th byte System reserve

26th byte Sum code

30. Enable / Disable remote sense mode. (56H)

Reading the state of remote sense mode. (57H)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command(56H/57H)

4th byte Remote mode state (0:disable,1:enable)

5th to 25th byte System reserve

26th byte Sum code

31. Selecting / Reading trigger source. (58H/59H)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command (58H/59H)

4th byte Trigger mode (0:Keypad,1 External,https://www.doczj.com/doc/247987881.html,mand)

From 5th to 25th byte System reserve

26th byte Sum code

32. Sending a trigger signal to trigging the electronic load. (5AH) 1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command(5AH)

From 4th to 25th byte System reserve

26th byte Sum code

33. Saving / Recall user’s setting value in appointed memory area for recall.

(5BH/5CH)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command(5BH/5CH)

4th byte Storing area ( )

From 5th to 25th byte System reserve

26th byte Sum code

34. Selecting / Getting FIXED/SHORT/TRAN/LIST/ BATTERY function mode.

(5DH/5EH)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command(5DH/5EH)

4th byte Work mode (0:FIXED,1:SHORT, 2:TRANSITION,3:LIST,4: BATTERY)

From 5th to 25th byte System reserve

26th byte Sum code

35. Reading input voltage, current, power and relative state. (5FH)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command (5FH)

From 4th to 7th byte Actual input voltage value (Lower bytes are in the front location, higher bytes are in the later location)

From 8th to 11th byte Actual input current value (Lower bytes are in the front location, higher bytes are

in the later location)

From 12th to 15th byte Actual input power value (Lower bytes are in the front location, higher bytes are

in the later location)

16th byte Operation state register

From 17th to 18th byte Demand state register

From 19th to 25th byte System reserve

26th byte Sum code

BIT Signal

Meaning

0 1 2 3 4 5 6 CAL

WTG

REM

OUT

LOCAL

SENSE

LOT

Operation state register

Calculate the new demarcate coefficient

Wait for trigger signal

Remote control mode

Output state

LOCAL button state (0 is represent “not in effect “,1 is represent ‘in effect “)

Remote testing mode

FOR LOAD ON timer state

0 1 2 3 4 5 6 7 8 9 RV

OV

OC

OP

OT

SV

CC

CV

CP

CR

Demand state register

Input reverse voltage

Over voltage

Over current

Over power

Over temperature

Not connect remote terminal

Constant current

Constant voltage

Constant power

Constant resistance

36. Enter the calibration mode(60H)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command(60H)

4th byte Calibration mode select(0:disable;1:enable) 5th byte Calibration password(0X85H)

6th byte Calibration password(0X11H or 0X12H)From 7th to 25th byte System reserve

26th byte Sum code

38. Calibrate voltage value(62H)

1st byte Start bit ( AAH )

3rd byte Command(62H)

4th byte Voltage calibration point(1~4)

From 5th to 25th byte System reserve

26th byte Sum code

41. Sending the actual input current to calibration program (65H)1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command(65H)

4th byte The lowest byte of actual current

5th byte The lower byte of actual current

6th byte The higher byte of actual current

7th byte The highest byte of actual current

From 8th to 25th byte System reserve

26th byte Sum code

42. Store the calibration data to EEPROM(66H)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command (66H)

From 4th to 25th byte System reserve

26th byte Sum code

45. Reading product’s model, series number and version information(6AH)

1st byte Start bit ( AAH )

2nd byte Address (0—0XFE)

3rd byte Command(6AH)

From 4th to 8th byte Mode information (ASIC code)

9th byte The lowest byte of software version number(BCD code)

10th byte The highest byte of software version number(BCD code)

From 11th to 20th byte Product series number (ASIC code)

From 21st to 25th byte System reserve

26th byte Sum code

For example:

Product’s series number is 000045,product mode is 8511,software version number is V2.03,data

HSPY通讯协议

HSPY3603仪表采用RS232或者RS485传输标准与计算机通迅,详细资料如下: 注(本机只支持功能码03,10) 波特率:1200,2400,4800,9600,19200 起始位:1 数据位:8 校验位:无 停止位:1 一.MODBUS_RTU帧结构 消息发送至少要以3.5个字符时间的停顿间隔开始;整个消息帧必须作为一连续的数据传输流,如果在帧完成之前有超过3.5个字符时间的停顿时间,接收设备将刷新不完整的消息并假定下一字节是一个新消息的地址域。同样地,如果一个新消息在小于3.5个字符时间内接着前个消息开始,接收的设备将认为它是前一消息的延续。 一帧信息的标准结构如下所示: 地址域: 主机通过将要联络的从机的地址放入消息中的地址域来选通从设备,单个从机的地址范围是1…15(十进制)。 地址0是用作广播地址,以使所有的从机都能认识。 功能域:有效的编码范围是1…255(十进制);当消息从主机发往从机时,功能代码将告之从机需要去干什么。例如:读/写一组寄存器的数据内容等。

数据域:主机发给从机的数据域中包含了从机完成功能域的动作时所必要的附加信息;如:寄存器地址等。 CRC校验:CRC生成之后,低字节在前,高字节在后。 注:本仪表通讯时帧与帧之间的响应间隔,通讯速率大于等于9600bps时不大于5ms

注:共用电源输出/停止设定的时候电源的通讯地址为0xAA,这时可以起停多台电源。 MODBUS RTU 通讯协议 通讯数据的类型及格式: 信息传输为异步方式,并以字节为单位。在主站和从站之间传递的通讯信息是10位的字格式: ●通讯数据(信息帧)格式 一、通讯信息传输过程: 当通讯命令由发送设备(主机)发送至接收设备(从机)时,符合相应

通讯协议标准

编号: 密级:内部 页数:__________基于RS485接口的DGL通信协议(修改) 编写:____________________ 校对:____________________ 审核:____________________ 批准:____________________ 北京华美特科贸有限公司 二○○二年十二月六日

1.前言 在常见的数字式磁致伸缩液位计中,多采用RS485通信方式。但RS485标准仅对物理层接口进行了明确定义,并没有制定通信协议标准。因此,在RS485的基础上,派生出很多不同的协议,不同公司均可根据自身需要设计符合实际情况的通信协议。并且,RS485允许单总线多机通信,如果通信协议设计不好,就会造成相互干扰和总线闭锁等现象。如果在一条总线上挂接不同类型的产品,由于协议不一样,很容易造成误触发,造成总线阻塞,使得不同产品对总线的兼容性很差。 随着RS485的发展,Modicon公司提出的MODBUS协议逐步得到广泛认可,已在工业领域得到广泛应用。而MODBUS的协议规范比较烦琐,并且每字节数据仅用低4位(范围:0~15),在信息量相同时,对总线占用时间较长。 DGL协议是根据以上问题提出的一种通信协议。在制定该协议时已充分考虑以下几点要求: a.兼容于MODBUS 。也就是说,符合该协议的从机均可挂接到同一总线上。 b.要适应大数据量的通信。如:满足产品在线程序更新的需要(未来功能)。 c.数据传输需稳定可靠。对不确定因素应加入必要的冗错措施。 d.降低总线的占用率,保证数据传输的通畅。 2.协议描述 为了兼容其它协议,现做以下定义: 通信数据均用1字节的16进制数表示。从机的地址范围为:0x80~0xFD,即:MSB=1; 命令和数据的数值范围均应控制在0~0x7F之间。即:MSB=0,以区别地址和其它数据。 液位计的编码地址为:0x82~0x9F。其初始地址(出厂默认值)为:0x81。 罐旁表的编织地址为:0xA2~0xBF。其初始地址(出厂默认值)为:0xA1。 其它地址用于连接其它类型的设备,也可用于液位计、罐区表地址不够时的扩充。 液位计的命令范围为:0x01~0x2F,共47条,将分别用于参数设定、实时测量、诊断测试、在线编程等。 通信的基本参数为:4800波特率,1个起始位,1个结束位。字节校验为奇校验。 本协议的数据包是参照MODBUS RTU 通信格式编写,并对其进行了部分修改,以提高数据传输的速度。另外,还部分参照了HART协议。其具体格式如下: 表中,数据的最大字节数为16个。也就是说,整个数据包最长为20个字节。 “校验和”是其前面所有数据异或得到的数值,然后将该数值MSB位清零,使其满足0~7F 的要求。在验证接收数据包的“校验和”是否正确时,可将所有接收数据(包括“校验和”)进行异或操作,得到的数据应=0x80。这是因为,只有“地址”的MSB=1,所以异或结果的MSB也必然等于1。 本协议不支持MODBUS中所规定的广播模式。 3.时序安排 在上电后,液位计将先延迟10秒,等待电源稳定。然后,用5秒的时间进行自检和测试数据。

MODBUS通讯协议及编程

通讯协议及编程 通讯协议分为协议和协议,我公司的多种仪表都采用通讯协议,如:2000智能电力监测仪、巡检表、数显表、光柱数显表等。下面就协议简要介绍如下: 一、通讯协议 (一)、通讯传送方式: 通讯传送分为独立的信息头,和发送的编码数据。以下的通讯传送方式定义也与通讯规约相兼容: 初始结构= ≥4字节的时间 地址码 = 1 字节 功能码 = 1 字节 数据区 = N 字节 错误校检 = 16位码 结束结构= ≥4字节的时间 地址码:地址码为通讯传送的第一个字节。这个字节表明由用户设定地址码的从机将接收由主机发送来的信息。并且每个从机都有具有唯一的地址码,并且响应回送均以各自的地址码开始。主机发送的地址码表明将发送到的从机地址,而从机发送的地址码表明回送的从机地址。 功能码:通讯传送的第二个字节。通讯规约定义功能号为1到127。本仪表只利用其中的一部分功能码。作为主机请求发送,通过功能码告诉从机执行什么动作。作为从机响应,从机发送的功能码与从主机发送来的功能码一样,并表明从机已响应主机进行操作。如果从机发送的功能码的最高位为1(比如功能码大与此同时127),则表明从机没有响应操作或发送出错。 数据区:数据区是根据不同的功能码而不同。数据区可以是实际数值、设置点、主机发送给从机或从机发送给主机的地址。 码:二字节的错误检测码。 (二)、通讯规约: 当通讯命令发送至仪器时,符合相应地址码的设备接通讯命令,并除去地址码,读取信息,如果没有出错,则执行相应的任务;然后把执行结果返送给发送者。返送的信息

中包括地址码、执行动作的功能码、执行动作后结果的数据以及错误校验码。如果出错就不发送任何信息。 1.信息帧结构 地址码:地址码是信息帧的第一字节(8位),从0到255。这个字节表明由用户设置地址的从机将接收由主机发送来的信息。每个从机都必须有唯一的地址码,并且只有符合地址码的从机才能响应回送。当从机回送信息时,相当的地址码表明该信息来自于何处。 功能码:主机发送的功能码告诉从机执行什么任务。表1-1列出的功能码都有具体的含义及操作。 数据区:数据区包含需要从机执行什么动作或由从机采集的返送信息。这些信息可以是数值、参考地址等等。例如,功能码告诉从机读取寄存器的值,则数据区必需包含要读取寄存器的起始地址及读取长度。对于不同的从机,地址和数据信息都不相同。 错误校验码:主机或从机可用校验码进行判别接收信息是否出错。有时,由于电子噪声或其它一些干扰,信息在传输过程中会发生细微的变化,错误校验码保证了主机或从机对在传送过程中出错的信息不起作用。这样增加了系统的安全和效率。错误校验采用16校验方法。 注:信息帧的格式都基本相同:地址码、功能码、数据区和错误校验码。 2.错误校验 冗余循环码()包含2个字节,即16位二进制。码由发送设备计算,放置于发送信息的尾部。接收信息的设备再重新计算接收到信息的码,比较计算得到的码是否与接收到的相符,如果两者不相符,则表明出错。 码的计算方法是,先预置16位寄存器全为1。再逐步把每8位数据信息进行处理。在进行码计算时只用8位数据位,起始位及停止位,如有奇偶校验位的话也包括奇偶校验位,都不参与码计算。 在计算码时,8位数据与寄存器的数据相异或,得到的结果向低位移一字节,用0 填补最高位。再检查最低位,如果最低位为1,把寄存器的内容与预置数相异或,如果最低位为0,不进行异或运算。 这个过程一直重复8次。第8次移位后,下一个8位再与现在寄存器的内容相相异或,这个过程与以上一样重复8次。当所有的数据信息处理完后,最后寄存器的内容即为码值。码中的数据发送、接收时低字节在前。 计算码的步骤为:

模块通信协议

YL-0202通信协议 一、说明 本协议支持0~FF的全数据的传送,移植到其它通讯中可支持全双工通信模式,且带有自同步功能,无需超时。 二、串口 波特率:9600,1位起始位,1位停止位,8位数据位,无奇偶校验。

三、帧格式 1.命令帧格式概述 a.命令头——固定0x7F(数据中若有0x7F则发送双个0x7F,详见2) b.命令长度——命令长度包括:命令长度(1 byte)+命令字(1 byte)+数据(n byte),长 度不超过0x7E,不小于2 c.命令字——详见四:命令表 d.数据——n字节数据。 e.校验——校验内容包括:命令长度(1 byte)、命令字(1 byte)、数据(n byte)。 2.命令头说明 命令头固定为0x7F,数据或命令中若含有0x7F,则用(0x7F、0x7F)代替,此代替行为只传输时,所以在计算长度或校验时只按原数据计算,即一个0x7F。 如原命令:7F 0A 03 10 7F 37 50 7F 35 01 4A 实际传输数据为:7F 0A 03 10 7F 7F 37 50 7F 7F 35 01 4A 除去命令头实际传输数据共12字节,但命令长度则为0A即10字节,校验同理。 3.校验说明 校验为所有校验内容的异或值,校验函数如下: private byte checkSum(byte[] data, int offset, int length) { byte temp = 0; for (int i = offset; i < length + offset; i++) { temp ^= data[i]; } return temp; }

通信协议

常用通信协议汇总 一、有线连接 1.1RS-232 优点:RS-232是为点对点(即只用一对收、发设备)通讯而设计的,其驱动器负载为3kΩ~7kΩ。所以RS-232适合本地设备之间的通信。 缺点:(1)接口的信号电平值较高,易损坏接口电路的芯片,又因为与TTL 电平不兼容故需使用电平转换电路方能与TTL电路连接。 (2)传输速率较低,在异步传输时,最高速率为20Kbps。 (3)接口使用一根信号线和一根信号返回线而构成共地的传输形式,而发送电平与接收 电平的差仅为2V至3V左右,所以其共模抑制能力差,再加上双绞线上的分布电容,其传送距离最大为约15米。 1.2RS-485 RS485有两线制和四线制两种接线,四线制只能实现点对点的通信方式,现很少采用,现在多采用的是两线制接线方式,这种接线方式为总线式拓朴结构,传输距离一般在1~2km以下为最佳,如果超过距离加"中继"可以保证信号不丢失,而且结点数有限制,结点越多调试起来稍复杂,是目前使用最多的一种抄表方式,后期维护比较简单。常见用于串行方式,经济实用。 1.3CAN 最高速度可达1Mbps,在传输速率50Kbps时,传输距离可以达到1公里。在10Kbps速率时,传输距离可以达到5公里。一般常用在汽车总线上,可靠性高。 1.4TCP/IP 它可以用在各种各样的信道和底层协议(例如T1和X.25、以太网以及RS-232串行接口)之上。IP数据包是不可靠的,因为IP并没有做任何事情来确认数据包是按顺序发送的或者没有被破坏。IP数据包中含有发送它的主机的地址(源地址)和接收它的主机的地址(目的地址)。 1.5ADSL 基于TCP/IP 或UDP协议,将抄表数据发送到固定ip,利用电信/网通现有的布线方式,速度快,性能比较可以,缺点是不适合在野外,设备费用投入较大,对仪表通讯要求高。 1.6FSK 可靠通信速率为1200波特,可以连接树状总线;对线路性能要求低,通信距离远,一般可达30公里,线路绝缘电阻大于30欧姆,串联电阻高达数百欧姆都可以工作,适合用于大型矿井监控系统。主要缺点是:系统造价略高,通信线路要求使用屏蔽电缆;抗干扰性能一般,误码率略高于基带。 1.7光纤方式 传输速率高,可达百兆以上;通信可靠无干扰;抗雷击性能好,缺点:系统造价高;光纤断线后熔接受井下防爆环境制约,不宜直达分站,一般只用于通信干线。 1.8电力载波 1.9利用现有电力线,通过载波方式将模拟或数字信号进行高速传输的技术。由于使用坚固可靠的电力线作 为载波信号的传输媒介,因此具有信息传输稳定可靠,路由合理、可同时复用远动信号等特点,不需要线路投资的有线通信方式,但是开发费用高,调试难度大,易受用电环境影响,通讯状况用户的用电质量关系紧密。 二、无线连接 2.1Bluetooth 蓝牙是一种支持设备短距离通信的无线电技术。它是一种无线数据与语音通信的开放性全球规范,它以低

modbus_通讯协议_实例

上海安标电子有限公司 ——PC39A接地电阻仪通信协议 通信协议: 波特率:9600数据位:8校验位:无停止位:1 上位机(计算机): 字节号 1 2 3 4 5 6 7 8 意义ID Command 数据地址V alue CRC 注:1 ID:1个字节,由单机来定(0~255) 2 Command:1个字节,读:3或4,写:6 3 数据地址:2个字节,寄存器地址,读从100开始,写从200开始 4 V alue:2个字节,读:个数(以整型为单位),写:命令/ 数据(以整型为单位) 5 CRC:计算出CRC 下位机(PC39A): 读数据,若正确 字节号 1 2 3 3+N (N=个数*2) 3+N+1 3+N+2 意义ID Command=3 / 4 数据个数数据CRC 注:1 ID:1个字节,由单机来定(0~255) 2 Command:1个字节,收到的上位机命令 3数据个数:1个字节,返回数据个数(以字节为单位) 4 V alue:N个字节,是返回上位机的数据 5 CRC:计算出CRC 写命令,若正确 返回收到的数据: 若错误 字节号 1 2 3 4 5 意义ID Command 数据CRC 注:1 ID:1个字节,由单机来定(0~255) 2 Command:1个字节,收到的上位机命令或上0x80, 如收到3,返回0x83 3数据:1个字节,错误的指令 错误指令 1:表示command不存在 2:表示数据地址超限 4 CRC:计算出CRC

例如读PC39A 电流数据: 机器地址为12,电流的数据地址100,数据为15.45(A) (一个整型数据) 主机: ID Command 数据地址 V alue CRC 16进制 0x0c 0x03 0x0064 0x0001 CRC_H CRC_L 10进制 12 3 100 1 CRC_H CRC_L 从机返回 如正确: ID Command 数据个数(以字节为单位) V alue CRC 16进制 0x0c 0x03 0x002 0x0609 CRC_H CRC_L 10进制 12 3 2 1545 CRC_H CRC_L 如错误: ID Command 数据 CRC 16进制 0x0c 0x83 0x02 CRC_H CRC_L 10进制 12 131 2 CRC_H CRC_L 例如发PC39A 启动命令: 机器地址为12,命令的地址200,数据为25000(25000表示启动) 主机: ID Command 数据地址 V alue CRC 16进制 0x0c 0x06 0x00c8 0x61a8 CRC_H CRC_L 10进制 12 6 200 25000 CRC_H CRC_L 从机返回 如正确: ID Command 数据地址 V alue CRC 16进制 0x0c 0x06 0x00c8 0x61a8 CRC_H CRC_L 10进制 12 6 200 25000 CRC_H CRC_L 如错误: ID Command 数据 CRC 16进制 0x0c 0x86 0x02 CRC_H CRC_L 10进制 12 134 2 CRC_H CRC_L 0011 10000110 错误码0x83 功能码0x06错误码0x86

智能卡和指纹系统通讯协议和命令字-v

AN-0811212 智能卡和指纹系统通讯帧格式和命令字 文件息

目录 1 通讯帧格式描述 (5) 2 指令码描述 (5) 2.1 考勤门禁记录操作命令 (5) 2.1.1 上位机采集考勤门禁记录(考勤门禁,命令码:1) (7) 2.1.2 采集记录删除-考勤门禁、收费(命令码:2) (7) 2.1.3 考勤门禁数据实时上传(考勤门禁,命令码:3) (7) 2.1.4 考勤门禁数据补采(考勤门禁,命令码:4) (7) 2.1.5 记录清空-考勤门禁、收费(命令码:5) (7) 2.1.6 读卡序列号(命令码:6) (8) 2.1.7 读块数据(命令码:7) (8) 2.1.8 写块数据(命令码:8) (8) 2.1.9 充值(命令码:9) (9) 2.1.10 减值(命令码:10) (9) 2.1.11 初始化钱包(命令码:11) (9) 2.1.12 读扇区数据(命令码:12) (10) 2.1.13 写扇区数据(命令码:13) (10) 2.1.14 修改卡扇区密码(命令码:14) (10) 2.1.15 开LED(命令码:15) (11) 2.1.16 关LED(命令码:16) (11) 2.1.17 开BEEP(命令码:17) (11) 2.1.18 关BEEP(命令码:18) (11) 2.1.19 指纹机录入图像(命令码:19) (12) 2.1.20 指纹机生成特征(命令码:20) (12) 2.1.21 指纹机精确比对两枚指纹特征(命令码:21) (12) 2.1.22 指纹机搜索指纹(命令码:22) (12) 2.1.23 指纹机注册模板(命令码:23) (13) 2.1.24 指纹机储存模板(命令码:24) (13) 2.1.25 指纹机上传特征或模板(命令码:25) (13) 2.1.26 指纹机下载特征或者模板(命令码:26) (13) 2.1.27 指纹机清空指纹库(命令码:27) (14) 2.1.28 指纹机验证模块握手口令(命令码:28) (14) 2.1.29 指纹机设置芯片地址(命令码:29) (14) 2.1.30 终端出厂设置(命令码:30) (14) 2.1.31 终端参数配置(命令码:31) (15) 2.1.32 设置终端应用类型(命令码:32) (16) 2.1.33 设置终端标识号(命令码:33) (16) 2.1.34 设置终端通讯模式(命令码:34) (16) 2.1.35 设置终端地址(命令码:35) (16) 2.1.36 设置终端记录模式(命令码:36) (17) 2.1.37 设置终端响应时间(命令码:37) (17) 2.1.38 设置刷卡间隔(命令码:38) (17)

数据链路层通信协议书范本

题目: 数据链路层网络通信协议计 : 周小多 学号:2013302513 班号:10011302 时间:2015.11.12 计算机学院

目录 摘要 1 目的 (1) 2 要求 (1) 3相关知识 (1) 4设计原理及流程图 (3) 5实现思路及伪代码描述 (6) 6意见或建议 (14) 7参考文献 (14)

题目: 数据链路层网络通信协议设计

帧校验字段 紧跟在信息字段之后的是两字节的帧校验字段,帧校验字段称为FC(Frame Check)字段,校验序列FCS(Frame check Sequence)。SDLC/HDLC均采用16位循环冗余校验码CRC (Cyclic Redundancy Code),其生成多项式为CCITT多项式X^16+X^12+X^5+1。除了标志字段和自动插入的"0"位外,所有的信息都参加CRC计算。 CRC的编码器在发送码组时为每一码组加入冗余的监督码位。接收时译码器可对在纠错围的错码进行纠正,对在校错围的错码进行校验,但不能纠正。超出校、纠错围之外的多位错误将不可能被校验发现。 4、设计原理及流程图 ?可靠性分析:(1)差错控制:检错(CRC-32);纠错(序号+确认反馈+超时重发);(2)流量控 制:采用选择重发协议(序号为3个比特位,发送缓冲区和接收缓存区,确定发送窗口和接收窗口,对缓冲区和窗口管理) ?不可靠性分析:支持不可靠通信服务。 ?协议分析:语法,语义和同步 ?语法:数据帧格式 ?起始定界符=终止定界符:01111110; ?目的地址:(48):bbbbbb; ?源地址:(48):aaaaaa; ?控制字段:定义帧类型,实现差错控制和流量控制 ?数据部分:46~1500字节 ?语义:不同类型帧的含义

几种通信协议

RS-232-C RS-232-C是OSI基本参考模型物理层部分的规格,它决定了连接器形状等物理特性、以0和1表示的电气特性及表示信号意义的逻辑特性。 RS-232-C是EIA发表的,是RS-232-B的修改版。本来是为连接模拟通信线路中的调制解调器等DCE及电传打印机等DTE拉接口而标准化的。现在很多个人计算机也用RS-232-C作为输入输出接口,用RS-232-C作为接口的个人计算机也很普及。 RS-232-C的如下特点:采用直通方式,双向通信,基本频带,电流环方式,串行传输方式,DCE-DTE间使用的信号形态,交接方式,全双工通信。RS-232-C在ITU建议的V.24和V.28规定的25引脚连接器在功能上具有互换性。 RS-232-C所使用的连接器为25引脚插入式连接器,一般称为25引脚D-SUB。DTE端的电缆顶端接公插头,DCE端接母插座。 RS-232-C所用电缆的形状并不固定,但大多使用带屏蔽的24芯电缆。电缆的最大长度为15m。使用RS-232-C在200K位/秒以下的任何速率都能进行数据传输。 RS-449 RS-449是1977年由EIA发表的标准,它规定了DTE和DCE之间的机械特性和电气特性。RS-449是想取代RS-232-C而开发的标准,但是几乎所有的数据通信设备厂家仍然采用原来的标准,所以RS-232-C仍然是最受欢迎的接口而被广泛采用。 RS-449的连接器使用ISO规格的37引脚及9引脚的连接器,2次通道(返回字通道)电路以外的所有相互连接的电路都使用37引脚的连接器,而2次通道电路则采用9引脚连接器。 RS-449的电特性,对平衡电路来说由RS-422-A规定,大体与V.11具有相同规格,而RS-423-A大体与V.10具有相同规格。

Modbus 通讯协议的原理和标准

Modbus 通讯协议的原理和标准 工业控制已从单机控制走向集中监控、集散控制,如今已进入网络时代,工业控制器连网也为网络管理提供了方便。Modbus 就是工业控制器的网络协议中的一种。 一、Modbus 协议简介 Modbus 协议是应用于电子控制器上的一种通用语言。通过此协议,控制器相互之间、控制器经由网络(例如以太网)和其它设备之间可以通信。它已经成为一通用工业标准。有了它,不同厂商生产的控制设备可以连成工业网络,进行集中监控。此协议定义了一个控制器能认识使用的消息结构,而不管它们是经过何种网络进行通信的。它描述了一控制器请求访问其它设备的过程,如果回应来自其它设备的请求,以及怎样侦测错误并记录。它制定了消息域格局和内容的公共格式。 当在一Modbus 网络上通信时,此协议决定了每个控制器须要知道它们的设备地址,识别按地址发来的消息,决定要产生何种行动。如果需要回应,控制器将生成反馈信息并用Modbus 协议发出。在其它网络上,包含了Modbus 协议的消息转换为在此网络上使用的帧或包结构。这种转换也扩展了根据具体的网络解决节地址、路由路径及错误检测的方法。 1、在Modbus 网络上转输 标准的Modbus 口是使用一RS-232C 兼容串行接口,它定义了连接口的针脚、电缆、信号位、传输波特率、奇偶校验。控制器能直接或经由Modem 组网。 控制器通信使用主—从技术,即仅一设备(主设备)能初始化传输(查询)。其它设备(从设备)根据主设备查询提供的数据做出相应反应。典型的主设备:主机和可编程仪表。典型的从设备:可编程控制器。 主设备可单独和从设备通信,也能以广播方式和所有从设备通信。如果单独通信,从设备返回一消息作为回应,如果是以广播方式查询的,则不作任何回应。Modbus 协议建立了主设备查询的格式:设备(或广播)地址、功能代码、所有要发送的数据、一错误检测域。 从设备回应消息也由Modbus 协议构成,包括确认要行动的域、任何要返回的数据、和一错误检测域。如果在消息接收过程中发生一错误,或从设备不能执行其命令,从设备将建立一错误消息并把它作为回应发送出去。 2、在其它类型网络上转输 在其它网络上,控制器使用对等技术通信,故任何控制都能初始和其它控制器的通信。这样在单独的通信过程中,控制器既可作为主设备也可作为从设备。提供的多个内部通道可允许同时发生的传输进程。 在消息位,Modbus 协议仍提供了主—从原则,尽管网络通信方法是“对等”。如果一控制器发送一消息,它只是作为主设备,并期望从从设备得到回应。同样,当控制器接收到一消息,它将建立一从设备回应格式并返回给发送的控制器。 3、查询—回应周期 (1)查询 查询消息中的功能代码告之被选中的从设备要执行何种功能。数据段包含了从设备要执行功能的任何附加信息。例如功能代码03 是要求从设备读保持寄存器并返回它们的内容。数据段必须包含要告之从设备的信息:从何寄存器开始读及要读的寄存器数量。错误检测域为从设备提供了一种验证消息内容是否正确的方法。

数据链路层协议分析

【里论套习 4、理解MAC '地址的作用; 实验二以太网链路层帧格式分析 一实验目的 1、分析EthernetV2 标准规定的MAC 层帧结构,了解IEEE802.3标准规定 的MAC 层帧结构和TCP/IP 的主要协议和协议的层次结构。 2、掌握网络协议分析软件的基本使用方法。 3、掌握网络协议编辑软件的基本使用方法。 "时]工严11 1 厶-*■ ―鼻八匸 二实验内容 1、 学习网络协议编辑软件的各组成部 ___________ Slepl:设走夹验环墳 2、 学习网络协议分析软件的各组成部分及其功能; — £伽|12:运行ipconfig 命令 3、学会使用网络协议编辑软件编辑以太网数据包;厂 5始閃:娠輻LLC 信息輔并灰洪 Step4:编頤IXC 噩拦巾贞和无 5、理解MAC 酩部中的LLC — PDU 长度/类型字段的功能; 6、学会观察并分析地址本中的 MAC 地址 三实验环境 四实验流程 图 2.1-2( 五实验原理 在物理媒体上传输的数据难免受到各种不可靠因素的影响而产生差错, 为了弥补 物理层上的不足,为上层提供无差错的数据传输,就要能对数据进行检错和纠错。 数据链路的建立、拆除、对数据的检 错,纠错是数据链路层的基本任务。 局域网(LAN)是在一个小的范围内,将分散的独立计算机系统互联起来,实现资 开始

源的共享和数据通信。局域网的技术要素包括了体系结构和标准、传输媒体、拓扑结构、数据编码、媒体访问控制和逻 辑链路控制等,其中主要的技术是传输媒体、拓扑结构和媒体访问控制方法。局域网的主要的特点是:地理分布范围小、数据传输速率高、误码率低和协议简单等。 1、三个主要技术 1)传输媒体:双绞线、同轴电缆、光缆、无线。 2)拓扑结构:总线型拓扑、星型拓扑和环型拓扑。 3)媒体访问控制方法:载波监听多路访问/冲突检测(CSMA/CD)技术。 2、IEEE802标准的局域网参考模型 IEEE802参考模型包括了OSI/RM最低两层(物理层和数据链路层)的功能,OSI/RM 的数据链路层功能,在局域网参考模型中被分成媒体访问控制MAC(MediumAccessCo ntrol) 和逻辑链路控制LLC(LogicalLi nkCon trol)两个 子层。由于局域网采用的媒体有多种,对应的媒体访问控制方法也有多种,为了 使数据帧的传送独立于所采用的物理媒体和媒体访问控制方法,IEEE802标准特意把LLC独立出来形成单独子层,使LLC子层与媒体无关,仅让MAC子层依赖于物理媒体和媒体访问控制方法。LLC子层中规定了无确认无连接、有确认无连接和面向连接三种类型的链路服务。媒体访问控制技术是以太网技术的核心。以太网不提供任何确认收到帧的应答机制,确认必须在高层完成。3、以太网帧结构 以太网中传输的数据包通常被称为“帧”,以太网的“帧”结构如下: 各字段的含义: 目的地址:6个字节的目的物理地址标识帧的接收结点。 源地址:6个字节的源物理地址标识帧的发送结点。

常用几种通讯协议

常用几种通讯协议 Modbus Modbus技术已成为一种工业标准。它是由Modicon公司制定并开发的。其通讯主要采用RS232,RS485等其他通讯媒介。它为用户提供了一种开放、灵活和标准的通讯技术,降低了开发和维护成本。 Modbus通讯协议由主设备先建立消息格式,格式包括设备地址、功能代码、数据地址和出错校验。从设备必需用Modbus协议建立答复消息,其格式包含确认的功能代码,返回数据和出错校验。如果接收到的数据出错,或者从设备不能执行所要求的命令,从设备将返回出错信息。 Modbus通讯协议拥有自己的消息结构。不管采用何种网络进行通讯,该消息结构均可以被系统采用和识别。利用此通信协议,既可以询问网络上的其他设备,也能答复其他设备的询问,又可以检测并报告出错信息。 在Modbus网络上通讯期间,通讯协议能识别出设备地址,消息,命令,以及包含在消息中的数据和其他信息,如果协议要求从设备予以答复,那么从设备将组建一个消息,并利用Modbus发送出去。 BACnet BACnet是楼宇自动控制系统的数据通讯协议,它由一系列与软件及硬件相关的通讯协议组成,规定了计算机控制器之间所有对话方式。协议包括:(1)所选通讯介质使用的电子信号特性,如何识别计算机网址,判断计算机何时使用网络及如何使用。(2)误码检验,数据压缩和编码以及各计算机专门的信息格式。显然,由于有多种方法可以解决上述问题,但两种不同的通讯模式选择同一种协议的可能性极少,因此,就需要一种标准。即由ISO(国际标准化协会〉于80年代着手解决,制定了《开放式系统互联(OSI〉基本参考模式(Open System Interconnection/Basic Reference Model简称OSI/RM)IS0- 7498》。 OSI/RM是ISO/OSI标准中最重要的一个,它为其它0SI标准的相容性提供了共同的参考,为研究、设计、实现和改造信息处理系统提供了功能上和概念上的框架。它是一个具有总体性的指导性标准,也是理解其它0SI标准的基础和前提。 0SI/RM按分层原则分为七层,即物理层、数据链路层、网络层、运输层、会话层、表示层、应用层。 BACnet既然是一种开放性的计算机网络,就必须参考OSIAM。但BACnet没有从网络的最低层重新定义自己的层次,而是选用已成熟的局域网技术,简化0SI/RM,形成包容许多局 域网的简单而实用的四级体系结构。 四级结构包括物理层、数据链路层、网络层和应用层。

各种通信协议

分层及通信协议 协议软件是计算机通信网中各部分之间所必须遵守的规则的集合,它定义了通信各部分交换信息时的顺序、格式和词汇。协议软件是计算机通信网软件中最重要的部分。网络的体系结构往往都是和协议对应的,而且,网络管理软件、交换与路由软件以及应用软件等都要通过协议软件才能发生作用。 一、通信协议 1、什么是通信协议 通信协议(简称协议Protoco l),是指相互通信的双方(或多方)对如何进行信息交换所一致同意的一整套规则。一个网络有一系列的协议,每一个协议都规定了一个特定任务的完成。协议的作用是完成计算机之间有序的信息交换。 通信网络是由处在不同位置上的各节点用通信链路连接而组成的一个群体。通信网必须在节点之间以及不同节点上的用户之间提供有效的通信,即提供有效的接入通路。在计算机通信网中,将这种接入通路称为连接(connection)。建立一次连接必需要遵守的一些规则,这些规则也就是通信网设计时所要考虑的主要问题。 (l)为了能在两个硬件设备之间建立起连接,应保证在源、宿点之间存在物理的传输媒介,在该通路的各条链路上要执行某种协议。 如果传输线路使用电话线,则要通过调制解调器将信号从数字转换成模拟的,并在接收端进行反变换。 如果用的是数字传输线路,则在数据处理设备和通信设备之间,必须有一个数字适配器,以便将数字信号的格式转换成两种设备各自所期望的形式。 为了在两个端设备之间互换数据,需要协调和同步,调制解调器和数字适配器必须执行它们自己的协议。 无论是模拟的还是数字的通信设备,调制解调器和数字适配器的状态必须由接到节点上的设备来控制,这里必定有一个物理的或电气的接口来执行这种功能,执行某种适当的协议来达到这一控制目的。 (2)在计算机通信网中,许多信息源都是突发性的(bursty),问题是要利用信息的这种突发性质来降低消耗在线路上的费用,由此开发了许多共享通信资源的技术。所谓共享,是指允许多个用户使用同一通信资源,这就产生了多用户的接入问题。多路接入

Modbus+RTU+标准通讯协议格式

HLP_SV Modbus RTU 标准通讯协议格式 通信资料格式 Address Function Data CRC check 8 bits 8 bits N×8bits 16bits 1)Address通讯地址:1-247 2)Function:命令码8-bit命令 01 读线圈状态 上位机发送数据格式: ADDRESS 01 ADDRH ADDRL NUMH NUML CRC 注: ADDR: 00000 --- FFFF(ADDR=线圈地址-1);NUM: 0010-----0040 (NUM为要读线圈状态值的二进制数位数) 正确时变频器返回数据格式: ADDRESS 01 BYTECOUNT DA TA1 DA TA2 DA TA3 DA TAN CRC 注: BYTECOUNT:读取的字数 错误时变频器返回数据格式: ADDRESS 0X81 Errornum CRC 注: Errornum为错误类型代码 如:要检测变频器的输出频率 应发送数据:01 01 00 30 00 10 3D C9(16进制) 变频器返回数据:01 01 02 00 20 B8 24(16进制) 发送数据:0030hex(线圈地址49) 返回的数据位为“0020”(16进制),高位与低位互换,为2000。即输出频率为 303(Max Ref)的50%。关于2000对应50%,具体见图1。

03读保持寄存器 上位机发送数据格式: ADDRESS 03 ADDRH ADDRL NUMH NUML CRC 注:ADDR: 0 --- 0XFFFF;NUM: 0010-----0040 (NUM为要读取数据的字数) ADDR=Parameter Numbe r×10-1 正确时变频器返回数据格式: ADDRESS 03 BYTECOUNT DA TA1 DA TA 2 DA TA 3 DA TAN CRC 注: BYTECOUNT:读取的字节数 错误时变频器返回数据格式: ADDRESS 0X83 Errornum CRC 如:要读变频器参数303的设定值 应发送数据:01 03 0B D5 00 02 95 BC (16进制) Parameter 303(3029)=0BD5HEX 变频器返回数据:“:”01 03 04 00 00 EA 60 B5 7B 返回的数据位为“00 00 EA 60”(16进制)转换为10进制数为60000, 表示303设置值为60.000 ※当参数值为双字时,NUM的值必须等于2。否则无法读取或读取错误。 05 写单个线圈状态 上位机发送数据格式: ADDRESS 05ADDRH ADDRL DA TAH DA TAL CRC 注:ADDR: 0 ---- 0XFFFF(ADDR=线圈地址-1);DATA=0000HEX(OFF) OR FF00(ON) HEX 正确时变频器返回数据格式: ADDRESS 05 DATAH DATAL BYTECOUNT CRC 错误时变频器返回数据格式: ADDRESS 0X85 Errornum CRC 如:要使写参数为写入RAM和EEPROM 应发送数据:01 05 00 40 FF 00 CRC(16进制) 变频器返回数据:01 05 FF 00 00 01 CRC(16进制) 发送数据:0040hex(线圈地址65) 06 写单个保持寄存器值(只能写参数值为单个字的参数) 上位机发送数据格式: ADDRESS 06 ADDRH ADDRL DA TAH DA TAL CRC 注:ADDR: ADDR=Parameter Numbe r×10-1 正确时变频器返回数据格式: ADDRESS 06 ADDRH ADDRL DA TAH DA TAL CRC 错误时变频器返回数据: ADDRESS 0X86 Errornum CRC 如:要对变频器参数101写入1 应发送数据:01 06 00 03 F1 00 01 19 BD(16进制) 变频器返回数据:01 06 03 F1 00 01 19 BD(16进制) PARAMETER 101(1009)=03F1 HEX

DLT645通信协议详情

1应用范围 本规范规定了电能表进行点对点的或一终端对多台电能表进行一主多从的本地通讯接口进行数据交换的技术要求,规定了本地系统硬件和协议规范。规定了物理连接、通讯链路及应用技术规范(数据的基本格式、校验方式、编码传输规则等)。 本规范主要参考了部颁DL/T 645-1997多功能电能表通信规约,根据我公司的DSSD331-3、DTSD341-3电能表的特色做了相应的扩展。本规范中未给出的一些例子和示意图请参见部颁规约。 2引用标准 下列标准所包含的条文,通过在本标准中的引用而构成为本标准的条文。本标准出版时,所示版本均为有效,所有标准都会被修订,使用本标准的各方应探讨使用下列标准最新版本的可能性。 DL/T 645-1997 多功能电能表通信规约 DL/T 614-1997 多功能电能表 3术语 3.1费率装置tariff device 固定的数据采集与处理单元,通常与电能表连接或与电能表组装在一起。 3.2手持单元(HHU)hand-heldunit 能与费率装置或电能表进行数据交换的便携式设备。 3.3数据终端设备data terminal equipment 由数据源、数据宿或两者组成的设备。

3.4直接本地数据交换direct local data exchange 一组费率装置与数据终端设备通过总线连接进行数据交换。 3.5本地总线数据交换local bus data exchange 一组费率装置与数据终端设备通过总线连接进行数据交换。 3.6远程数据交换remote data exchange 通过数据网络,数据采集中心与一台或一组费率装置之间的数据交换。 3.7主站master station 具有选择从站并与从站进行信息交换功能的设备。本标准中指手持单元或其它数据终端设备。 3.8从站slave station 预期从主站接收信息并与主站进行信息交换的设备。本标准中指费率装置。 3.9总线bus 连接主站与多个从站并允许主站每次只与一个从站通信的系统连接方式(广播命令除外)。 3.10半双工half-duplex 在双向通道中,双向交替进行、一次只在一个方向(而不是同时在两个方向)传输信息的一种通信方式。 3.11物理层physical layer 规定了数据终端设备或手持单元与费率装置之间的物理接口、接口的物理和电气特性,负责物理媒体上信息的接收和发送。 3.12数据链链路层data-link layer 负责数据终端设备与费率装置之间通信链路的建立并以帧为单位舆信息,保证信息的顺序传送,具有传输差错检测功能。 3.13应用层application layer

RS232通讯协议要点

RS232通讯协议基本结构 波特率9600 bit/s,8bit,1位停止,无校验位 格式 0EBH,地址,命令,长度(n),数据1,---数据n,冗余 说明: 0EBH为帧起始位 长度小于输出端口数 冗余=地址+命令+长度+数1+---+数n 如果冗余=0EBH,为防止与帧起始位相同,则发送反码,即冗余=14H 当接收正确时, 1)在命令1,2,5,6时,回送0EBH,地址,命令,01H,0FAH,冗余,并执行命令。 2)在命令3,4,7时,回送相应信息。 当接收不正确时, 1)地址正确,冗余不正确,回送0EBH,地址,命令,01H,0F5H,冗余。2)地址不正确,不回送任何信息。 串口通讯—通信协议 所谓通信协议是指通信双方的一种约定。约定包括对数据格式、同步方式、 传送速度、传送步骤、检纠错方式以及控制字符定义等问题做出统一规定,通信双方必须共同遵守。因此,也叫做通信控制规程,或称传输控制规程,它属于 ISO'S OSI七层参考模型中的数据链路层。 目前,采用的通信协议有两类:异步协议和同步协议。同步协议又有面向字 符和面向比特以及面向字节计数三种。其中,面向字节计数的同步协议主要用于DEC公司的网络体系结构中。 一、物理接口标准 1.串行通信接口的基本任务 (1)实现数据格式化:因为来自CPU的是普通的并行数据,所以,接口电路应具有实现不同串行通信方式下的数据格式化的任务。在异步通信方式下,接口自动生成起止式的帧数据格式。在面向字符的同步方式下,接口要在待传送的数据块前加上同步字符。 (2)进行串-并转换:串行传送,数据是一位一位串行传送的,而计算机处 理数据是并行数据。所以当数据由计算机送至数据发送器时,首先把串行数据转换为并行数才能送入计算机处理。因此串并转换是串行接口电路的重要任务。

实验二数据链路层协议分析

实验二以太网链路层帧格式分析一实验目的 1、分析EthernetV2标准规定的MAC层帧结构,了解IEEE802.3标准规定的 MAC层帧结构和TCP/IP的主要协议和协议的层次结构。 2、掌握网络协议分析软件的基本使用方法。 3、掌握网络协议编辑软件的基本使用方法。 二实验内容 1、学习网络协议编辑软件的各组成部分及其功能; 2、学习网络协议分析软件的各组成部分及其功能; 3、学会使用网络协议编辑软件编辑以太网数据包; 4、理解MAC地址的作用; 5、理解MAC首部中的LLC—PDU长度/类型字段的功能; 6、学会观察并分析地址本中的MAC地址。 三实验环境 回2.1- L 四实验流程 小亠| /I J ■ v 开始

结束 图21 2| 五实验原理 在物理媒体上传输的数据难免受到各种不可靠因素的影响而产生差错,为了弥补物理层上的不足,为上层提供无差错的数据传输,就要能对数据进行检错和纠错。数据链路的建立、拆除、对数据的检错,纠错是数据链路层的基本任务。 局域网(LAN)是在一个小的范围内,将分散的独立计算机系统互联起来,实现资源的共享和数据通信。局域网的技术要素包括了体系结构和标准、传输媒体、拓扑结构、数据编码、媒体访问控制和逻 辑链路控制等,其中主要的技术是传输媒体、拓扑结构和媒体访问控制方法。局域网的主要的特点是:地理分布范围小、数据传输速率高、误码率低和协议简单等。 1、三个主要技术 1)传输媒体:双绞线、同轴电缆、光缆、无线。 2)拓扑结构:总线型拓扑、星型拓扑和环型拓扑。 3)媒体访问控制方法:载波监听多路访问/冲突检测(CSMA/CD技术 2、IEEE 802标准的局域网参考模型 IEEE 802参考模型包括了OSI/RM最低两层(物理层和数据链路层)的功能,OSI/RM 的数据链路层功能,在局域网参考模型中被分成媒体访问控制 MAC(Medium Access Control) 和逻辑链路控制LLC(Logical Link Control)两个子层。由于局域网采用的媒体有多种,对应的媒体访问控制方法也有多种,为

相关主题
文本预览
相关文档 最新文档