CN101677277B - MODBUS-RTU protocol conformance test method - Google Patents

MODBUS-RTU protocol conformance test method Download PDF

Info

Publication number
CN101677277B
CN101677277B CN2008101413985A CN200810141398A CN101677277B CN 101677277 B CN101677277 B CN 101677277B CN 2008101413985 A CN2008101413985 A CN 2008101413985A CN 200810141398 A CN200810141398 A CN 200810141398A CN 101677277 B CN101677277 B CN 101677277B
Authority
CN
China
Prior art keywords
function code
test
function
proper testing
code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn - After Issue
Application number
CN2008101413985A
Other languages
Chinese (zh)
Other versions
CN101677277A (en
Inventor
贺春
任春梅
李亚萍
张冉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xuchang Ketop Testing Research Institute Co ltd
Original Assignee
XUCHANG KETOP ELECTRIC TESTING INSTITUTE
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by XUCHANG KETOP ELECTRIC TESTING INSTITUTE filed Critical XUCHANG KETOP ELECTRIC TESTING INSTITUTE
Priority to CN2008101413985A priority Critical patent/CN101677277B/en
Publication of CN101677277A publication Critical patent/CN101677277A/en
Application granted granted Critical
Publication of CN101677277B publication Critical patent/CN101677277B/en
Withdrawn - After Issue legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Maintenance And Management Of Digital Transmission (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention relates to an MODBUS-RTU protocol conformance test method which belongs to the field of information data transfer technologies of a power system. The method utilizes a protocol test tool for inspecting whether the implementation of a protocol conforms to the standard or not, utilizes a test instrument for imposing an alternating current component and assists the completion of verification of application functions and data accuracy, and the test content comprises the protocol conformance test and the verification of the application functions and the data accuracy, wherein, the protocol conformance test comprises the normal test and the negative test of a link layer, functional codes and a data field. The test method gives out the systematic and the comprehensive test content and the test method of the MODBUS-RTU protocol, thereby having important significance for ensuring the conformance and the interoperability of the protocol.

Description

The MODBUS-RTU protocol conformance test method
Technical field
Invention relates to a kind of MODBUS-RTU protocol conformance test method, belongs to power system information data passes technical field.
Background technology
Along with developing rapidly of electric power system, and the continuous application of new technology, the shared of information data had higher requirement, how better to finish sharing of information data, be the problem that electric power system is faced always.Communication protocol is a description to the equipment under test protocol part, mainly comprises address table, the application function of support and corresponding function code, and the specific (special) requirements of application function etc.
Communication protocol is as a kind of method that realizes that information data is transmitted, and its realization also receives much attention always.The Modbus-RTU agreement at present, has also obtained using widely in power industry Modbus-RTU agreement because its simple and exquisite structure obtains everybody support.
In Modbus-RTU agreement actual application, because each producer causes understanding differently of consensus standard, the implementation method difference, give actual interoperability issue, how to guarantee the realization and the standard consistency of Modbus-RTU agreement, guarantee that the interoperability of Modbus-RTU agreement is the emphasis that we study.
At present, in existing Modbus-RTU protocol test, mainly be whether the checking application function is realized, for example whether can on send data, whether can finish controlled function, and whether the communication protocol of having ignored bearing function satisfies the requirement of standard, and to the negative test of agreement.Like this, function is to have realized on the surface, but the consistency that when reality is interconnected with other producers, may realize because of agreement, bring difficulty to interconnection, also might when protocol massages is unusual, some function of device be affected, for example in the reality test, run into, when protocol massages is unusual, cause restarting of device.Therefore, present method of testing subject matter is can not system, comprehensively examines or check the consistency that agreement realizes, brings hidden danger for the interconnection between physical device.
Summary of the invention
Task of the present invention provides a kind of MODBUS-RTU protocol conformance test method, solves the problem of testing the realization of an authentication function in the past and ignoring agreement test itself.
For finishing above-mentioned task, in the present invention, utilize realization that the protocol test instrument checks agreement whether with conformance to standard, utilize tester to apply of ac, the auxiliary checking of finishing application function and data correctness, content measurement comprises the checking of uniformity test, application function and the data correctness of agreement, and wherein testing protocol consistency comprises the proper testing of link layer, function code, data field and negates test.This method of testing has provided system of Modbus-RTU agreement, comprehensive content measurement and method of testing, and guarantee agreement is realized that consistency and interoperability have very important significance.
The concrete steps of MODBUS-RTU protocol conformance test method of the present invention are as follows:
The first step: fill in Modbus-RTU protocol conformance statement table;
Second step: according to Fig. 1 test system building;
The 3rd step: communication interface test;
The 4th step: communication baud rate test;
The 5th step: link layer test;
The 6th step: the proper testing of function code 01 (read coil);
The 7th step: the negative test of function code 01 (read coil);
The 8th step: the proper testing of function code 02 (reading the discrete magnitude input);
The 9th step: the negative test of function code 02 (reading the discrete magnitude input);
The tenth step: the proper testing of function code 03 (reading to keep register);
The 11 step: the negative test of function code 03 (reading to keep register);
The 12 step: the proper testing of function code 04 (reading input register);
The 13 step: the negative test of function code 04 (reading input register);
The 14 step: the proper testing of function code 05 (writing single coil);
The 15 step: the negative test of function code 05 (writing single coil);
The 16 step: the proper testing of function code 06 (writing single register);
The 17 step: the negative test of function code 06 (writing single register);
The 18 step: the proper testing of function code 07 (reading abnormality);
The 19 step: the proper testing of function code 08 (diagnostic function);
The 20 step: the negative test of function code 08 (diagnostic function);
The 21 step: the proper testing of function code 11 (obtaining the communication event counter);
The 22 step: the proper testing of function code 12 (obtaining the communication event record)
The 23 step: the proper testing of function code 15 (writing a plurality of coils);
The 24 step: the negative test of function code 15 (writing a plurality of coils);
The 25 step: the proper testing of function code 16 (writing a plurality of registers);
The 26 step: the negative test of function code 16 (writing a plurality of registers);
The 27 step: the proper testing of function code 17 (report substation ID);
The 28 step: the proper testing of function code 20/6 (reading file logging);
The 29 step: the negative test of function code 20/6 (reading file logging);
The 30 step: the proper testing of function code 21/6 (written document record);
The 31 step: the negative test of function code 21/6 (written document record);
The 32 step: the proper testing of function code 22 (masked-write register);
The 33 step: the negative test of function code 22 (masked-write register);
The 34 step: the proper testing of function code 23 (a plurality of registers of read/write);
The 35 step: the negative test of function code 23 (a plurality of registers of read/write);
The 36 step: the proper testing of function code 24 (reading fifo queue);
The 37 step: the negative test of function code 24 (reading fifo queue);
The 38 step: the proper testing of function code 43/14 (reading device identification);
The 39 step: function code 43/14 (reading device identification) negates test;
The 40 step: the not test of support function sign indicating number;
The 41 step: the test of data field;
The 42 step: the test of application function;
The 43 step: the test of data correctness.
In detail comprehensively content measurement has been formulated in the invention of this method of testing, and utilize special protocol test instrument to help through testing protocol consistency, content measurement comprises the checking of uniformity test, application function and the data correctness of agreement, and wherein testing protocol consistency comprises the proper testing of link layer, function code, data field and negates test.This method of testing has provided system of Modbus-RTU agreement, comprehensive content measurement and method of testing, and guarantee agreement is realized that consistency and interoperability have very important significance.
Major advantage of the present invention is as follows:
1) content measurement is comprehensive, and content measurement comprises the checking of uniformity test, application function and the data correctness of agreement, and wherein testing protocol consistency comprises the proper testing of link layer, function code, data field and negates test.This method of testing has provided system of Modbus-RTU agreement, comprehensive content measurement and method of testing, comes guarantee agreement to realize consistency and interoperability;
2) special modbus-RTU protocol test instrument uses special protocol test instrument more to help finding mistake in the protocol massages.
Description of drawings
Fig. 1 is a test event table of the present invention;
Fig. 2 is test system structure figure of the present invention;
Fig. 3 is a Modbus-RTU protocol conformance statement table of the present invention.
Embodiment
This method of testing mainly comprises the following aspects:
1) content measurement
A) transmission mode is mainly examined or check in link layer test, the message frame form, and address field, check code and link transmission state guarantee that at link layer device can provide correct response, and can normally move under the normal and abnormal conditions;
B) form of function code and the requirement whether transmission course satisfies standard are mainly examined or check in function code test, and when function code was unusual, whether device can exception response;
C) form of data field and the requirement whether data satisfy standard are mainly examined or check in data field test;
D) application function test, on the basis that protocol conformance realizes, whether examination device application function is correctly realized;
E) data correctness test, on the basis that protocol conformance realizes, whether the data of sending on the examination device are correct.
Detailed test item is seen for oneself Fig. 1 table.
2) protocol test instrument
The protocol test instrument can send the various command frame according to the needs simulation of test, receives the response frame of equipment under test, and message is carried out analysis and judgement.
3) test system structure figure sees Fig. 2
4) protocol conformance test method
A) at first equipment under test need provide the communication protocol explanation and fill in Modbus-RTU protocol conformance statement table, Modbus-RTU protocol conformance statement table is the basis of whole testing protocol consistency, a lot of test events are to select according to the content of Declaration of Consistency, and Modbus-RTU protocol conformance statement table is seen appendix;
B) according to Fig. 2 test system building;
C) communication interface of tape deck;
D) traffic rate of adjustment protocol test instrument is consistent with the traffic rate of equipment under test, utilizes testing tool to send correct order, checks the communication message that equipment under test is responded, and detects and whether supports this traffic rate; According to MODBUS-RTU protocol conformance statement table, the traffic rate of each support of retest;
E) link layer test:
I) utilize the protocol test instrument to send correct communication message, comprise correct address, correct frame format, correct check code checks whether the frame format that can equipment under test correctly respond and respond is correct;
Ii) utilize in the communication message of protocol test instrument transmission, address error checks whether equipment under test does not respond;
The frame format unusual (multibyte or few byte) of iii) utilizing the protocol test instrument to send checks whether equipment under test abandons this frame information;
The check code mistake of iv) utilizing the protocol test instrument to send checks whether equipment under test abandons this frame;
V) utilize the protocol test instrument to send the broadcasting command of read command, check whether equipment under test responds;
Vi) utilize the protocol test instrument to send the broadcasting command of write order, check whether equipment under test responds.
F) function code test
The test of function code mainly is divided into the test of support function sign indicating number and the test of non-support function sign indicating number, can learn according to MODBUS-RTU protocol conformance statement table which function code equipment under test supports.
I) proper testing of support function sign indicating number
(1) proper testing of function code 01 (read coil), protocol test instrument sending function sign indicating number 01 reads 1-2000 continuous coil state, checks whether equipment under test is responded with function code 01, and goes up the sending coil current state; If the coil quantity of returning is not 8 multiple, will be with the remaining bit of zero padding final data byte (until high order end of byte);
(2) proper testing of function code 02 (read discrete magnitude input), protocol test instrument send with function code 02 and read 1-2000 continuous discrete magnitude input state, check whether equipment under test is responded with function code 02, and on send discrete magnitude to import current state; If the input quantity of returning is not 8 multiple, will be with the remaining bit (high order end of byte always) of zero padding final data byte;
(3) proper testing of function code 03 (reading to keep register), protocol test instrument sending function sign indicating number 03 reads one or more maintenance register currencys, check whether equipment under test is responded with function code 03, and on send the register currency, the register data in response message is packaged into each register two bytes;
(4) proper testing of function code 04 (reading input register), protocol test instrument sending function sign indicating number 03 reads one or more maintenance register currencys, check whether equipment under test is responded with function code 03, and on send the register currency, the register data in response message is packaged into each register two bytes;
(5) proper testing of function code 05 (writing single coil), protocol test instrument sending function sign indicating number the last 05 put the on off operating mode of a coil, and equipment under test is responded the frame message identical with claim frame behind the write coil state;
(6) proper testing of function code 06 (writing single register), the value that protocol test instrument sending function sign indicating number 06 is put single register checks whether equipment under test responds the frame message identical with claim frame after writing the content of register;
(7) proper testing of function code 07 (reading abnormality), protocol test instrument sending function sign indicating number 07 reads the content of 8 abnormality outputs, check whether equipment under test responds with function code 07, and in response frame, comprise the content of 8 abnormalities output, these outputs are packaged into a byte, each position of abnormality output;
(8) proper testing of function code 08 (diagnostic function), protocol test instrument sending function sign indicating number 08 provides a series of tests, be used for checking the communication system between main website and the substation or the various error states of substation, in claim frame, comprise a sub-function code and define the performed test-types in substation, check equipment under test whether application function sign indicating number 08 and the subfunction sign indicating number response identical with claim frame;
(9) proper testing of function code 11 (obtaining the communication event counter), protocol test instrument sending function sign indicating number 11 obtains status word and event count from equipment under test communication event counter, check whether equipment under test responds with function code 11;
(10) proper testing of function code 12 (obtaining the communication event record), protocol test instrument sending function sign indicating number 12 obtains status word, event count, packet counting and an incident byte field from equipment under test, checks whether equipment under test uses function code 12 responses;
(11) proper testing of function code 15 (writing a plurality of coils), protocol test instrument sending function sign indicating number 15 is put the on off operating mode of a plurality of coils, check whether application function sign indicating number 15 of equipment under test, the same in the register address that comprises in the response frame, register quantity and the claim frame;
(12) proper testing of function code 16 (writing a plurality of registers), the value that protocol test instrument sending function sign indicating number 16 is put a plurality of continuous registers, check whether application function sign indicating number 16 responses of equipment under test, the same in the register address that comprises in the response frame, register quantity and the received frame;
(13) proper testing of function code 17 (report substation ID), protocol test instrument sending function sign indicating number 17 reads the specific type specification of equipment under test, current state and other information, check whether equipment under test responds with function code 17, and in response frame, comprise equipment under test ID, operation indicating status and additional data;
(14) proper testing of function code 20/6 (reading file logging), protocol test instrument sending function sign indicating number 20 reads file logging, check that whether application function sign indicating number 20/6 responds equipment under test, comprises each sub-request responding (" 6 " refer to parameter type) in response frame;
(15) proper testing of function code 21/6 (written document record), protocol test instrument sending function sign indicating number 21/6 writes file logging, checks whether application function sign indicating number 21/6 responds equipment under test, and normal response is duplicate (" 6 " expression parameter type) of request;
(16) proper testing of function code 22 (masked-write register), protocol test instrument sending function sign indicating number 22 masked-write registers check whether application function sign indicating number 22 responds equipment under test, and normal response is duplicating of request;
(17) proper testing of function code 23 (a plurality of registers of read/write), protocol test instrument sending function sign indicating number 23 is finished the combination of read operation and write operation, checks whether application function sign indicating number 23 responds equipment under test, and normal response should comprise institute's read register data;
(18) proper testing of function code 24 (reading fifo queue), protocol test instrument sending function sign indicating number 24 reads first-in first-out in the equipment under test (FIFO) register queue content, this function can be read 32 registers at most: counting adds the data register of maximum 31 formations, checks whether equipment under test responds with function code 24;
(19) proper testing of function code 43/14 (reading device identification), protocol test instrument sending function sign indicating number 43/14 reads physics sign and the additional information relevant with functional description of equipment under test, wherein 14 expression MEI types check whether equipment under test responds with function code 43;
The ii) negative test of support function sign indicating number
(1) the negative test of function code 01 (read coil)
Figure G2008101413985D00091
Protocol test instrument sending function sign indicating number 01 read coil quantity is not in 1~2000 scope, check whether equipment under test gives an exception response with function code 81H, and it is invalid to comprise the coil quantity that an abnormality code 03 expression reads in response frame, i.e. the invalid data value;
Figure G2008101413985D00092
Protocol test instrument sending function sign indicating number 01 reads the coil state of one group of invalid address, checks whether equipment under test gives an exception response with function code 81H, and comprises an abnormality code 02 represent it is illegal data address in response frame;
(2) the negative test of function code 02 (reading the discrete magnitude input)
Figure G2008101413985D00093
Protocol test instrument sending function sign indicating number 02 reads discrete magnitude input quantity not in 1~2000 scope, check whether equipment under test gives an exception response with function code 82H, and it is invalid to comprise the discrete magnitude input quantity that an abnormality code 03 expression reads in response frame, i.e. the invalid data value;
Figure G2008101413985D00094
Protocol test instrument sending function sign indicating number 02 reads the discrete magnitude input state of one group of invalid address, checks whether equipment under test gives an exception response with function code 82H, and comprises an abnormality code 02 represent it is illegal data address in response frame;
(3) the negative test of function code 03 (reading to keep register)
Figure G2008101413985D00095
The maintenance register quantity that protocol test instrument sending function sign indicating number 03 reads is not in 1~125 scope, check whether equipment under test gives an exception response with function code 83H, and it is invalid to comprise the maintenance register quantity that an abnormality code 03 expression reads in response frame, i.e. the invalid data value;
Figure G2008101413985D00096
Protocol test instrument sending function sign indicating number 03 reads one group of invalid address and keeps the register currency, checks whether equipment under test gives an exception response with function code 83H, and comprises an abnormality code 02 represent it is illegal data address in response frame;
(4) the negative test of function code 04 (reading input register)
Figure G2008101413985D00101
The input register quantity that protocol test instrument sending function sign indicating number 04 reads is not in 1~125 scope, check whether equipment under test gives an exception response with function code 84H, and it is invalid to comprise the input register quantity that an abnormality code 03 expression reads in response frame, i.e. the invalid data value;
Figure G2008101413985D00102
Protocol test instrument sending function sign indicating number 04 reads one group of invalid address input register currency, checks whether equipment under test gives an exception response with function code 84H, and comprises an abnormality code 02 represent it is illegal data address in response frame;
(5) the negative test of function code 05 (writing single coil)
Figure G2008101413985D00103
When the on off operating mode of protocol test instrument sending function sign indicating number 05 write coil is not " 0000 " or " FF00 ", check whether equipment under test gives an exception response with function code 85H, and the on off operating mode that comprises an abnormality code 03 expression coil in response frame is invalid, i.e. the invalid data value;
Figure G2008101413985D00104
Protocol test instrument sending function sign indicating number the last 05 put the on off operating mode of an invalid address coil, checks whether equipment under test gives an exception response with function code 85H, and comprises an abnormality code 02 represent it is illegal data address in response frame;
Protocol test instrument sending function sign indicating number 05 write order, if expendable mistake appears in equipment under test when attempting to handle request, check whether equipment under test gives an exception response with function code 85H, and in response frame, comprise an exception code 04 expression equipment under test fault;
(6) the negative test of function code 06 (writing single register)
Figure G2008101413985D00106
The register value that protocol test instrument sending function sign indicating number 06 writes is not in the scope that equipment under test allows the time, check whether equipment under test gives an exception response with function code 86H, and comprising an exception code 03 expression at response frame, to write the value of register invalid, i.e. the invalid data value;
The value that protocol test instrument sending function sign indicating number 06 is put an invalid address register checks whether equipment under test gives an exception response with function code 86H, and comprises an abnormality code 02 represent it is illegal data address in response frame;
(7) the negative test of function code 08 (diagnostic function)
Figure G2008101413985D00111
Protocol test instrument sending function sign indicating number 08 provides invalid data field, checks whether equipment under test gives exception response with function code 88H, and it is invalid to comprise an abnormality code 03 expression data field in response frame;
(8) the negative test of function code 15 (writing a plurality of coils)
Figure G2008101413985D00112
The coil quantity that protocol test instrument sending function sign indicating number 15 writes is not in 1~1968 scope, check whether equipment under test gives an exception response with function code 8FH, and it is invalid to comprise an exception code 03 expression register quantity in response frame, i.e. the invalid data value;
Figure G2008101413985D00113
Protocol test instrument sending function sign indicating number 15 is put the on off operating mode of an invalid address coil, checks whether equipment under test gives an exception response with function code 8FH, and comprise an abnormality code 02 invalid data address in response frame;
(9) the negative test of function code 16 (writing a plurality of registers)
The register quantity that protocol test instrument sending function sign indicating number 16 writes is not in 1~123 scope or byte count when being not equal to 2 times of register quantity, check whether equipment under test gives an exception response with function code 90H, and it is invalid to comprise an abnormality code 03 expression register quantity in response frame, i.e. the invalid data value;
Figure G2008101413985D00115
Protocol test instrument sending function sign indicating number 16 is put an invalid address register value, checks whether equipment under test gives an exception response with function code 90H, and comprise an abnormality code 02 invalid data address in response frame;
(10) the negative test of function code 20/6 (reading file logging)
Figure G2008101413985D00116
The byte count that protocol test instrument sending function sign indicating number 20/6 reads checks whether equipment under test gives an exception response with function code 94H not in 7~245 scopes, and it is invalid to comprise an exception code 03 expression byte count in response frame;
Figure G2008101413985D00117
In the initial address that protocol test instrument sending function sign indicating number 20/6 reads, parameter type, document number and the record quantity any one or several invalid, check whether equipment under test gives an exception response with function code 94H, and in response frame, comprise an abnormality code 02 expression invalid data address;
(11) the negative test of function code 21/6 (written document record)
Figure G2008101413985D00121
The byte count that protocol test instrument sending function sign indicating number 21/6 writes is not in 7~245 scopes, check whether equipment under test gives an exception response with function code 95H, and it is invalid to comprise an abnormality code 03 expression register quantity in response frame, i.e. the invalid data value;
Figure G2008101413985D00122
In the initial address that protocol test instrument sending function sign indicating number 21/6 writes, parameter type, document number and the record quantity any one or several when invalid, check whether equipment under test gives an exception response with function code 95H, and in response frame, comprise an abnormality code 02 expression invalid data address;
(12) the negative test of function code 22 (masked-write register)
Figure G2008101413985D00123
Protocol test instrument sending function sign indicating number 22, in the claim frame " and_mask " or " r_mask " when invalid, check whether equipment under test gives an exception response with function code 96H, and in response frame, comprise an abnormality code 03 and represent the invalid data value;
Figure G2008101413985D00124
During invalid address register of protocol test instrument sending function sign indicating number 22 shieldings, check whether equipment under test gives an exception response with function code 96H, and in response frame, comprise an abnormality code 02 expression invalid data address;
(13) the negative test of function code 23 (a plurality of registers of read/write)
Figure G2008101413985D00125
The quantity that protocol test instrument sending function sign indicating number 23 reads register not in the 1-125 scope or the register quantity that writes not in 1~121 scope or to write byte number be not to write 2 times of register quantity to check whether equipment under tests give an exception response with function code 97H, and it is invalid to comprise an abnormality code 03 expression register quantity in response frame, i.e. the invalid data value;
Figure G2008101413985D00126
Protocol test instrument sending function sign indicating number 23 reads the register of invalid address or writes the register of invalid address, check whether equipment under test gives an exception response with function code 97H, and in response frame, comprise an abnormality code 02 expression invalid data address;
(14) the negative test of function code 24 (reading fifo queue)
Figure G2008101413985D00131
The quantity that protocol test instrument sending function sign indicating number 24 reads fifo register checks whether equipment under test gives exception response with function code 98H not between 0~31, and comprises an abnormality code 03 expression invalid data value in response frame;
Figure G2008101413985D00132
Protocol test instrument sending function sign indicating number 24 reads the fifo register of an invalid address, checks whether equipment under test gives exception response with function code 98H, and comprises an abnormality code 02 expression invalid data address in response frame;
(15) the negative test of function code 43/14 (reading device identification)
Figure G2008101413985D00133
The protocol test instrument sends when reading an invalid device id, checks whether equipment under test gives an exception response with function code abH, and comprises an abnormality code 03 represent the invalid data value in response frame;
Figure G2008101413985D00134
When the protocol test instrument sends an invalid object ID, check whether equipment under test gives an exception response with function code abH, and in response frame, comprise an abnormality code 02 and represent the invalid data address;
The iii) not test of support function sign indicating number, utilize the protocol test instrument to send the arbitrary unsupported function code of equipment under test, check whether equipment under test carries out exception response, function code in the exception response is the function code of 80H+ request, and comprises the illegal function of an abnormality code 01 expression in response frame;
G) data field test utilizes the protocol test instrument to send correct command frame, checks whether data field in the message of equipment under test response satisfies the requirement of standard;
Whether h) application function test according to the application function that equipment under test in the communication protocol explanation is supported, checks each application function can correctly finish;
I) data correctness test at first needs to utilize tester to apply of ac to equipment under test, utilizes the protocol test instrument to send command frame then, checks whether the data of sending on the equipment under test are correct.
5) testing protocol consistency step
The first step: fill in Modbus-RTU protocol conformance statement table;
Second step: according to Fig. 1 test system building;
The 3rd step: communication interface test;
The 4th step: communication baud rate test;
The 5th step: link layer test;
The 6th step: the proper testing of function code 01 (read coil);
The 7th step: the negative test of function code 01 (read coil);
The 8th step: the proper testing of function code 02 (reading the discrete magnitude input);
The 9th step: the negative test of function code 02 (reading the discrete magnitude input);
The tenth step: the proper testing of function code 03 (reading to keep register);
The 11 step: the negative test of function code 03 (reading to keep register);
The 12 step: the proper testing of function code 04 (reading input register);
The 13 step: the negative test of function code 04 (reading input register);
The 14 step: the proper testing of function code 05 (writing single coil);
The 15 step: the negative test of function code 05 (writing single coil);
The 16 step: the proper testing of function code 06 (writing single register);
The 17 step: the negative test of function code 06 (writing single register);
The 18 step: the proper testing of function code 07 (reading abnormality);
The 19 step: the proper testing of function code 08 (diagnostic function);
The 20 step: the negative test of function code 08 (diagnostic function);
The 21 step: the proper testing of function code 11 (obtaining the communication event counter);
The 22 step: the proper testing of function code 12 (obtaining the communication event record)
The 23 step: the proper testing of function code 15 (writing a plurality of coils);
The 24 step: the negative test of function code 15 (writing a plurality of coils);
The 25 step: the proper testing of function code 16 (writing a plurality of registers);
The 26 step: the negative test of function code 16 (writing a plurality of registers);
The 27 step: the proper testing of function code 17 (report substation ID);
The 28 step: the proper testing of function code 20/6 (reading file logging);
The 29 step: the negative test of function code 20/6 (reading file logging);
The 30 step: the proper testing of function code 21/6 (written document record);
The 31 step: the negative test of function code 21/6 (written document record);
The 32 step: the proper testing of function code 22 (masked-write register);
The 33 step: the negative test of function code 22 (masked-write register);
The 34 step: the proper testing of function code 23 (a plurality of registers of read/write);
The 35 step: the negative test of function code 23 (a plurality of registers of read/write);
The 36 step: the proper testing of function code 24 (reading fifo queue);
The 37 step: the negative test of function code 24 (reading fifo queue);
The 38 step: the proper testing of function code 43/14 (reading device identification);
The 39 step: function code 43/14 (reading device identification) negates test;
The 40 step: the not test of support function sign indicating number;
The 41 step: the test of data field;
The 42 step: the test of application function;
The 43 step: the test of data correctness.

Claims (1)

1. a MODBUS-RTU protocol conformance test method is characterized in that, the step of this method is as follows:
The first step: fill in Modbus-RTU protocol conformance statement table;
Second step: test system building;
The 3rd step: communication interface test;
The 4th step: communication baud rate test;
The 5th step: link layer test;
The 6th step: the proper testing of function code 01 read coil;
The 7th step: the negative test of function code 01 read coil;
The 8th step: function code 02 is read the proper testing of discrete magnitude input;
The 9th step: function code 02 is read the negative test of discrete magnitude input;
The tenth step: function code 03 reads to keep the proper testing of register;
The 11 step: function code 03 reads to keep the negative test of register;
The 12 step: function code 04 is read the proper testing of input register;
The 13 step: function code 04 is read the negative test of input register;
The 14 step: function code 05 is write the proper testing of single coil;
The 15 step: function code 05 is write the negative test of single coil;
The 16 step: function code 06 is write the proper testing of single register;
The 17 step: function code 06 is write the negative test of single register;
The 18 step: function code 07 reads the proper testing of abnormality;
The 19 step: the proper testing of function code 08 diagnostic function;
The 20 step: the negative test of function code 08 diagnostic function;
The 21 step: function code 11 obtains the proper testing of communication event counter;
The 22 step: function code 12 obtains the proper testing of communication event record;
The 23 step: function code 15 is write the proper testing of a plurality of coils;
The 24 step: function code 15 is write the negative test of a plurality of coils;
The 25 step: function code 16 is write the proper testing of a plurality of registers;
The 26 step: function code 16 is write the negative test of a plurality of registers;
The 27 step: the proper testing of function code 17 report substation ID;
The 28 step: function code 20/6 is read the proper testing of file logging;
The 29 step: function code 20/6 is read the negative test of file logging;
The 30 step: the proper testing of function code 21/6 written document record;
The 31 step: the negative test of function code 21/6 written document record;
The 32 step: the proper testing of function code 22 masked-write registers;
The 33 step: the negative test of function code 22 masked-write registers;
The 34 step: the proper testing of a plurality of registers of function code 23 read/write;
The 35 step: the negative test of a plurality of registers of function code 23 read/write;
The 36 step: function code 24 is read the proper testing of fifo queue;
The 37 step: function code 24 is read the negative test of fifo queue;
The 38 step: function code 43/14 is read the proper testing of device identification;
The 39 step: it negates test that function code 43/14 is read device identification;
The 40 step: the not test of support function sign indicating number;
The 41 step: the test of data field;
The 42 step: the test of application function;
The 43 step: the test of data correctness.
CN2008101413985A 2008-09-17 2008-09-17 MODBUS-RTU protocol conformance test method Withdrawn - After Issue CN101677277B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008101413985A CN101677277B (en) 2008-09-17 2008-09-17 MODBUS-RTU protocol conformance test method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008101413985A CN101677277B (en) 2008-09-17 2008-09-17 MODBUS-RTU protocol conformance test method

Publications (2)

Publication Number Publication Date
CN101677277A CN101677277A (en) 2010-03-24
CN101677277B true CN101677277B (en) 2011-07-20

Family

ID=42029701

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008101413985A Withdrawn - After Issue CN101677277B (en) 2008-09-17 2008-09-17 MODBUS-RTU protocol conformance test method

Country Status (1)

Country Link
CN (1) CN101677277B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103376777B (en) * 2012-04-13 2016-03-16 珠海格力电器股份有限公司 The method of testing of the Modbus communication interface of controller and host computer
CN103077114B (en) * 2012-12-27 2016-02-17 武汉烽火富华电气有限责任公司 Based on the automated testing method of temperature measuring equipment communication protocol
CN105599255A (en) * 2016-01-14 2016-05-25 宁波长飞亚塑料机械制造有限公司 Communication method for injection molding machine controller and auxiliary units
CN109167701B (en) * 2018-08-22 2021-11-05 国电南瑞科技股份有限公司 Consistency checking method, device and system for power distribution automation standardization extension communication protocol
CN109873737B (en) * 2019-01-31 2020-10-09 杭州迪普科技股份有限公司 Test method and device
CN110381035A (en) * 2019-06-25 2019-10-25 北京威努特技术有限公司 Network security test method, device, computer equipment and readable storage medium storing program for executing
CN111431781A (en) * 2020-03-16 2020-07-17 深圳益邦物联科技有限公司 Passive monitoring system and method based on bus transmission and electronic equipment
CN112822083B (en) * 2021-01-25 2022-03-01 华电通用轻型燃机设备有限公司 MODBUS application layer-oriented data verification method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6260065B1 (en) * 1999-01-13 2001-07-10 International Business Machines Corporation Test engine and method for verifying conformance for server applications
CN1758627A (en) * 2005-10-27 2006-04-12 上海微电子装备有限公司 Control method for realizing data soft-change communication using DPRAM as medium
CN101174920A (en) * 2007-09-30 2008-05-07 中兴通讯股份有限公司 Series-connection monitoring sink and its implementing method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6260065B1 (en) * 1999-01-13 2001-07-10 International Business Machines Corporation Test engine and method for verifying conformance for server applications
CN1758627A (en) * 2005-10-27 2006-04-12 上海微电子装备有限公司 Control method for realizing data soft-change communication using DPRAM as medium
CN101174920A (en) * 2007-09-30 2008-05-07 中兴通讯股份有限公司 Series-connection monitoring sink and its implementing method

Also Published As

Publication number Publication date
CN101677277A (en) 2010-03-24

Similar Documents

Publication Publication Date Title
CN101677277B (en) MODBUS-RTU protocol conformance test method
CN107222362A (en) A kind of vehicle CAN network automatic test platform and its optimization method
CN103675526B (en) Prudential sub-station test system
CN102393738A (en) Diagnostic device and test method of automobile electronic control unit (ECU)
CN103873324A (en) Universal bus testing system
CN103516462B (en) A kind of non-standard Canopen is from the Frame sending method of node and device
CN105162649A (en) Testing method and system for nuclear power station safety level network performance index
JP2011186817A (en) Device and method for verifying logic
CN104123212A (en) System test method of USB chip
CN103532686B (en) Serial data transmission circuit and control method thereof with line sequence self-adaptive
CN102662843B (en) A kind of method for testing software of Simulated Spacecraft unit exception
CN101661552A (en) Non-contact IC card radio frequency protocol and application testing method
CN107102637A (en) A kind of method that bus signals failure simulation device based on CAN produces fault-signal
CN204188189U (en) A kind of flexible embedded equipment under test simulator
US20060268724A1 (en) Using Open Vera Assertions to verify designs
CN101727375A (en) System and method for testing new-generation peripheral component interconnect express
JP4736135B2 (en) Internal bus analysis system for inter-card communication, method and program
CN103995475A (en) Flexible embedded type tested device simulator
CN115658411B (en) Excitation generator and excitation generating method
CN102722592A (en) Universal digital information recording device and method
Sumec Software tool for verification of sampled values transmitted via IEC 61850-9-2 protocol
JP7495907B2 (en) Telegram conversion system and telegram conversion method
CN201117094Y (en) Cable testing system
CN115658413B (en) Excitation generator and excitation generating method
CN203133819U (en) 1553B bus detection system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract

Assignee: HENAN XJ INTELLIGENT CONTROL TECHNOLOGY Co.,Ltd.

Assignor: XUCHANG KETOP ELECTRICAL APPARATUS TESTING & Research Institute

Contract record no.: 2012410000028

Denomination of invention: MODBUS-RTU protocol conformance test method

Granted publication date: 20110720

License type: Exclusive License

Open date: 20100324

Record date: 20120321

C56 Change in the name or address of the patentee

Owner name: XUCHANG KAIPU DETECTION TECHNOLOGY CO., LTD.

Free format text: FORMER NAME: XUCHANG KETOP ELECTRIC TESTING INSTITUTE

CP03 Change of name, title or address

Address after: The northern section of Xuchang City Road 461000 Henan Longxiang

Patentee after: XUCHANG KETOP TESTING TECHNOLOGY CO.,LTD.

Address before: No. 1706 Xuchang City, Henan province 461000 XJ Avenue

Patentee before: XUCHANG KETOP ELECTRICAL APPARATUS TESTING & Research Institute

EM01 Change of recordation of patent licensing contract

Change date: 20140815

Contract record no.: 2012410000028

The licensee after: HENAN XJ INTELLIGENT TECHNOLOGY CO.,LTD.

The licensee before: HENAN XJ INTELLIGENT CONTROL TECHNOLOGY Co.,Ltd.

Change date: 20140815

Contract record no.: 2012410000028

Licensor after: XUCHANG KETOP TESTING TECHNOLOGY CO.,LTD.

Licensor before: XUCHANG KETOP ELECTRICAL APPARATUS TESTING & Research Institute

LICC Enforcement, change and cancellation of record of contracts on the licence for exploitation of a patent or utility model
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: Xuchang City, Henan Province, located at the intersection of 461000 Avenue and Suntech Wei Wu

Patentee after: XUCHANG KETOP TESTING RESEARCH INSTITUTE CO.,LTD.

Address before: The northern section of Xuchang City Road 461000 Henan Longxiang

Patentee before: XUCHANG KETOP TESTING TECHNOLOGY CO.,LTD.

AV01 Patent right actively abandoned
AV01 Patent right actively abandoned
AV01 Patent right actively abandoned

Granted publication date: 20110720

Effective date of abandoning: 20240409

AV01 Patent right actively abandoned

Granted publication date: 20110720

Effective date of abandoning: 20240409