System and method for testing RS485 bus in DCS (Distributed Control System) of nuclear power plant

By designing the RS485 bus test system in the DCS system of a nuclear power plant, and using the tester to monitor and calculate the RS485 bus data response frame, the problem of difficulty in testing the packet loss rate of the high-speed RS485 bus in the existing technology is solved, and efficient and real-time testing efficiency and packet analysis are achieved.

CN119520347APending Publication Date: 2025-02-25CHINA NUCLEAR CONTROL SYST ENG
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411612164.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

It is difficult for the prior art to effectively test the packet loss rate of the high-speed RS485 bus, especially in the DCS control system of nuclear power plants, traditional test tooling cannot meet the high-speed communication needs of 5MHz and above.

Method used

A RS485 bus test system in a nuclear power plant DCS system is designed, including a first controller, a tester, a chassis, a terminal resistor and an IO module. The tester calculates the packet loss rate by monitoring the data response frame on the RS485 bus, and parses, stores, judges, calculates and stores the data packets.

Benefits of technology

It realizes the online capture of 5MHz high-speed RS485 bus communication packets, automatically compares the correctness of the data packets, improves the testing efficiency, and classifies and saves correct and incorrect data packets for offline analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119520347A_ABST
    Figure CN119520347A_ABST
Patent Text Reader

Abstract

The invention discloses an RS485 bus test system and method in a DCS system of a nuclear power plant, and relates to the field of bus testing, in the system, a first controller is used for sending a data inquiry frame to an RS485 bus and receiving a data response frame of the RS485 bus; the IO module is used as a load of the RS485 bus, and sends a data response frame to the RS485 bus after receiving the data inquiry frame sent by the first controller; the first case is used for providing an electrical working environment; the terminal resistor is applied to normal work of the RS485 bus; the tester is used for monitoring a data response frame on the RS485 bus and calculating a packet loss rate; and the RS485 bus is subjected to message analysis according to a bus protocol, and the corresponding RS485 bus message is temporarily stored, judged, calculated and stored. According to the invention, the efficiency, the real-time performance and the safety of the high-speed RS485 bus packet loss rate test can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of bus testing, and in particular to a system and method for testing an RS485 bus in a DCS system of a nuclear power plant. Background Art

[0002] The packet loss rate of high-speed RS485 bus refers to the proportion of data that cannot be forwarded due to network performance problems. The test method is that the sender sends a certain traffic load to the receiver through the link under test, and tests the proportion of data frame loss at the receiver.

[0003] RS485 bus communication is only carried out on a pair of twisted pairs, using half-duplex working mode. During bus transmission, the transmission rate is inversely proportional to the transmission distance. The maximum transmission rate of RS485 bus is 10MHz, and the DCS control system of nuclear power plants uses a transmission rate of 5MHz.

[0004] In the DCS control system of a nuclear power plant, the high-speed RS485 bus needs to carry more than 70 nodes to work at full load. The nodes include a controller as the RS485 bus master and several IO nodes as RS485 slaves. The master station visits all slaves one by one and polls all slaves, so the load on the RS485 bus is quite large.

[0005] In the specific environment where the DCS control system of a nuclear power plant uses a high-speed RS485 bus for data transmission, in order to verify the reliability of the RS485 bus of the DCS product, a stable means of testing the packet loss rate of the high-speed RS485 bus is required.

[0006] The current general test tooling can test the RS485 bus at a maximum of 1MHz. However, in response to the demand for the existing high-speed RS485 bus, it is urgent to provide a high-speed RS485 bus packet loss rate testing method or system that can ensure data reliability and real-time performance on the basis of achieving a performance leap. Summary of the invention

[0007] The purpose of this application is to provide a system and method for testing RS485 bus in a DCS system of a nuclear power plant, which can improve the efficiency, real-time performance and safety of high-speed RS485 bus packet loss rate testing.

[0008] To achieve the above objectives, this application provides the following solutions:

[0009] In a first aspect, the present application provides an RS485 bus test system in a nuclear power plant DCS system, wherein the RS485 bus test system in the nuclear power plant DCS system comprises: a first controller, a tester, a first chassis, a plurality of terminal resistors and a plurality of IO modules;

[0010] The first controller is used to send a data inquiry frame to the RS485 bus and receive a data response frame from the RS485 bus;

[0011] The IO module is used as the load of the RS485 bus, and after receiving the data inquiry frame sent by the first controller, it sends a data response frame to the RS485 bus;

[0012] The first chassis is used to provide an electrical working environment;

[0013] The terminal resistor is used when the RS485 bus is working normally;

[0014] The tester is used to monitor the data response frames on the RS485 bus and calculate the packet loss rate; and to parse the RS485 bus messages according to the bus protocol and to temporarily store, judge, calculate and store the corresponding RS485 bus messages.

[0015] Optionally, the tester specifically includes: a second controller, a second chassis, a communication module, a first interface, a second interface, a third interface, a first cable and a second cable;

[0016] The second controller and the second chassis provide a working environment for the communication module;

[0017] The second controller is equipped with WINDOWS10 operating system and bus packet loss rate test software; the bus packet loss rate test software is used to compare the correctness of the data packets of the RS485 bus online, calculate the packet loss rate, and classify and save the correct data packets and the error data packets;

[0018] The communication module is used to receive the data response frame of the RS485 bus and convert the data response frame into a hexadecimal digital message;

[0019] The first interface is used as a data receiving port of the communication module, responsible for receiving the RS485 signal of the third interface;

[0020] The second interface is used to provide a connection interface for computer peripherals;

[0021] The third interface is used to provide an external connection port for the RS485 bus;

[0022] The first cable is used to provide a connection path between the first interface and the second interface;

[0023] The second cable is used to provide a connection path between the computer peripheral device and the second interface.

[0024] Optionally, the first interface is a DB9 type D-type connector.

[0025] Optionally, the RS485 bus of the communication module works in half-duplex mode.

[0026] Optionally, the baud rate of the data inquiry frame is 10 MH, the word length is 8 bits, the stop bit is 1 bit, the start bit is 1 bit, and there is no check bit.

[0027] Optionally, a PCB backplane device is installed inside the first chassis.

[0028] In a second aspect, the present application provides a method for testing an RS485 bus in a nuclear power plant DCS system, which is applied to the RS485 bus testing system in the nuclear power plant DCS system. The RS485 bus testing method in the nuclear power plant DCS system includes:

[0029] Initialize the RS485 bus and communication module;

[0030] Configure the serial port parameters of the communication module and the storage depth of the serial port read buffer;

[0031] Use the serial port channel of the communication module to start receiving RS485 bus data and temporarily store it in the serial port read buffer; when the amount of received data is equal to the storage depth, stop receiving;

[0032] Interpret RS485 bus data, calculate packet loss rate and transfer.

[0033] Optionally, the RS485 bus data is read, the packet loss rate is calculated, and the data is transferred, specifically including the following formula:

[0034]

[0035] Among them, K represents the number of normal data packets, and L represents the number of abnormal data packets.

[0036] Optionally, data transfer specifically includes:

[0037] Create a worksheet;

[0038] Assign values ​​to the row numbers of the worksheet and assign values ​​to the column numbers of the worksheet;

[0039] Determine the cell according to the row number and column number of the worksheet, activate the cell, and write the data to be written in the data packet into the cell;

[0040] Save the worksheet where the data is written.

[0041] According to the specific embodiments provided in this application, this application has the following technical effects:

[0042] The present application provides a test system and method for the RS485 bus in the DCS system of a nuclear power plant. The tester monitors the data response frame on the RS485 bus and calculates the packet loss rate; the RS485 bus is parsed according to the bus protocol and the corresponding RS485 bus message is temporarily stored, judged, calculated and stored; the 5MHz high-speed RS485 bus communication data packet is captured online, and the correctness of the data packet is automatically compared, which improves the test efficiency compared with the manual comparison by the naked eye. The correct data packet and the error data packet of the 5MHz high-speed RS485 bus communication are classified and transferred to facilitate offline analysis of the data. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0044] Figure 1 This is a schematic diagram of the structure of an RS485 bus test system in a nuclear power plant DCS system in one embodiment of the present application;

[0045] Figure 2 It is a schematic diagram of the tester structure;

[0046] Figure 3 This is the software structure diagram of the tester's lower computer;

[0047] Figure 4 This is the block diagram of the data packet detection unit of the tester host computer;

[0048] Figure 5 This is the flow chart of RS485 bus host computer test software;

[0049] Figure 6 Save the program flow chart for RS485 bus data packets. DETAILED DESCRIPTION

[0050] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0051] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0052] In an exemplary embodiment, Figure 1 As shown, a RS485 bus test system in a nuclear power plant DCS system is provided, the system comprising: a first controller, a tester, a first chassis, a plurality of terminal resistors and a plurality of IO modules;

[0053] The first controller is used to send a data inquiry frame to the RS485 bus and receive a data response frame from the RS485 bus;

[0054] The IO module is used as the load of the RS485 bus, and after receiving the data inquiry frame sent by the first controller, it sends a data response frame to the RS485 bus;

[0055] The first chassis is used to provide an electrical working environment;

[0056] The terminal resistor is used when the RS485 bus is working normally;

[0057] The tester is used to monitor the data response frames on the RS485 bus and calculate the packet loss rate; and to parse the RS485 bus messages according to the bus protocol and to temporarily store, judge, calculate and store the corresponding RS485 bus messages.

[0058] like Figure 2 As shown, the tester specifically includes: a second controller, a second chassis, a communication module, a first interface, a second interface, a third interface, a first cable and a second cable;

[0059] The second controller and the second chassis provide a working environment for the communication module;

[0060] The second controller is equipped with WINDOWS10 operating system and bus packet loss rate test software; the bus packet loss rate test software is used to compare the correctness of the data packets of the RS485 bus online, calculate the packet loss rate, and classify and save the correct data packets and the error data packets;

[0061] The communication module is used to receive the data response frame of the RS485 bus and convert the data response frame into a hexadecimal digital message;

[0062] The first interface is used as a data receiving port of the communication module, responsible for receiving the RS485 signal of the third interface;

[0063] The second interface is used to provide a connection interface for computer peripherals;

[0064] The third interface is used to provide an external connection port for the RS485 bus;

[0065] The first cable is used to provide a connection path between the first interface and the second interface;

[0066] The second cable is used to provide a connection path between the computer peripheral device and the second interface.

[0067] In an exemplary embodiment, a PCB backplane, an RS485 bus, terminal resistor 1, and terminal resistor 2 are installed inside the first chassis and arranged on the PCB backplane, and the RS485 bus includes a bus positive terminal and a bus negative terminal. An IO module connection port is installed on the PCB board inside the first chassis. The first controller is installed in the controller slot of the first chassis; IO modules 1 to IO modules N are installed in the IO module slots of the first chassis; the tester is connected to the third interface of the first chassis through the receiving port of the first interface; the first controller and IO modules 1 to IO modules N normally communicate via RS485 bus, and the communication rate is 5MHz;

[0068] The communication sequence is:

[0069] a. The first controller sends an inquiry message to the IO module 1; the IO module 1 replies with a response message to the first controller;

[0070] b The first controller sends an inquiry message to the IO module 2; the IO module 2 replies with a response message to the first controller;

[0071] c. The first controller sends an inquiry message to the IO module N; the IO module N replies with a response message to the first controller;

[0072] d. Repeat steps a, b, and c in a loop;

[0073] A PCB backplane is installed inside the second chassis, and an IO module connection port is installed on the PCB board inside the second chassis. The second controller is installed in the controller slot of the second chassis. The communication module is installed in the IO module slot of the second chassis. One end of the first interface is installed on the front panel connector of the communication module. The other end of the first interface is connected to the third interface of the first chassis through a first cable. The second interface is connected to the second controller of the second chassis. The computer peripheral is connected to the second interface of the second chassis through a second cable.

[0074] The first controller is a DCS bus controller for a nuclear power plant. The bus is a basic underlying RS485 bus, PROFIBUS bus, and MODBUS bus. The first controller acts as an RS485 bus master station, sends a data inquiry frame to the RS485 bus slave station IO module and receives a data response frame from the RS485 bus. The characteristics of the controller sending the RS485 data inquiry frame may be a baud rate of 10MHz, a word length of 8 bits, a stop bit of 1 bit, a start bit of 1 bit, and no check bit. The RS485 bus works in half-duplex mode.

[0075] IO module 1 to IO module N can be N IO modules of the same type. After receiving the data inquiry frame from the controller, the IO module sends a data response frame to the RS485 bus. N is the maximum number of IO module loads that can be connected to the RS485 bus.

[0076] The first chassis is a chassis with a metal structure, and a PCB backplane device is installed inside the first chassis. The IO module is installed on the backplane and can also be fixed on the chassis structure.

[0077] Terminal resistor 1 is the terminal resistor on the left side of the RS485 bus, installed on the left side of the RS485 bus controller. Terminal resistor 2 is the terminal resistor on the right side of the RS485 bus, installed on the right side of the RS485 bus tester. The terminal resistor is the resistance when the RS485 bus is working normally, and there are detailed requirements in the RS485 electrical interface specification. The resistance value of terminal resistor 1 and terminal resistor 2 can be 120Ω.

[0078] The tester is a RS485 bus slave computer, which monitors the data frames on the RS485 bus and calculates the packet loss rate.

[0079] The second controller is an embedded system controller. The second controller and the second chassis provide a working environment for the communication module. The second controller is installed with WINDOWS10 operating system and bus packet loss rate test software.

[0080] The bus packet loss rate test software is a WINDOWS installation program that can work under WINDOWS10 system. The bus packet loss rate software writing platform can be LabWindows / CVI, C#, LabVIEW, VC++, etc.

[0081] The communication module is an RS485 communication module, which can be a high-speed digital IO module programmed with FPGA. The communication module has the function of receiving RS485 data through multiple channels. The parameters can be set according to the parameter characteristics of the object under test. The communication module parameters can be baud rate 10MHz, word length 8 bits, stop bit 1 bit, start bit 1 bit, no parity bit. The working mode of the RS485 bus of the communication module can be half-duplex. After the communication module receives the RS485 bus data, it first passes through the lower computer data stream for data bit analysis, and then passes through the upper computer data stream for data reading and processing. The upper computer program and the lower computer program are written in LabView software.

[0082] The first interface is a data receiving port of the communication module, which is generally a DB9 type D-type connector.

[0083] The second interface is the peripheral interface of the second controller, such as a USB port, a DP display interface, etc.

[0084] The third interface is the RS485 bus interface under test, which is an RS485 bus external connection port independent of the first chassis under test. The third interface is fixed on the first chassis and has a physical connection relationship with the RS485 bus under test. The third interface can be a DB9 type D-type connector.

[0085] The first cable is a connecting cable connecting the first interface of the communication module and the third interface of the RS485 bus to be tested, and includes three connecting wires, which are defined as the positive end of the RS485 bus, the negative end of the RS485 bus, and the common end of the RS485 bus.

[0086] The second cable is a connection cable connecting the second interface of the tester and the computer peripherals, generally a mouse cable, a keyboard cable and a display cable.

[0087] Based on the same inventive concept, the embodiment of the present application also provides a method for testing the RS485 bus in the DCS system of a nuclear power plant for implementing the RS485 bus test system in the DCS system of a nuclear power plant involved above. The implementation scheme for solving the problem provided by the method is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of the RS485 bus test method in the DCS system of a nuclear power plant provided below can refer to the limitations of the RS485 bus test system in the DCS system of a nuclear power plant above, and will not be repeated here.

[0088] In an exemplary embodiment, a method for testing an RS485 bus in a nuclear power plant DCS system is provided, comprising:

[0089] S101, initializing the RS485 bus and communication module;

[0090] After the RS485 bus is initialized to the first chassis powered on, the RS485 bus works in half-duplex mode. The first controller sends an inquiry data frame to IO module 1, and IO module 1 sends a response data frame to the first controller. And so on, finally, controller N sends an inquiry data frame to IO module 1, and IO module N sends a response data frame to the first controller.

[0091] like Figure 3 As shown in the figure, RS485 bus data is transmitted to the FPGA unit through the high-speed IO data receiving port at a rate of 5MHz, and after the data bit data integration of the FPGA unit, it is sent to the data receiving buffer and waits for the host computer to read. The FPGA unit detects the RS485 data transmitted to the high-speed IO data receiving port at a baud rate of 40MHz. Each transmitted RS485 data includes 1 start bit, 8 data bits, and 1 stop bit, a total of 10 bits.

[0092] Taking the first bit as an example, the baud rate of the FPGA unit is 8 times the baud rate of the RS485 bus. Therefore, on the first bit with a duration of T, the FPGA unit has 8 moments t1 to t8 to sample. In order to ensure the stability of the sampled data and avoid the influence of interference signals at moments t1 to t4 and t6 to t8 on the data, the present invention only samples the level of the first bit at moment t5. After the sampling of 10 bits is completed, 1 start bit and 1 stop bit are discarded, and 8 bits of data are transmitted to the data receiving buffer, waiting for the host computer to read.

[0093] The communication module is initialized to establish a connection after the test program and the communication module shake hands through the VISA function. After successful initialization, the generated communication module operation handle can be "Slot5_PXI39::12::INSTR", indicating that the communication module is inserted in the 5th slot of the PXI bus chassis. Subsequent programs can complete the parameter configuration of the communication module, start / stop receiving, exit and other operations by manipulating the communication module handle.

[0094] If the hardware interface is initialized successfully, the test program enters the next process; if the interface initialization fails, the program reinitializes until the initialization is successful.

[0095] like Figure 4 and Figure 5 As shown, the upper computer receives data from the lower computer data receiving buffer, intercepts the data packet according to the set storage depth; enters the data packet detection unit, identifies the master station inquiry packet and the slave station response packet according to the RS485 data protocol format; after the data packet is identified, each data packet is verified according to the RS485 protocol format of the data packet. The verification content includes whether the frame header and frame tail are complete, whether the data frame length is correct, and whether the check code is correct. A master station inquiry packet and a corresponding slave station response packet are a group of message pairs. Separate the correct RS485 bus data packets and the wrong RS485 bus data packets and save them in the test program cache; after the verification is completed, count the number of correct data packets and the number of wrong data packets, and calculate the packet loss rate.

[0096] S102, configuring the serial port parameters of the communication module and the storage depth of the serial port read buffer;

[0097] The test program configures the communication module serial port parameters and the serial port read buffer storage depth D. The communication module serial port parameters are consistent with the RS485 bus parameters. The communication module serial port parameters can select the communication module 1 channel as the data monitoring channel, baud rate 5MHz, start bit 1 bit, word length 8 bits, check bit none, stop bit 1 bit.

[0098] S103, using the serial port channel of the communication module to start receiving RS485 bus data, and temporarily storing it in the serial port read buffer; when the amount of received data is equal to the storage depth, stop receiving;

[0099] The maximum value of the serial port buffer storage depth D varies according to the different storage depths of the communication module, and can be 1KB to 10MB. During the data monitoring process of the data module, when the size of the serial port buffer meets the set value D, the serial port buffer flag is set to 1, notifying the program to proceed to the next operation.

[0100] The monitoring data can be the communication module serial port channel to start receiving RS485 bus data and temporarily store it in the serial port read buffer. When the amount of received data is equal to the storage depth setting value, the reception stops. The program stores the data from the serial port buffer into a two-dimensional array of data packets.

[0101] S104, reading the RS485 bus data, calculating the packet loss rate and transferring the data.

[0102] The RS485 bus data query frame format is shown in Table 1:

[0103] Table 1

[0104]

[0105] The RS485 bus data response frame format is shown in Table 2:

[0106] Table 2

[0107]

[0108] The data in the two-dimensional array of data packets are divided into M groups according to the combination of one inquiry frame and one response frame. The data before the first group and the data after the Mth group are incomplete data frame combinations and are discarded.

[0109] The communication module and RS485 bus are both half-duplex working mode, and the first controller cannot communicate with IO module 1 to IO module N at the same time. The first controller can only communicate with a certain IO module first, send an inquiry frame to the IO module, and then wait for the response frame of the IO module within the specified time T. Similarly, the controller polls all IO modules on the RS485 bus in turn. Therefore, the data on the RS485 bus is a combination of M groups of 1 inquiry frame plus 1 response frame. The specified time T can be 0.5ms or 1ms.

[0110] The value of M varies depending on the serial port buffer setting value D. The larger D is, the larger M is, and the longer the program runs.

[0111] (1) The first step in data packet interpretation is to find the first group of inquiry data frames.

[0112] Use the one-dimensional array search function to find the frame header, and the function returns the index number A of the frame header. The frame header is a byte of hexadecimal data defined by the RS485 bus user.

[0113] According to the RS485 bus frame format, the index number of the length is A+1. Use the index array function to find the length value, and the function return value is the length value. The length value in the frame format is the number of all bytes B between the length and the check code, excluding the length and the check code. Therefore, the index number of the frame end is A+B+3.

[0114] According to the index number of the frame tail, use the index array function to find the frame tail, and the function return value is the frame tail value.

[0115] If the frame header value and frame tail value are both correct, the frame is the first query data frame. If the frame tail value is wrong, discard A array elements to form a new array and continue to search for the frame header and frame tail.

[0116] (2) The second step of data packet interpretation is to search for the first group of response data frames. The search process is the same as the first step.

[0117] (3) The third step of data packet interpretation is to determine the correctness of the first set of response data frames.

[0118] Find the index values ​​of address 1, address 2, address 3, and address 4. Use the index array function to find the data values ​​of address 1, address 2, address 3, and address 4 based on the index values. Compare the data values ​​to determine whether address 1 is equal to address 4 and whether address 2 is equal to address 3.

[0119] If they are equal, the first group of data frames is normal and no packets are lost. The first group of data frames is written into the two-dimensional array X with no packets lost for temporary storage, and the number of normal data packets J = J + 1. If they are not equal, the first group of data frames is abnormal. The first group of data frames is written into the two-dimensional array Y with packets lost for temporary storage, and the number of abnormal data packets K = K + 1.

[0120] Address 1 and address 2 are the source address and destination address of the inquiry data frame, and address 3 and address 4 are the source address and destination address of the response data frame. The source address and destination address of each group of data frames have opposite values, that is, address 1 is equal to address 4, and address 2 is equal to address 3.

[0121] Repeat the first step to the third step to determine the second to Mth groups of data frames.

[0122] The RS485 bus packet loss rate calculation formula can be:

[0123] Among them, K represents the number of normal data packets, and L represents the number of abnormal data packets.

[0124] Install the EXCEL application on the computer operating system. Create an EXCEL template file in a specified location on the computer. The EXCEL template can be saved in D:\Data Packet Transfer Worksheet Template.xlsx. The implementation method of data packet transfer can be to use the EXCEL interface function to compile an automated script to transfer the data in the non-packet loss two-dimensional array X and the packet loss two-dimensional array Y to a local EXCEL file.

[0125] Data packet transfer specifically includes:

[0126] (1) Create a worksheet: The program opens the EXCEL template file in the specified path in the operating system background and obtains the EXCEL workbook (ExcelWorkbook) operation handle. The specified path can be D:\Data Packet Transfer Worksheet Template.xlsx.

[0127] After the workbook is successfully opened, EXCEL tries to open the worksheet and obtain the EXCEL worksheet (ExcelWorksheet) operation handle. The function prototype of EXCEL opening the worksheet can be Excel_SheetsItem (CAObjHandleobjectHandle, ERRORINFO*errorInfo, VARIANT index, CAObjHandle*returnValue). The data packet is transferred to the first worksheet of the EXCEL template, so the index value in the function prototype is 1.

[0128] If the EXCEL workbook / worksheet is opened and activated without error, the program will proceed to the next step. If an error occurs, the program will handle the error and try to open the workbook / worksheet again. Error handling can be to prompt an error window or to close all EXCEL processes and try to reopen the workbook.

[0129] (2) Assignment of worksheet row number: From which row of the worksheet the message is transferred and assigned an initial value. In this embodiment, the initial value of the worksheet row number is 1, and the maximum value of the worksheet row number is M.

[0130] (3) Assignment of worksheet column number: From which column of a specified row of the worksheet does the message start to be transferred and assigned an initial value. In this embodiment, the initial value of the worksheet column number is A, and the maximum value of the worksheet column number is B+4.

[0131] (4) Worksheet writing: Determine the cell according to the row number and column number of the active worksheet, activate the cell, and write the data to be written in the data packet into the active cell. The data to be written in the data packet can be the data in the 0th row and 0th column of the two-dimensional array without packet loss.

[0132] Write all the data from row 0, column 1 to row 0, column B+3 in the data packet into the active cell of the active worksheet in sequence. The row and column numbers of the array are both represented by Arabic numerals. The positioning method of the cells in the EXCEL worksheet is different from that of the array. The row number of the active cell in EXCEL is represented by Arabic numerals, while the column number of the active cell in EXCEL is represented by uppercase English letters. For example: A1::A1 represents the active cell in row 1, column A, and AA1::AA1 represents row 1, column AA. The mapping relationship between the number of columns i in the EXCEL table and the number of columns j in the two-dimensional array of the data packet is shown in Table 3:

[0133] Table 3

[0134]

[0135] After writing the first row of data in the worksheet, start writing the data of each of the remaining rows in sequence. Finally, write all the data from row M, column 1 to row M, column B+3 in the data packet into the active cell of the active worksheet in sequence.

[0136] (5) Save worksheet: Name the currently active worksheet according to the current system time plus the data packet status of the operating system, and save the currently active worksheet to the specified path.

[0137] Follow the above steps - create a worksheet ~ save the worksheet, and save the data in the packet loss two-dimensional array.

[0138] (6) Clean up memory: Close the operation handles created by the program one by one. After exiting the application, clean up the application process in the Task Manager.

[0139] like Figure 6 As shown, after the calculation of the packet loss rate is completed, the data packet saving process is entered to save the correct RS485 bus data packets and the wrong RS485 bus data packets respectively.

[0140] a. Save the correct data packet

[0141] In the WINDOWS system, EXCEL software is pre-installed. Use the EXCEL interface function in the LABVIEW software to create an EXCEL worksheet. Take the first group of message pairs in the correct data packet in the program cache as an example. The first group of message pairs is the first row, and the first byte of RS485 data is the first column. Write them in the first row of the EXCEL worksheet in sequence. Write the second group of message pairs in the second row of the EXCEL worksheet until all the message pairs in the cache are saved. After saving the worksheet, clean up the memory and the test is completed.

[0142] b. Save error data packets

[0143] Save data stream with correct data packets.

[0144] This application has the following effects:

[0145] 1. This application realizes the online capture of 5MHz high-speed RS485 bus communication data packets and automatically compares the correctness of the data packets, which improves the test efficiency compared with manual comparison by the naked eye.

[0146] 2. This application realizes the classification of correct data packets and error data packets of 5MHz high-speed RS485 bus communication, and saves the data packets into EXCEL tables after online capture, which is convenient for offline analysis of data.

[0147] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0148] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. An RS485 bus test system in a nuclear power plant DCS system, characterized in that: The RS485 bus test system in the nuclear power plant DCS system comprises: a first controller, a tester, a first chassis, a plurality of terminal resistors and a plurality of IO modules; The first controller is used to send a data inquiry frame to the RS485 bus and receive a data response frame from the RS485 bus; The IO module is used as the load of the RS485 bus, and after receiving the data inquiry frame sent by the first controller, it sends a data response frame to the RS485 bus; The first chassis is used to provide an electrical working environment; The terminal resistor is used when the RS485 bus is working normally; The tester is used to monitor the data response frames on the RS485 bus and calculate the packet loss rate; and to parse the RS485 bus messages according to the bus protocol and to temporarily store, judge, calculate and store the corresponding RS485 bus messages.

2. The RS485 bus test system in the DCS system of a nuclear power plant according to claim 1, characterized in that: The tester specifically comprises: a second controller, a second chassis, a communication module, a first interface, a second interface, a third interface, a first cable and a second cable; The second controller and the second chassis provide a working environment for the communication module; The second controller is equipped with WINDOWS10 operating system and bus packet loss rate test software; the bus packet loss rate test software is used to compare the correctness of the data packets of the RS485 bus online, calculate the packet loss rate, and classify and save the correct data packets and the error data packets; The communication module is used to receive the data response frame of the RS485 bus and convert the data response frame into a hexadecimal digital message; The first interface is used as a data receiving port of the communication module, responsible for receiving the RS485 signal of the third interface; The second interface is used to provide a connection interface for computer peripherals; The third interface is used to provide an external connection port for the RS485 bus; The first cable is used to provide a connection path between the first interface and the second interface; The second cable is used to provide a connection path between the computer peripheral device and the second interface.

3. The RS485 bus test system in the DCS system of a nuclear power plant according to claim 2, characterized in that: The first interface is a DB9 type D-type connector.

4. The RS485 bus test system in the DCS system of a nuclear power plant according to claim 2, characterized in that: The working mode of the RS485 bus of the communication module is half-duplex mode.

5. The RS485 bus test system in the DCS system of a nuclear power plant according to claim 1, characterized in that: The baud rate of the data inquiry frame is 10 MH, the word length is 8 bits, the stop bit is 1 bit, the start bit is 1 bit, and there is no check bit.

6. The RS485 bus test system in the DCS system of a nuclear power plant according to claim 1, characterized in that: A PCB backplane device is installed inside the first chassis.

7. A method for testing RS485 bus in a nuclear power plant DCS system, applied to the RS485 bus testing system in a nuclear power plant DCS system according to any one of claims 1 to 6, characterized in that: The RS485 bus testing method in the nuclear power plant DCS system includes: Initialize the RS485 bus and communication module; Configure the serial port parameters of the communication module and the storage depth of the serial port read buffer; Use the serial port channel of the communication module to start receiving RS485 bus data and temporarily store it in the serial port read buffer; when the amount of received data is equal to the storage depth, stop receiving; Interpret RS485 bus data, calculate packet loss rate and transfer.

8. The RS485 bus testing method in the DCS system of a nuclear power plant according to claim 7, characterized in that: The RS485 bus data is read, the packet loss rate is calculated, and the data is transferred, specifically including the following formula: Among them, K represents the number of normal data packets, and L represents the number of abnormal data packets.

9. The RS485 bus testing method in the DCS system of a nuclear power plant according to claim 7, characterized in that: Data transfer specifically includes: Create a worksheet; Assign values ​​to the row numbers of the worksheet and assign values ​​to the column numbers of the worksheet; Determine the cell according to the row number and column number of the worksheet, activate the cell, and write the data to be written in the data packet into the cell; Save the worksheet where the data is written.

Citation Information

Cited By

  • Distributed control system and control network

    CN120378465A

  • Serial port bus ICD missing-oriented test method

    CN120639652A