CN110489843A - A method of simulation radiation measuring instrument data feedback - Google Patents

A method of simulation radiation measuring instrument data feedback Download PDF

Info

Publication number
CN110489843A
CN110489843A CN201910733991.7A CN201910733991A CN110489843A CN 110489843 A CN110489843 A CN 110489843A CN 201910733991 A CN201910733991 A CN 201910733991A CN 110489843 A CN110489843 A CN 110489843A
Authority
CN
China
Prior art keywords
data
message
serial ports
simulation
instrument
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.)
Pending
Application number
CN201910733991.7A
Other languages
Chinese (zh)
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.)
Jiangsu Nuclear Power Corp
Original Assignee
Jiangsu Nuclear Power Corp
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 Jiangsu Nuclear Power Corp filed Critical Jiangsu Nuclear Power Corp
Priority to CN201910733991.7A priority Critical patent/CN110489843A/en
Publication of CN110489843A publication Critical patent/CN110489843A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Abstract

The invention discloses a kind of methods for simulating radiation measuring instrument data feedback, comprising the following steps: S1, software interface initialization: creation QFile object, the readLine () method of calling read the data of simulation register and its storage line by line;S2, read configuration file: creation QSetting object calls its value () method to obtain the config.ini file content of storage basic configuration information;S3, initialization serial ports: creation QSerialPort com object calls its open (QIODevice::ReadWrite) method to open serial ports;S4, signal triggering: connect () signal and slot function are enabled, verified, analyzed and is replied automatically whenever receiving data.The present invention is the functionality and stability of sufficiently test acquisition interface program, some functional and stability optimizations have also been made in simulation instrument, as a simulation instrument can simulate one or more instrument, to carry out Road test to interface routine, simulation instrument can ensure stable operation at least 720 hours after code optimization, establish solid foundation for the stability test of upper interface routine.

Description

A method of simulation radiation measuring instrument data feedback
Technical field
The present invention relates to simulation instrument technical field more particularly to a kind of simulation radiation measuring instrument data feedbacks Method.
Background technique
Radiation detector is for measuring high energy, low energy x, gamma-ray instrument.R-PD type intelligence х-γ radiation gauge is adopted Use highly sensitive scintillation crystal as detector, reaction speed is fast, for monitoring various radiation work place x, gamma-rays, spoke Penetrate the special instrument of dosage rate.
But due to the Radiation monitoring instrument of industry spot it is expensive and it is inconvenient lend, occupy progress for a long time at the scene The exploitation of host computer is also unpractical with test.Therefore, in order to ensure that the stabilization as small as possible for influencing field device is normally transported Row carries out the exploitation of simulation softward to former instrument, is very necessary.
Summary of the invention
Technical problems based on background technology, the present invention propose a kind of simulation radiation measuring instrument data feedback Method, for the functionality and stability of sufficiently test acquisition interface program, simulation instrument has also been made some functional and steady Qualitatively optimization, such as a simulation instrument can simulate one or more instrument, to carry out Road test to interface routine, imitate True instrument can ensure stable operation at least 720 hours after code optimization, be that the stability test of upper interface routine is established Solid foundation.
A kind of method for simulating radiation measuring instrument data feedback proposed by the present invention, comprising the following steps:
S1, software interface initialization: creation QFile object, the readLine () method of calling read simulation register line by line With the data of its storage;
S2, read configuration file: creation QSetting object calls its value () method to obtain storage basic configuration letter The config.ini file content of breath;
S3, initialization serial ports: creation QSerialPort object calls the side its open (QIODevice::ReadWrite) Method opens serial ports;
S4, signal triggering: connect () signal and slot function are enabled, verified, analyzed automatically whenever receiving data And reply;
S5, serial ports message checking: serial data decompose temporarily using unsigned char type array w_buff [] It deposits, the data before extracting check bit carry out CRC16 verification, compare with verification place value, illustrate that this message has if equal Effect;
S6, message data analysis: according to standard modbusRTU agreement, report is extracted in the corresponding position of w_buff array Literary functional areas and data zone content specify this message demand:
S7, message data processing: what is such as received is that multiregister reads instruction, according to the scale collection interface in data field Value in upper correlation lineEdit control, is organized into standard modbus message and feeds back to serial ports.
Preferably, in the step S1, when reading the data of simulation register and its storage line by line, pass through FindChildren<QLineEdit*>method traverses all LineEdit controls, and simulation register data is updated on interface LineEdit control in, and hide extra LineEdit control.
Preferably, in the step S3, open serial ports after, respectively call setBaudRate (), setDataBits (), SetParity (), setStopBits () and setFlowControl () method carry out initial configuration to serial ports.
Preferably, in the step S6, when such as functional areas data being 03, indicate that multiregister is read, read range checks When data zone content such as functional areas data is 06, indicates single register write-in, place is written and value checks data field.
Preferably, in the step S7, what is such as received is single register write instruction, then is posted according to specified in data field Storage and value, modify the value on interface in corresponding lineEdit control, and the successfully modified message received of replying afterwards indicates to be modified as Function.
The invention has the advantages that;
It 1, is the stability and accuracy of real-time accurately verify data transmission, by sliding block and directly in modification control Numerical value, so that it may modify to the data of simulation instrument storage;
2, in addition timer has also been added to go to modify certain keys in simulation instrument dynamically to see data variation in real time Data;
It 3, is the functionality and stability of sufficiently testing acquisition interface program, simulation instrument has also been made some functional and steady Qualitatively optimization, such as a simulation instrument can simulate one or more instrument, to carry out Road test to interface routine, imitate True instrument can ensure stable operation at least 720 hours after code optimization, be that the stability test of upper interface routine is established Solid foundation;
4, the software is developed using Qt, based on the powerful professional platform independence of Qt, relative to other development platforms, the software source codes Can in the several operation systems such as Windows, Linux, Android compilation run;
5, for user convenience, two interfaces of the software design, main interface mainly consider that aesthetics designs: using LCD mode is shown data, can be manually changed using HorizontalSlider numerical values recited and with combBox simulated failure shape State, hiding interface can be recalled by the button " ChangeView " in main interface, hidden interface and mainly considered functional and can grasp The property made design: doing the display of real-time packet using textBrowser, and the storage of data is done using multiple lineEdit.
Detailed description of the invention
Fig. 1 software allomeric function architecture diagram;
Fig. 2 is txt file content example;
Fig. 3 is the analysis diagram of txt file;
Fig. 4 is software main interface figure;
Fig. 5 is software main inside logical flow chart.
Specific embodiment
Combined with specific embodiments below the present invention is made further to explain.
A method of simulation radiation measuring instrument data feedback, comprising the following steps:
S1, software interface initialization: creation QFile object, the readLine () method of calling read simulation register line by line With its storage data, line by line read simulation register and its storage data when, using findChildren < QLineEdit* > method traverses all lineEdit, and simulation register data is updated in the LineEdit control on interface, And hide extra LineEdit control;
S2, read configuration file: creation QSetting object calls its value () method to obtain storage basic configuration letter The config.ini file content of breath;
S3, initialization serial ports: creation QSerialPort object calls the side its open (QIODevice::ReadWrite) Method open serial ports, open serial ports after, respectively call setBaudRate (), setDataBits (), setParity (), SetStopBits () and setFlowControl () method carry out initial configuration to serial ports;
S4, signal triggering: connect () signal and slot function are enabled, verified, analyzed automatically whenever receiving data And reply;
S5, serial ports message checking: serial data decompose temporarily using unsignedchar type array w_buff [] It deposits, the data before front verification position carry out CRC16 verification, compare with verification place value, illustrate that this message has if equal Effect;
S6, message data analysis: according to standard modbusRTU agreement, report is extracted in the corresponding position of w_buff array Literary functional areas and data zone content specify this message demand, as functional areas data be 03 when, indicate multiregister read, read It takes range to check data zone content, when such as functional areas data being 06, indicates single register write-in, place is written and value checks data Area;
S7, message data processing: what is such as received is that multiregister reads instruction, according to the scale collection interface in data field Value in upper correlation lineEdit control, is organized into standard modbus message and feeds back to serial ports, and what is such as received is single register Write instruction modifies the value on interface in corresponding lineEdit control, modification then according to the specified register and value in data field The message received is replied after success indicates successfully modified.
The major function of software: the final goal of the software is really to simulate the working method of field instrument as far as possible, Therefore its major function is exactly to reply and execute the inquiry or writing commands of host computer.
Software detailed functions explanation and its framework: on the basis of really simulation field instrument working method as far as possible, Some optimizations have also been made in the simulation instrument on aesthetics and practicability.
Txt file analysis and generation: pass through the analysis to communication packet between original system slave, it is determined that former instrument master Want data storage area and Stored Data Type.For true simulation field instrument as far as possible, we to the data of message kind into Row arranges, and generates txt configuration file MGP.txt, configuration file general contents are as shown in Figure 2.
Txt file is read and parsing: first major function of software starting is exactly to read, parse and store txt file Interior data and signal are illustrated in figure 3 unloading and display in the hiding interface of the simulation software to txt file content.
It hides the initialization at interface: not only containing the multiple lineEdit controls in right side in interface as shown in figure 3, hiding Significant data interface display, there are also the real-time packet display functions in the textbrowser control of the left side.It in addition is realization number According to automatic variation, we are provided with timer to part lineEdit, realize to the real-time dynamic changes of data in control.
The initialization of software main interface: software main interface is based primarily upon aesthetics and practicable design, and software main interface is such as Shown in Fig. 4, the control of similar instrumentation display window mainly uses multiple round edges of LCD control and painter method drawing in figure Rectangle stacks.Instrument shows that the horizontal slider below control is that customized doubleSlider can by adjusting slider Change the data value in instrument display control.It is the data state info update module based on combBox control below sliding block, it can By selecting different status informations, the current instrument operating status of host computer is fed back to.
Software main inside logic flow
As a slave computer software based on serial ports modbus agreement, the major function of the software is exactly to serial data Reception and processing.
The software is to reception and the process flow of serial ports message as shown in figure 5, using serialRead method in serial ports Data received and kept in.
Message arrange using check method and CRC16 is verified, if verification passes through, illustrate to receive is one Correct modbus downward message.
All lineEdit text controls are traversed, and value is taken out from corresponding LineEdit.
If modbus downward message function code is that " 03 " inquires multiregister, method MGPdata is executed, to lineEdit Interior data are collected, and application method analysis is packaged write-in serial ports to data.
If modbus downward message function code is that " 06 " writes single register, method analysis2 is executed, corresponding The new data of write-in in register.
If modbus downward message function code is that " 16 " write multiple registers, method analysis3 is executed, corresponding The new data of write-in in multiple registers.
The foregoing is only a preferred embodiment of the present invention, but scope of protection of the present invention is not limited thereto, Anyone skilled in the art in the technical scope disclosed by the present invention, according to the technique and scheme of the present invention and its Inventive concept is subject to equivalent substitution or change, should be covered by the protection scope of the present invention.

Claims (5)

1. it is a kind of simulate radiation measuring instrument data feedback method, feature the following steps are included:
S1, software interface initialization: creation QFile object, the readLine () method of calling read simulation register and its line by line The data of storage;
S2, read configuration file: creation QSetting object calls its value () method to obtain storage basic configuration information Config.ini file content;
S3, initialization serial ports: creation QSerialPort object calls its open (QIODevice::ReadWrite) method to open Open serial ports;
S4, signal triggering: connect () signal and slot function are enabled, verified, analyzed and is returned automatically whenever receiving data It is multiple;
S5, serial ports message checking: serial data decompose using unsignedchar type array w_buff [] and is kept in, is mentioned Data before preceding check bit carry out CRC16 verification, compare with verification place value, illustrate that this message is effective if equal;
S6, message data analysis: according to standard modbusRTU agreement, message function is extracted in the corresponding position of w_buff array Energy area and data zone content, specify this message demand:
S7, message data processing: what is such as received is that multiregister reads instruction, according to phase on the scale collection interface in data field The value in lineEdit control is closed, standard modbus message is organized into and feeds back to serial ports.
2. a kind of method for simulating radiation measuring instrument data feedback according to claim 1, which is characterized in that institute It states in step S1, when reading the data of simulation register and its storage line by line, uses findChildren<QLineEdit*> Method traverses all LineEdit controls, and simulation register data is updated in the LineEdit control on interface, and is hidden Extra control.
3. a kind of method for simulating radiation measuring instrument data feedback according to claim 1, which is characterized in that institute State in step S3, open serial ports after, respectively call setBaudRate (), setDataBits (), setParity (), SetStopBits () and setFlowControl () method carry out initial configuration to serial ports.
4. a kind of method for simulating radiation measuring instrument data feedback according to claim 1, which is characterized in that institute It states in step S6, when such as functional areas data being 03, indicates that multiregister is read, read range checks data zone content, such as function When area's data are 06, indicate single register write-in, place is written and value checks data field.
5. a kind of method for simulating radiation measuring instrument data feedback according to claim 1, which is characterized in that institute It states in step S7, what is such as received is single register write instruction, then according to the specified register and value in data field, modifies interface Value in upper corresponding lineEdit control, the successfully modified message received of replying afterwards indicate successfully modified.
CN201910733991.7A 2019-08-09 2019-08-09 A method of simulation radiation measuring instrument data feedback Pending CN110489843A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910733991.7A CN110489843A (en) 2019-08-09 2019-08-09 A method of simulation radiation measuring instrument data feedback

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910733991.7A CN110489843A (en) 2019-08-09 2019-08-09 A method of simulation radiation measuring instrument data feedback

Publications (1)

Publication Number Publication Date
CN110489843A true CN110489843A (en) 2019-11-22

Family

ID=68550479

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910733991.7A Pending CN110489843A (en) 2019-08-09 2019-08-09 A method of simulation radiation measuring instrument data feedback

Country Status (1)

Country Link
CN (1) CN110489843A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040204892A1 (en) * 2003-03-26 2004-10-14 Sweet James D. Testing of integrated circuits from design documentation
CN109471737A (en) * 2018-10-11 2019-03-15 同济大学 The software adaptation method and apparatus of high-speed magnetic floating operation control system HWIL simulation

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040204892A1 (en) * 2003-03-26 2004-10-14 Sweet James D. Testing of integrated circuits from design documentation
CN109471737A (en) * 2018-10-11 2019-03-15 同济大学 The software adaptation method and apparatus of high-speed magnetic floating operation control system HWIL simulation

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
孟开元等: "基于Modbus通信协议的油田RTU调试软件设计与实现", 《软件导刊》 *

Similar Documents

Publication Publication Date Title
CN109117518B (en) System and method for verifying read-write access of register
CN1716264B (en) Methods, systems for annotating system traces with control program information and presenting annotated system traces
CN108572823B (en) Front-end and back-end development management method and system based on interface engine
CN109408375B (en) Method and device for generating interface document
CN100514341C (en) Assertion testing program and method thereof
US7895575B2 (en) Apparatus and method for generating test driver
CN106126410B (en) The reminding method and device of code conflicts
US20090089688A1 (en) Generating test scenarios using reusable triggers indicating graphical user interface (gui) elements and actions
CN112270149A (en) Verification platform automation integration method and system, electronic equipment and storage medium
US11194596B2 (en) Simulating human interface interaction resilient to user interface changes
CN110249300A (en) The test case generator being built in data integration job stream editing machine
CN105468517B (en) A kind of mistake of statistics localization method based on Black-box testing Cases yojan
CN113407393B (en) Chip verification method, terminal device, verification platform and storage medium
CN110727580A (en) Response data generation method, full-flow interface data processing method and related equipment
CN102023869A (en) Control input value checking method and system
CN107770151A (en) A kind of enterprise&#39;s integrated work management system and its method
CN103514092A (en) Method for automatic testing of software system of ATM
CN109933326A (en) Rewrite Compilation Method, device and the corresponding terminal of code
CN109710523B (en) Visual draft test case generation method and device, storage medium and electronic equipment
CN113626326B (en) Dragging type zero code front end automatic test system based on image recognition
CN105335379A (en) Method and device for sorting combinations of mutants, test cases and random seeds in mutation testing
CN111552603A (en) Mobile payment machine tool testing method and testing system
CN115168229A (en) Coverage rate driven embedded software closed loop test platform and method
CN105897376B (en) Decoder decoding performance test method and device
CN109933770A (en) A kind of test report generation method, system and electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20191122

RJ01 Rejection of invention patent application after publication