CN112506759B - Automatic test method and device for servo system control software and storage medium - Google Patents

Automatic test method and device for servo system control software and storage medium Download PDF

Info

Publication number
CN112506759B
CN112506759B CN202011320815.XA CN202011320815A CN112506759B CN 112506759 B CN112506759 B CN 112506759B CN 202011320815 A CN202011320815 A CN 202011320815A CN 112506759 B CN112506759 B CN 112506759B
Authority
CN
China
Prior art keywords
instruction
test
control
character string
sub
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.)
Active
Application number
CN202011320815.XA
Other languages
Chinese (zh)
Other versions
CN112506759A (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.)
Sichuan Aerospace Fenghuo Servo Control Technology Co ltd
Original Assignee
Sichuan Aerospace Fenghuo Servo Control Technology Co ltd
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 Sichuan Aerospace Fenghuo Servo Control Technology Co ltd filed Critical Sichuan Aerospace Fenghuo Servo Control Technology Co ltd
Priority to CN202011320815.XA priority Critical patent/CN112506759B/en
Publication of CN112506759A publication Critical patent/CN112506759A/en
Application granted granted Critical
Publication of CN112506759B publication Critical patent/CN112506759B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Combined Controls Of Internal Combustion Engines (AREA)

Abstract

The application discloses an automatic test method and device for servo system control software and a computer readable storage medium. The method running on the labview platform comprises the following steps: a test case generation template is created that includes a front panel and a plurality of sub-VI's, which are steering engine signal conversion sub-VI's, checksum generation sub-VI's, instruction type identification sub-VI's, or table generation sub-VI's. Filling test parameters, test conditions and corresponding expected results of the items to be tested into corresponding positions of the front panel, and calling a labview character string connection tool and each sub-VI to automatically generate a test case instruction based on the instruction type; the instruction types include a regular instruction, a patrol instruction, and a splice instruction. When a test request is detected, corresponding test cases read from the test case table are automatically sent to the controller, and a test result is automatically generated according to test data fed back by the controller and a corresponding expected result, so that full-automatic test of the servo system control software is realized, and the test efficiency of the servo system control software is effectively improved.

Description

Automatic test method and device for servo system control software and storage medium
Technical Field
The present application relates to the field of software testing technologies, and in particular, to an automated testing method and apparatus for control software of a servo system, and a computer readable storage medium.
Background
The servo system is used as a feedback control system for accurately following or reproducing a certain process, and the servo system is an automatic control system which enables the output controlled quantity of the position, the azimuth, the state and the like of an object to follow any change of an input target or a given value. In a servo system, a steering engine can move according to the specified action of instructions, can actively identify the functions of an error instruction and the like, and is mainly controlled by control software, and whether a control software code can meet the task requirement is important. Therefore, it is essential for the test of the control software function, and the test software function generally needs to design test cases, and the test cases are generally classified into three types according to the different functions of the test: conventional instructions, inspection instructions and splicing instructions, wherein the conventional instructions further comprise: frame header errors, type ID errors, checksum errors, instruction disturbances, over-travel instructions. The designed test cases are then tested strip by strip.
In the related technology, in the process of carrying out software testing on the control software of the servo system, a software testing engineer is required to carry out design of test cases according to the testing function at first, and then the test is carried out piece by piece through a serial port assistant. Because the test cases are various, the test case writing time is long, the test process is repeated, the operation is complex, the labor consumption is increased, the efficiency is low, and in addition, when the test cases are written, calculation errors can occur, so that the test cases are inaccurate, and the code function cannot be normally tested.
In view of this, how to improve the test efficiency of the servo system control software test and effectively control the cost is a technical problem that needs to be solved by those skilled in the art.
Disclosure of Invention
The application provides an automatic test method and device for servo system control software and a computer readable storage medium, which realize the full-automatic test of the servo system control software, improve the test efficiency of the servo system control software and effectively control the cost.
In order to solve the technical problems, the embodiment of the application provides the following technical scheme:
in one aspect, the embodiment of the application provides an automated test method for control software of a servo system, which is operated on a laboratory virtual instrument engineering platform labview, and comprises the following steps:
creating a test case generating template comprising a front panel and a plurality of child VI in advance;
filling test parameters, test conditions and corresponding expected results of an item to be tested into corresponding positions of the front panel, and calling a character string connection tool of the labview and each sub-VI to automatically generate a test case instruction based on an instruction type; the instruction types comprise a conventional instruction, a patrol instruction and a splicing instruction;
when a test request is detected, automatically sending corresponding test cases read from a test case table to a controller, and automatically generating a test result according to test data fed back by the controller and a corresponding expected result;
The sub-VI is a steering engine signal conversion sub-VI, a checksum generation sub-VI, an instruction type identification sub-VI or a table generation sub-VI; the steering engine signal conversion sub VI calls labview control to convert the actual stroke number of each steering engine into corresponding hexadecimal character strings; the checksum generation sub-VI calls labview control to generate a checksum according to the character string to be calculated; and the table generation sub-VI calls a labview control to generate a test case table according to the item to be tested.
Optionally, the front panel comprises a plurality of steering engine position information input boxes, and the steering engine position information is the actual number of strokes of the corresponding steering engine expressed in decimal; the process of calling labview control by the steering engine signal conversion sub-VI to convert the actual stroke number of each steering engine into the corresponding hexadecimal character string comprises the following steps:
acquiring precision information for carrying out data transformation on an actual position, wherein the precision information is 000-ZZZ, which represents 0-M degrees, and XXX-YYY, which represents-N-0 degrees;
for each steering engine actual stroke number, a positive and negative value judging control is called to judge whether the current steering engine actual stroke number is positive or negative;
if the actual number of the steering engine is positive, calling a formula control to calculate l/s 1 Obtaining an initial decimal value by M Splitting and forcedly converting the initial decimal value to obtain a corresponding hexadecimal character string; if the actual number of the current steering engine strokes is negative, a formula control is called to calculate XXX-l x s 2 Obtaining an initial decimal value by N, splitting and forcedly converting the initial decimal value to obtain a corresponding hexadecimal character string; wherein l is the actual stroke number of the current steering engine, Z, X, Y is any hexadecimal value, M is the stroke corresponding to the ZZZ number, N is the stroke corresponding to the XXX number, XXX=ZZZ+001, s 1 Decimal string, s, converted for ZZZ 2 Decimal strings converted for XXX-YYY.
Optionally, the process of generating the checksum by the sub VI according to the string to be calculated to call the labview control to generate the checksum includes:
converting the character string to be calculated into a byte array by utilizing a character string to byte array conversion control of the labview;
converting the byte array into a decimal array by using a forced conversion control, and then converting the decimal array into unsigned double-byte shaping;
adding elements in the unsigned double-byte shaping array by using an array element adding control to obtain element sums;
splitting the element sum into high-eight bits and low-eight bits by utilizing a data splitting control;
And converting the split element sum into hexadecimal character strings by using the forced conversion control, and connecting the converted hexadecimal character strings according to requirements to generate a checksum.
Optionally, the process of calling labview control to generate the test case table by the table generation sub VI according to the item to be tested includes:
generating an instruction character string by using the character string connection tool by each test parameter;
invoking the instruction type identifier VI to judge whether the generated instruction type is a splicing instruction type or a patrol instruction type;
if the instruction string is in the splicing instruction format, splitting the instruction string into two sub-instruction strings, and taking the sub-instruction strings as a testing splicing instruction; if the command string is in the patrol command format, splitting the command string into two sub-command strings, and integrating the sub-command strings with the command string to generate a new command string serving as a test patrol command; if the command is in the conventional command format, the command character string is directly output without processing;
generating an instruction array by the instruction character string or the test splicing instruction or the test inspection instruction or the conventional instruction, corresponding test conditions and expected results, and inserting the instruction array into a two-dimensional array corresponding to data to be displayed so as to display a currently generated test case instruction in the front panel;
And when a report saving request is received, storing each test case instruction in the front panel into the test case table.
Optionally, after the displaying the currently generated test case instruction in the front panel, the method further includes:
when a request for clearing the last piece of data is received, an array element deleting control is called to delete the last line of data in the two-dimensional array, and a new two-dimensional array is generated;
and initializing the two-dimensional array when a request for clearing all data is received, so as to clear all data in the two-dimensional array.
Optionally, the automatically sending the corresponding test case read from the test case table to the controller includes:
reading a storage path of the test case table and each test condition from the front panel, wherein the test condition is a transmission interval condition or a power-on operation condition;
calling a table data reading control according to the storage path to read each test case instruction from the test case table;
if the transmission interval condition is a continuous transmission instruction, sequentially transmitting each test case instruction to the controller through a VISA write control;
if the transmission interval condition is a discontinuous transmission instruction, judging whether the power-on operation condition is to be re-electrified, if so, displaying a re-electrification operation reminding message to a user, and when power-on completion instruction information is received, transmitting a current test case instruction to the controller through the VISA writing tool; if the power-on is not needed, when instruction sending indication information is received, the current test case instruction is sent to the controller through the VISA writing tool.
Optionally, the automatically generating the test result according to the test data fed back by the controller and the corresponding expected result includes:
reading feedback result data after each steering engine executes the test case instruction from the controller through a VISA reading control, and reading effective data of each piece of feedback result data according to a preset feedback format;
the test condition is a continuous sending instruction, if the expected result is that the steering engine does not respond and does not have feedback, the character string length control is utilized to judge whether the data length of the effective data of the current feedback result data is 0, if the data length is 0, the output contains the steering engine and does not respond, the feedback does not exist, and the normal character string constant is tested; if the value is not 0, outputting a character string constant containing test abnormality and feedback content of a steering engine;
if the expected result is a steering engine response instruction and feedback exists, determining a frame head of a current test case instruction by utilizing a search/split character string control, and intercepting a character string with a preset instruction length from the current test case instruction by utilizing a character string intercepting control to obtain a target character string; converting the target character string into a target byte array by utilizing a character string-to-byte array conversion control; algebraic sum accumulation is carried out on all elements before the last two elements of the target byte array, and a digital splitting control is utilized to separate an accumulated result according to high-low 8-bit data; and if the split high-low data is consistent with the last two bit elements of the target byte array, connecting the content containing normal steering engine response and steering engine feedback with the target character string into a new character string by using a connecting character string tool, and outputting the new character string.
In another aspect, an embodiment of the present invention provides an automated testing apparatus for control software of a servo system, which is run on a labview of a laboratory virtual instrument engineering platform, including:
the test case generation template creation module is used for creating a test case generation template comprising a front panel and a plurality of child VI; the sub-VI is a steering engine signal conversion sub-VI, a checksum generation sub-VI, an instruction type identification sub-VI or a table generation sub-VI; the steering engine signal conversion sub VI calls labview control to convert the actual stroke number of each steering engine into corresponding hexadecimal character strings; the checksum generation sub-VI calls labview control to generate a checksum according to the character string to be calculated; the table generation sub-VI calls labview control to generate a test case table according to the item to be tested;
the automatic test case generating module is used for filling test parameters, test conditions and corresponding expected results of the items to be tested into corresponding positions of the front panel, and calling a character string connection tool of the labview and each sub-VI to automatically generate a test case instruction based on the instruction type; the instruction types comprise a conventional instruction, a patrol instruction and a splicing instruction;
and the automatic test module is used for automatically sending the corresponding test cases read from the test case table to the controller when the test request is detected, and automatically generating a test result according to the test data fed back by the controller and the corresponding expected result.
The embodiment of the application also provides an automatic testing device for the servo system control software, which comprises a processor, wherein the processor is used for realizing the steps of the automatic testing method for the servo system control software according to any one of the previous steps when executing the computer program stored in the memory.
The embodiment of the application finally provides a computer readable storage medium, wherein the computer readable storage medium is stored with an automatic test program of the servo system control software, and the automatic test program of the servo system control software realizes the steps of the automatic test method of the servo system control software according to any one of the previous steps when being executed by a processor.
The technical scheme provided by the application has the advantages that the test cases are automatically generated according to the test requirements of the test items, the test case data are read and automatically issued to the controller for testing, the conclusion is obtained by analyzing the data fed back by the controller, the test report is automatically generated, the functions of simultaneously realizing the automatic writing of the test cases of the steering engine software, the automatic testing of the test cases and the automatic generation of the test report are realized on the basis of the labview software development platform, the operation is simple, the maintainability is high, the expandability is strong, the test accuracy and the test efficiency of the servo control software are effectively improved, the production efficiency is improved, and the cost is effectively controlled.
In addition, the embodiment of the invention also provides a corresponding implementation device and a computer-readable storage medium for the automatic test method of the servo system control software, so that the method has more practicability, and the device and the computer-readable storage medium have corresponding advantages.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the related art, the drawings that are required to be used in the embodiments or the description of the related art will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort to those of ordinary skill in the art.
FIG. 1 is a schematic diagram of a front panel structure of an automated test tool embodying servo control software according to an exemplary embodiment of the present invention;
FIG. 2 is a schematic flow chart of an automated test method for servo control software according to an embodiment of the present invention;
FIG. 3 is a flowchart of another method for automated testing of servo control software according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a front panel structure for implementing a test case generation template according to an exemplary embodiment of the present invention;
FIG. 5 is a schematic diagram of the composition of test instruction types shown in accordance with an exemplary embodiment of the present invention;
FIG. 6 is a schematic diagram of a test case instruction generation program according to an exemplary embodiment of the present invention;
FIG. 7 is a schematic diagram of another test case instruction generation flow diagram according to an exemplary embodiment of the present invention;
FIG. 8 is a flow chart illustrating an automatic read test case instruction according to an exemplary embodiment of the present invention;
FIG. 9 is a flow chart illustrating test result generation according to an exemplary embodiment of the present invention;
FIG. 10 is a schematic diagram of a test case test front panel structure according to an exemplary embodiment of the present invention;
FIG. 11 is a schematic diagram of a steering engine signal conversion procedure according to an exemplary embodiment of the present invention;
FIG. 12 is a schematic diagram of signal processing for implementing a table generator VI according to an exemplary embodiment of the present invention;
FIG. 13 is a schematic diagram of signal processing implementing another table generator VI shown in accordance with an exemplary embodiment of the present invention;
FIG. 14 is a schematic diagram illustrating a test case instruction data reading process in accordance with an exemplary embodiment of the present application;
FIG. 15 is a schematic diagram of an instruction intercept window according to an exemplary embodiment of the present application;
FIG. 16 is a block diagram of an embodiment of an automated test equipment for servo control software provided by an embodiment of the present application;
FIG. 17 is a block diagram of another embodiment of an automated test equipment for servo control software provided by an embodiment of the present application.
Detailed Description
In order to better understand the aspects of the present application, the present application will be described in further detail with reference to the accompanying drawings and detailed description. It will be apparent that the described embodiments are only some, but not all, embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims and drawings are used for distinguishing between different objects and not necessarily for describing a particular sequential or chronological order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements but may include other steps or elements not expressly listed.
Having described the technical solutions of embodiments of the present application, various non-limiting embodiments of the present application are described in detail below.
The technical scheme provided by the application operates on a labview of a laboratory virtual instrument engineering platform, and can be suitable for all electric servo control systems based on RS422/RS485 communication, and a person skilled in the art can increase or delete tests of a certain model according to actual requirements. The user clicks the basic parameter setting option, and inputs parameters including, but not limited to, a product model, a serial port name, a baud rate, a data bit, a check bit, a stop bit and a test case storage or extraction path through a pop-up dialog box, a page with an input box or an imported information page, and clicks a test case generation option, and the user can automatically generate a test case according to relevant parameters of a test item and store the test case in a specified file path; the user clicks the test case test option, and can execute automatic test on the servo system control software according to the test item and the test condition and generate a test result; the user clicks the stop option to stop the operation of the automated test tools for the entire servo control software. The method corresponding to the functions of each module of the automated test equipment implementing the servo control software is shown in the flowchart of fig. 2 and described in the following embodiments. Referring to fig. 3 first, fig. 3 is a flow chart of an automated testing method for control software of a servo system according to an embodiment of the present application, where the embodiment of the present application may include the following:
S301: a test case generation template is created in advance.
The test case generation template of the present embodiment includes a front panel and a plurality of child VI. The front panel corresponds to a man-machine interaction interface, and the sub-VI corresponds to program support behind a certain function of the interaction interface. For example, as shown in fig. 4, the front panel of the test case generating template may be used to set parameters related to the test case through the front panel when the test case is generated, where the parameters to be set include test parameters, test conditions and corresponding expected results, and the test parameters include, but are not limited to, a product model, a test name, a steering engine position signal, and a specific format of an instruction. The specific format of the instruction includes frame header, pre-instruction interference, post-instruction interference, type ID, check generation, etc. In consideration of the use habit decimal numbers of users, in order to be convenient for the users to use, the information input at the steering engine position signals is the travel numerical value actually needed by the steering engine, the information does not need to be calculated into corresponding 16-system character strings in advance, and the conversion of the decimal numbers and hexadecimal character strings is realized by calling a steering engine signal conversion sub VI. The test conditions include, but are not limited to, whether to send continuously, whether to re-power up, steering engine in-place, the expected result is the test result expected by the user after each test instruction is executed, or the expected test phenomenon is illustrated. Of course, the front panel may further include a region for displaying and generating each test case instruction, a set completion option, a generate instruction option, a clear last instruction option, a clear all instructions option, a save to report option, and an exit option.
The child VI in the test case generation template includes, but is not limited to, a steering engine signal conversion child VI, a checksum generation child VI, an instruction type identification child VI, or a table generation child VI. The steering engine signal conversion sub VI calls labview control to convert the actual stroke number of each steering engine into corresponding hexadecimal character strings. And the checksum generation sub-VI calls the labview control to generate a checksum according to the character string to be calculated. And the table generator VI calls the labview control to generate a test case table according to the item to be tested. Based on the names, it is clear that the instruction type identifier VI is used to identify the type of test case instruction, and the instruction types of the test case include a regular instruction, a patrol instruction, and a splice instruction, as shown in fig. 5. The conventional instruction is formed by adding interference instructions before and after a normal instruction format, wherein the conventional instruction comprises interference before the instruction, a frame header, a type ID, other steering engine position signals, standby steering engine position signals and interference after the instruction. When an interference instruction is needed, such as pre-instruction interference or post-instruction interference, the corresponding character string frame is filled with data at the position shown in fig. 4 to generate the corresponding interference instruction, and when the interference instruction is not needed, the corresponding interference instruction is not filled. The inspection instruction is to insert a correct instruction in the middle of the correct instruction, the front panel inputs the correct instruction, the correct instruction is split into a first half instruction A and a second half instruction B, and then the correct instruction is inserted between the instructions A, B to be combined into a new inspection instruction. The splicing instruction mainly is that the test controller can identify the correct instruction when the instruction is sent out and disconnected, so that the correct instruction is required to be divided into two instructions to be sent to the controller, the program processing is different from the inspection instruction in that the instruction splicing is only required to be divided into two instructions, and other instructions are not required to be integrated. Based on the format of the regular instruction, the regular instruction test may include a frame header error test, a type ID error test, a checksum error test, an instruction interference test, and an over-travel instruction test. As shown in fig. 4, for the frame header error test: if the correct test case instruction is AABB+0000+0101+0101+checksum, AABB is an instruction frame header, when the test case of the error frame header needs to be generated, only an instruction which is not AABB needs to be input into a frame header control, and other inputs are unchanged, if the frame header is changed into AACC, and the instruction AACC+0000+0101+0101+checksum is generated after the completion of setting and the instruction generation are clicked. For type ID errors: the control instructions of the servo system control software are generally divided into flight instructions, self-checking instructions and the like according to different functions, and different bytes are set in a certain byte to distinguish the functions which need to be realized currently, for example, one byte behind a frame head is distinguished, if 0A is flight data, and if 0B is a self-checking instruction. When judging whether the error instruction can be identified by the rudder system when the byte signal is not the instruction in the required range, only filling any one incorrect instruction into the control shown by the type ID of the front panel shown in fig. 4 when filling parameters, and if the other bytes are unchanged, filling 0C, the generated data is AACC+0C00+0101+0101+checksum. For the check sum error test, a complete instruction is a valid frame until the check sum is finished, the check sum is correct, otherwise, the check sum is an invalid frame, the design error is that whether the control software can judge whether the instruction is valid or not is judged, when the check sum error is designed, two numbers between 0 and 1 are randomly generated by using a random number control according to requirements, then the number is multiplied by 15, the two numbers are forcedly converted into two sixteen single byte character strings, the two single byte character strings are connected into a 16-bit double byte character string by using a character string connection control, meanwhile, the correct check sum is calculated through a check sum calculator VI, if the generated random data is different from the correct check sum, the random data is regenerated until the generated data is different from the correct data. For instruction interference testing: instruction disturbances are classified into pre-disturbances, i.e. a series of incorrect instructions before a correct instruction, and post-disturbances, i.e. a series of incorrect instructions after a correct instruction. The design of the instruction interference verifies whether the control system can correctly identify when the interference instruction exists, the human-computer interaction interface generated by the instruction is provided with two controls, namely an interference option before the instruction and an interference option after the instruction, when the instruction interference needs to be generated, any character string of an incorrect instruction can be input into the two controls, for example, a '0102 AABB' is written in the interference before the instruction, and the generated instruction is '0102+AABB+AACC+0C00+0101+0101+checksum'. And for the test of the over-travel instruction, the over-travel instruction controls the steering engine position signal to exceed the steering engine limited travel. Only the value exceeding the stroke is filled in at the position of the steering engine signal to be measured, if the limited stroke of the steering engine is 30, the value of 35 or more can be input at the corresponding position. The inspection instruction is to insert a correct instruction in the middle of the correct instruction, the front panel inputs the correct instruction, the correct instruction can be split into a first half instruction A and a second half instruction B by utilizing the character string splitting control, and then the correct instruction is inserted between the instruction A and the instruction B by utilizing the insertion character string control to be combined into a new inspection instruction. The implementation mode of the splicing instruction is as follows: the instruction splicing mainly tests whether the controller can identify a correct instruction when the instruction is sent incoherently, so that the correct instruction is required to be divided into two instructions to be sent to the controller, the correct instruction is divided into an instruction A and an instruction B through a character string splitting control by program processing, and the difference between the inspection instruction and the inspection instruction is that the correct instruction is only required to be divided into two instructions, other instructions are not required to be integrated, and the two divided instructions are used for creating an array control to form a character string array to be inserted into an array for generating a table.
S302: and filling the test parameters, the test conditions and the corresponding expected results of the items to be tested into the corresponding positions of the front panel, and calling a string connection tool of labview and each sub-VI to automatically generate a test case instruction based on the instruction type.
In this step, the explanation of the test parameters, test conditions and expected results can be referred to the explanation of the corresponding positions in the previous step, and will not be repeated here. For the test parameters, the position information of the steering engine needs to be converted into character strings, and the conversion is not needed, so before a test instruction is generated, the steering engine signal conversion sub VI needs to be called to convert the actual stroke number of each steering engine into a corresponding hexadecimal character string, and then the character string which does not need to be converted and the character string which is converted are connected by using a character string connection tool of labview, namely a character string connection control of labview, based on the instruction type, namely a conventional instruction, a patrol instruction or a splice instruction to generate a test case instruction.
In the actual application process, the implementation process of this step can refer to fig. 7 and 6, and the "event structure", "condition structure" and "while loop" can be used to determine the event that should be executed currently, and the "input" of the condition structure is implemented by using the "queue" control, and the program initialization is to set the queue element to be idle, that is, to be the default state, and when no event occurs, the queue outputs "idle", and the whole program is in the idle state and does not perform any processing. When the event structure recognizes that an event occurs through the change of the Boolean value of each control, the Boolean value of the control such as ' setting is completed ', ' generating instructions ', and the like is changed, elements of the queue are modified into corresponding conditions, the corresponding conditions are input into an input port of the condition structure ', the condition structure of the program judges the current conditions, and the corresponding program is operated. The data which does not need to be calculated is directly connected into a first character string by utilizing a character string control, the steering engine signal which needs to be calculated is firstly input into a steering engine signal conversion sub VI to be calculated, and the conversion into a corresponding hexadecimal character string can be called a second character string. And inputting the newly generated character strings, namely the first character string and the second character string, the pre-instruction interference, the post-instruction interference instruction and the test name into a generated checksum sub-VI, calculating the checksum by using the newly generated character strings, if the test name is a checksum error, randomly generating an incorrect checksum, if the test name is other test types, calculating the correct checksum, and finally connecting the newly generated character strings, the checksum and the post-instruction interference by using a character string connection control according to the sequence of the pre-instruction interference, the newly generated character strings, the checksum and the post-instruction interference. As an alternative implementation mode, in order to facilitate the use of a user, the generated complete test instruction can be input into a table generation sub-VI for data processing to generate a two-dimensional array, and the generated two-dimensional array can be displayed on a front panel through an XY graph control for a designer to check whether the generated instruction is correct or not. If the instruction is incorrect, the user or operator may invoke "clear last piece of data" by checking the options in the front panel? The "Boolean control and" clear last instruction "control programs clear the last instruction from generating a two-dimensional array. If a new test case form is regenerated, the operator may check "clear all data? The operation of clicking the "clear all instructions" control then invokes the daemon to clear all the data that has been generated. After all test cases are generated, a user can call a background program to store the generated test cases to a specified path by clicking the option of the front panel 'save to report' and the labVIEW report tool 'append table to report' control. The generated test instruction is displayed on the front panel in real time, when the instruction design error is found, the user clicks the "delete last" to delete the wrong test case, then redesigns the instruction, after the design of the test case is finished, the user clicks the "save to report" to save the generated test case to the selected path, clicks the "exit" to exit the test case generation process, and returns to the main program.
S203: when a test request is detected, the corresponding test cases read from the test case table are automatically sent to the controller, and a test result is automatically generated according to the test data fed back by the controller and the corresponding expected result.
As shown in fig. 8 and 9, the test cases in the test case table are automatically read in this step and can be sent to the controller through the serial port, the data fed back by the controller is received, the data is analyzed, and finally the analysis result is written into the last column of the test case table as the test result, or can be independently written into the table recording the test result, which does not affect the implementation of the present application. The controller is a control system of the servo system control software, instructions are issued to the servo system control software, the servo system control software controls the steering engine to execute the instructions, then the steering engine feeds back results after the instructions are executed to the controller, and the controller feeds back the test data. In this step, a front panel for testing cases may also be set, as shown in fig. 10, where the front panel may include a current test instruction option, a total test number option, a tested instruction number option, and remaining non-tested instruction options, and through display of the front panel, when the step S201, that is, the automatic test stage of the test cases is performed, the system may pop up the front panel as shown in fig. 10, and the interface may reflect the current test instruction, and the total number of instructions required to be tested, the tested number, and the number to be tested, so that an operator or a user may clearly know the current test progress, and be convenient for the operator to determine the time and the like.
According to the technical scheme provided by the embodiment of the application, the test cases are automatically generated according to the test requirements of the test items, the test case data are read and automatically issued to the controller for testing, the conclusion is obtained by analyzing the data fed back by the controller, the test report is automatically generated, the functions of simultaneously realizing automatic writing of the test cases of the steering engine software, automatic testing of the test cases and automatic generation of the test report are realized on the basis of the labview software development platform, the operation is simple, the maintainability is high, the expandability is strong, the test accuracy and the test efficiency of the servo control software are effectively improved, the production efficiency is improved, and the cost is effectively controlled.
It should be noted that, in the present application, there is no strict sequence of execution among the steps, so long as the sequence accords with the logic sequence, the steps may be executed simultaneously, or may be executed according to a certain preset sequence, and fig. 2 and fig. 3 are only a schematic manner, and do not represent that only such execution sequence is possible.
In the above embodiment, the implementation process of the steering engine signal converter VI is not limited, and in this embodiment, a data conversion manner of the steering engine signal converter VI in one embodiment is given, as shown in fig. 11, and the method may include the following steps:
The front panel comprises a plurality of steering engine position information input frames, and the steering engine position information is the actual stroke number of the corresponding steering engine expressed in decimal system; the process of the steering engine signal conversion sub VI for calling labview control to convert the actual stroke number of each steering engine into the corresponding hexadecimal character string comprises the following steps:
acquiring precision information for carrying out data conversion on an actual position, wherein the precision information is 000-ZZZ, 0-M degrees, and XXX-YYY, namely-N-0 degrees; for each steering engine actual stroke number, a positive and negative value judging control is called to judge whether the current steering engine actual stroke number is positive or negative; if the actual number of the steering engine is positive, calling a formula control to calculate l.s 1 Obtaining an initial decimal value by M, splitting and forcedly converting the initial decimal value to obtain a corresponding hexadecimal character string; if the actual number of the steering engine is negative, calling a formula control to calculate XXX-l s 2 N obtains an initial decimal value, and splits and forces the initial decimal valueConverting to obtain corresponding hexadecimal character strings; wherein l is the actual stroke number of the current steering engine, Z, X, Y is any hexadecimal value, M is the stroke corresponding to the ZZZ number, N is the stroke corresponding to the XXX number, XXX=ZZZ+001, s 1 Decimal string, s, converted for ZZZ 2 Decimal strings converted for XXX-YYY.
For example, in connection with fig. 11, the steering engine signal conversion sub VI is calculated as: according to the task book, carrying out data transformation on the actual position according to a certain precision, if the precision required by the task book is 000-AAA and represents 0-30 degrees, BBB-CCC represents-30-0 degrees, and if the character string corresponding to 25 degrees is calculated, calculating: judging whether the required numerical value is larger than 0 by using a control which is larger than 0, namely a positive value and a negative value, if the required numerical value is larger than 0, calculating 25 x A 'and 30 by using a formula control, wherein A' is a decimal character string corresponding to AAA, splitting data, and forcedly converting the data to generate a steering engine signal character string. If less than 0, e.g. -25 °, then "CCC-25 x D/30" is calculated at the "formula" control, where D is the decimal string used by the CCC-BBB pair.
In the foregoing embodiment, the implementation manner how the checksum generation sub-VI generates the checksum according to the string to be calculated by calling the labview control is not limited, and in this embodiment, an implementation manner that the checksum generation sub-VI generates the checksum according to the string to be calculated by calling the labview control is provided, which may include the following steps:
converting the character string to be calculated into a byte array by using a character string to byte array conversion control of labview;
Converting the byte array into a decimal array by utilizing a forced conversion control, and then converting the decimal array into unsigned double-byte shaping;
adding elements in the unsigned double-byte shaping array by utilizing an array element adding control to obtain element sums;
splitting the element sum into high-eight bits and low-eight bits by utilizing a data splitting control;
and converting the split element sum into hexadecimal character strings by using a forced conversion control, and connecting the converted hexadecimal character strings according to requirements to generate a checksum.
In the above embodiment, how the table generator VI calls the labview control to generate the test case table according to the item to be tested is not limited, and in this embodiment, an implementation manner of the table generator VI calling the labview control to generate the test case table according to the item to be tested is provided, referring to fig. 12 and 13, may include the following steps:
and generating an instruction character string by using a character string connection tool according to specific formats of each test parameter such as a product model number, a test name, a steering engine position signal and an instruction.
The calling instruction type identifier VI determines whether the generated instruction type is a splice instruction type or a patrol instruction type. If the instruction to be generated is a conventional instruction, namely, is not a splicing instruction and a patrol instruction, the instruction is not processed, and the following processing is carried out on the splicing instruction and the patrol instruction:
If the instruction string is in the splicing instruction format, splitting the instruction string into two sub-instruction strings, and taking the sub-instruction strings as a testing splicing instruction; if the command string is in the patrol command format, splitting the command string into two sub-command strings, and integrating the sub-command strings with the command string to generate a new command string serving as a test patrol command; if the original instruction is in the conventional instruction format, directly outputting the obtained original instruction character string without any processing;
the instruction character string or the test splicing instruction or the test inspection instruction or the conventional instruction and corresponding test conditions such as whether to continuously send or not, whether to need to be electrified again or not, the steering engine in-place condition and the expected result are generated into an instruction array, the two-dimensional array can be inserted first and then output into the added array, and finally the instruction array is inserted into the two-dimensional array corresponding to the data to be displayed, so that the currently generated test case instruction is displayed in the front panel.
Optionally, as an optional implementation manner of the present application, when a report saving request is received, each test case instruction in the front panel is stored in the test case table. And when a request for clearing the last piece of data is received, an array element deleting control is called to delete the last row of data in the two-dimensional array, and a new two-dimensional array is generated. When a request for clearing all data is received, initializing the two-dimensional array to clear all data in the two-dimensional array.
In this embodiment, when the two-dimensional array is displayed on the front panel through the XY chart control, the user or operator can see the generated test case in time. If the input is to remove the last piece of data, the control of deleting array elements can be used for deleting the last line of data and outputting a new two-dimensional array, and if the input is to remove all data, the two-dimensional array can be initialized to be a two-dimensional array without data.
In the above embodiment, how to automatically read the test case instruction in step S303 is not limited, and in this embodiment, an implementation manner of reading the test instruction is provided, as shown in fig. 14, that is, a process of automatically sending the corresponding test case read from the test case table to the controller may include the following steps:
and reading the storage path of the test case table and each test condition from the front panel of the test case generation template, wherein the test condition is a transmission interval condition or a power-on operation condition.
Calling a table data reading control according to the storage path to read each test case instruction from the test case table;
if the transmission interval condition is a continuous transmission instruction, sequentially transmitting each test case instruction to the controller through the VISA writing control;
If the transmission interval condition is a discontinuous transmission instruction, judging whether the power-on operation condition is to be re-electrified, if so, displaying a re-electrification operation reminding message to a user, and when receiving the power-on completion instruction message, transmitting the current test case instruction to a controller through a VISA writing tool; if the power-on is not needed, when instruction sending indication information is received, the current test case instruction is sent to the controller through the VISA writing tool.
In this embodiment, the "excel get data.vi" control may be used to read the data in the test case table, where the table path is consistent with the report path selected in the parameter setting, and then determine the read data, mainly to determine whether to continuously send, and whether to need to be powered on again. At this time, the "condition structure" is adopted to make branches to process judgment, the judgment data of the data read out from the extraction table is used as the input port for inputting the judgment condition into the "condition structure", whether the instruction needs to be continuously sent or not, whether the instruction needs to be powered on again or not in the test process or not is required to be judged, and the corresponding program is executed. If the command is a continuous command, the labview sequentially sends the command to the controller through the VISA writing tool. If the transmission is discontinuous, whether the power-on needs to be restarted is judged according to the read data, the process is still judged by using a condition structure, the judging condition for the user is input into the input port of the condition structure, and the corresponding program is executed according to the judging result. If the user needs to be powered up again, a dialog box is popped up by using a dialog box tool to remind the operator to perform the power up again, and after the power up again is completed, the user clicks 'continue', and the labview sends the instruction to the controller through a 'VISA write-in' control. If the power-on is not needed, a 'continue' window is popped up, and when the operator judges that the instruction is required to be sent continuously, the operator clicks the 'continue', and the labview sends the instruction to the controller immediately.
Correspondingly, the application also provides an implementation method for automatically generating the test result according to the test data fed back by the controller and the corresponding expected result, which can comprise the following steps:
reading feedback result data after each steering engine executes the test case instruction from a controller through a VISA reading control, and reading effective data of each piece of feedback result data according to a preset feedback format;
the test condition is continuous sending instruction, if the expected result is that the steering engine does not respond and does not have feedback, the character string length control is utilized to judge whether the data length of the effective data of the current feedback result data is 0, if the data length is 0, the output contains the steering engine and does not respond, feedback does not exist, and the normal character string constant is tested; if the value is not 0, outputting a character string constant containing test abnormality and feedback content of a steering engine;
if the expected result is a steering engine response instruction and feedback exists, determining a frame head of the current test case instruction by utilizing a search/split character string control, and intercepting a character string with a preset instruction length from the current test case instruction by utilizing a character string intercepting control to obtain a target character string; performing checksum judgment on the intercepted character string, namely the target character string, and converting the target character string into a target byte array by utilizing a character string-to-byte array conversion control; algebraic sum accumulation is carried out on all elements before the last two elements of the target byte array, and the accumulated result is separated according to 8-bit data by utilizing a digital splitting control; converting the split high-low bit data and the last two bit elements of the target byte array into hexadecimal data by using a forced conversion control; and if the split high-low data is consistent with the last two elements of the target byte array, connecting the content containing normal response of the steering engine and feedback of the steering engine with the target character string into a new character string to be output by using a connecting character string tool.
In this embodiment, after the system sends the test instruction, the feedback data of the controller needs to be read to determine whether the controller can normally respond to the test instruction, at this time, the data fed back by the controller is read out through a "VISA read" control, the read data is analyzed and determined according to the data, and if the data is normal, the "normal test" and the read data are written into a list of the table "test result" together; if the data is abnormal, writing the test abnormality and the read data into a column of a table test result. The data reading and processing may be as follows:
the data fed back by the steering engine are read out by using a VISA reading control and are input into an instruction intercepting sub-VI, and the functions realized by the instruction intercepting sub-VI are as follows: extracting effective data from the read data according to a task book feedback instruction format, judging whether the data is the same as an expected result, and realizing the following program:
for continuously transmitted data:
if the expected result is that the rudder system does not respond and has no feedback, judging whether the read data length is 0 by using a control of the character string length, if the read data length is 0, enabling the rudder system to function normally, outputting a character string constant, namely, if the rudder system does not respond and has no feedback and is tested normally, if the character string length is not 0, enabling the character string constant to be tested abnormally, and enabling the rudder system to feed back: the character string read and connected with the character string read is connected into a new character string output by a connection character string control, for example, the test abnormality is detected, and the rudder system feeds back as follows: AABB CCD … …'
If the expected result is the rudder system response instruction and feedback exists, the frame header is found by using a search/split character string control, the correct instruction length is intercepted by using an intercepting character string, checksum judgment is carried out on the intercepted character string, the character string is converted into a byte array by using a character string-to-byte array conversion control, algebraic sum accumulation is carried out on each element before the last two elements of the pair, and the accumulated result is used: the ' digital splitting ' control separates the high and low 8-bit data, then the ' forced conversion ' control converts the split high and low-bit data and the last two elements of the array into hexadecimal data, judges whether the split data is consistent with the last two bits of the array element, if so, the split data is a frame of effective data, and at the moment, the ' connection character string tool ' is used for responding the ' rudder system normally, and the feedback is as follows: "connect with the intercepted string to form a new string output.
Test for discontinuous transmission:
for the test of discontinuous transmission, the test displays the instruction through a pop-up window after the instruction is read, the tester selects the instruction from the test personnel to intercept, and the pop-up serial port is shown in fig. 15.
The tests of discontinuous transmission are: the rudder system walks from the zero position to the given instruction position, and the rudder system has the time domain, the frequency domain, the rated rotating speed, the self-checking and other instructions.
When the test control steering engine walks to a certain position, whether the feedback instruction is an instruction of the walking position of the steering engine is needed to be judged, at this time, when the steering engine is stationary to a designated position, the feedback data of the last frame is extracted, the feedback position is obtained through calculation, if the feedback position is within the error range of the designated position, the test result is normal, the rudder system responds normally, and the feedback is as follows: the "and intercepted string" tool is used to connect the new string output. If the steering engine does not respond or the feedback is no longer within the error range, outputting test abnormality, and if the steering engine does not respond or the steering engine has deviation in control accuracy.
When the time domain, the frequency domain, the rated rotation speed and the self-checking instruction of the rudder system are tested, after the steering engine walks through the specified action, part of the character strings are intercepted in the popped dialog box, and the corresponding result is output.
After all instruction tests are completed, the for loop outputs the character string conclusion output in the form of character string arrays, after the completion, the test result is inserted into the last column of the two-dimensional array read from the table by utilizing an array insertion function to form a new two-dimensional array, and finally the conclusion is written into a corresponding path report through a append table to report control.
The embodiment of the invention also provides a corresponding device running on a laboratory virtual instrument engineering platform labview aiming at the automatic test method of the servo system control software, so that the method has more practicability. Wherein the device may be described separately from the functional module and the hardware. The following describes an automatic test device for servo system control software provided by the embodiment of the present invention, and the automatic test device for servo system control software described below and the automatic test method for servo system control software described above can be referred to correspondingly.
Based on the angles of the functional modules, referring to fig. 16, fig. 16 is a block diagram of an automated testing apparatus for servo system control software provided by an embodiment of the present invention under a specific implementation manner, where the apparatus may include:
a test case generation template creation module 161 for creating a test case generation template including a front panel and a plurality of child VI; the sub-VI is a steering engine signal conversion sub-VI, a checksum generation sub-VI, an instruction type identification sub-VI or a table generation sub-VI; the steering engine signal conversion sub VI calls labview control to convert the actual stroke number of each steering engine into corresponding hexadecimal character strings; the generating checksum sub-VI calls labview control to generate checksum according to the character string to be calculated; and the table generator VI calls the labview control to generate a test case table according to the item to be tested.
The test case automatic generation module 162 is configured to fill the test parameters, test conditions and corresponding expected results of the item to be tested into the corresponding positions of the front panel, and call the string connection tool of labview and each child VI to automatically generate a test case instruction based on the instruction type; the instruction types include a regular instruction, a patrol instruction, and a splice instruction.
And the automatic test module 163 is configured to automatically send the corresponding test case read from the test case table to the controller when the test request is detected, and automatically generate a test result according to the test data fed back by the controller and the corresponding expected result.
Optionally, in some implementations of this embodiment, the steering engine signal converting sub VI may include:
the precision acquisition unit is used for acquiring precision information for carrying out data conversion on the actual position, wherein the precision information is 000-ZZZ, 0-M degrees and XXX-YYY, namely-N-0 degrees;
the numerical value judging unit is used for calling positive and negative value judging controls for each steering engine actual stroke number to judge whether the current steering engine actual stroke number is positive or negative;
the numerical conversion unit is used for calling a formula control to calculate l s if the actual stroke number of the current steering engine is a positive number 1 Obtaining an initial decimal value by M, splitting and forcedly converting the initial decimal value to obtain a corresponding hexadecimal character string; if the actual number of the steering engine is negative, calling a formula control to calculate XXX-l s 2 N obtains an initial decimal value, and splits and forcedly converts the initial decimal value to obtain a corresponding hexadecimal character string; wherein l is the actual stroke number of the current steering engine, Z, X, Y is any hexadecimal value, M is the stroke corresponding to the ZZZ number, N is the stroke corresponding to the XXX number, XXX=ZZZ+001, s 1 Decimal string, s, converted for ZZZ 2 Decimal strings converted for XXX-YYY.
As an alternative implementation of this embodiment, generating the checksum sub-VI may include:
the array conversion unit is used for converting the character string to be calculated into a byte array by utilizing a character string to byte array conversion control of labview; converting the byte array into a decimal array by utilizing a forced conversion control, and then converting the decimal array into unsigned double-byte shaping;
the element accumulation unit is used for adding the elements in the unsigned double-byte shaping array by utilizing the array element addition control to obtain element sum;
the data splitting unit is used for splitting the element sum into high-eight bits and low-eight bits by utilizing the data splitting control;
And the checksum generation unit is used for converting the split element sum into hexadecimal character strings by using the forced conversion control, and connecting the converted hexadecimal character strings according to requirements to generate a checksum.
As an alternative implementation of this embodiment, the table generator VI may include:
a character string generating unit for generating an instruction character string by using a character string connection tool for each test parameter;
the instruction identification unit is used for calling an instruction type identification sub-VI to judge whether the generated instruction type is a splicing instruction type or a patrol instruction type;
the data processing unit is used for splitting the instruction character string into two sub-instruction character strings as a test splicing instruction if the instruction character string is in a splicing instruction format; if the command string is in the patrol command format, splitting the command string into two sub-command strings, and integrating the sub-command strings with the command string to generate a new command string serving as a test patrol command; if the command is in the conventional command format, the command character string is directly output without processing;
the instruction display unit is used for generating an instruction array by the instruction character string or the test splicing instruction or the test inspection instruction or the conventional instruction and the corresponding test conditions and expected results, and inserting the instruction array into the two-dimensional array corresponding to the data to be displayed so as to display the currently generated test case instruction in the front panel;
And the instruction storage unit is used for storing each test case instruction in the front panel into the test case table when receiving the report saving request.
In some implementations of the present embodiment, the table generator VI may further include, for example:
the instruction deleting unit is used for calling the array element deleting control to delete the last line of data in the two-dimensional array when receiving a request for clearing the last piece of data, and generating a new two-dimensional array; when a request for clearing all data is received, initializing the two-dimensional array to clear all data in the two-dimensional array.
As some other alternative embodiments of the present application, the automatic test module 163 may include:
the data acquisition sub-module is used for reading the storage path of the test case table and each test condition from the front panel, wherein the test condition is a transmission interval condition or a power-on operation condition;
the instruction reading sub-module is used for calling a table data reading control according to the storage path to read each test case instruction from the test case table;
the instruction sending sub-module is used for sequentially sending each test case instruction to the controller through the VISA write control if the sending interval condition is a continuous sending instruction; if the transmission interval condition is a discontinuous transmission instruction, judging whether the power-on operation condition is to be re-electrified, if so, displaying a re-electrification operation reminding message to a user, and when receiving the power-on completion instruction message, transmitting the current test case instruction to a controller through a VISA writing tool; if the power-on is not needed, when instruction sending indication information is received, the current test case instruction is sent to the controller through the VISA writing tool.
As some other alternative embodiments of the present application, the automatic test module 163 may include, for example:
the feedback data reading sub-module is used for reading feedback result data after each steering engine executes the test case instruction from the controller through the VISA reading control, and reading effective data of each piece of feedback result data according to a preset feedback format;
the test data analysis processing sub-module is used for judging whether the data length of the effective data of the current feedback result data is 0 by utilizing the character string length control if the expected result is that the steering engine does not respond and does not have feedback, outputting the data containing the steering engine which does not respond and does not have feedback if the data length of the effective data is 0, and testing the normal character string constant; if the value is not 0, outputting a character string constant containing test abnormality and feedback content of a steering engine; if the expected result is a steering engine response instruction and feedback exists, determining a frame head of the current test case instruction by utilizing a search/split character string control, and intercepting a character string with a preset instruction length from the current test case instruction by utilizing a character string intercepting control to obtain a target character string; converting the target character string into a target byte array by utilizing a character string-to-byte array conversion control; algebraic sum accumulation is carried out on all elements before the last two elements of the target byte array, and the accumulated result is separated according to 8-bit data by utilizing a digital splitting control; and if the split high-low data is consistent with the last two elements of the target byte array, connecting the content containing normal response of the steering engine and feedback of the steering engine with the target character string into a new character string to be output by using a connecting character string tool.
The functions of each functional module of the automatic test device for the servo system control software according to the embodiment of the present application may be specifically implemented according to the method in the embodiment of the method, and the specific implementation process may refer to the related description of the embodiment of the method, which is not repeated herein.
From the above, the embodiment of the application realizes the full-automatic test of the control software of the servo system, and effectively improves the test efficiency of the control software of the servo system.
The automatic test device of the servo system control software is described from the perspective of a functional module, and further, the application also provides an automatic test device of the servo system control software, which is described from the perspective of hardware. FIG. 17 is a block diagram of an automated test apparatus for controlling software of a servo system according to another embodiment of the present application. As shown in fig. 17, the apparatus includes a memory 170 for storing a computer program;
a processor 171 for implementing the steps of the automated test method of servo control software as mentioned in any of the embodiments above when executing a computer program.
The processor 171 may include one or more processing cores, such as a 4-core processor, an 8-core processor, or the like, among others. The processor 171 may be implemented in at least one hardware form of DSP (Digital Signal Processing ), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array ). The processor 171 may also include a main processor, which is a processor for processing data in an awake state, also called a CPU (Central Processing Unit ), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 171 may integrate a GPU (Graphics Processing Unit, image processor) for rendering and drawing of content required to be displayed by the display screen. In some embodiments, the processor 171 may also include an AI (Artificial Intelligence ) processor for processing computing operations related to machine learning.
Memory 170 may include one or more computer-readable storage media, which may be non-transitory. Memory 170 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 170 is at least used for storing a computer program 1701, where the computer program, when loaded and executed by the processor 171, can implement the relevant steps of the automated test method for servo control software disclosed in any of the foregoing embodiments. In addition, the resources stored by the memory 170 may also include an operating system 1702, data 1703, and the like, and the storage manner may be transient storage or permanent storage. The operating system 1702 may include Windows, unix, linux, among others. The data 1703 may include, but is not limited to, data corresponding to test results, and the like.
In some embodiments, the automated test equipment of the servo control software may further include a display 172, an input-output interface 173, a communication interface 174, a power supply 175, and a communication bus 176, for example, and may further include a sensor 57.
Those skilled in the art will appreciate that the configuration shown in FIG. 17 is not limiting of an automated test equipment for servo control software and may include more or fewer components than illustrated, such as sensor 177.
The functions of each functional module of the automatic test device for the servo system control software according to the embodiment of the present application may be specifically implemented according to the method in the embodiment of the method, and the specific implementation process may refer to the related description of the embodiment of the method, which is not repeated herein.
From the above, the embodiment of the application realizes the full-automatic test of the control software of the servo system, and effectively improves the test efficiency of the control software of the servo system.
It will be appreciated that the automated test methods of servo control software in the embodiments described above may be stored on a computer readable storage medium if implemented as software functional units and sold or used as a stand alone product. Based on this understanding, the technical solution of the present application may be embodied essentially or in part or in whole or in part in the form of a software product stored in a storage medium for performing all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random-access Memory (Random Access Memory, RAM), an electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, a magnetic disk, or an optical disk, etc. various media capable of storing program codes.
Based on this, the embodiment of the invention also provides a computer readable storage medium, which stores an automated test program of the servo system control software, wherein the automated test program of the servo system control software is executed by the processor, and the steps of the automated test method of the servo system control software are as described in any embodiment above.
The functions of each functional module of the computer readable storage medium according to the embodiments of the present invention may be specifically implemented according to the method in the embodiments of the method, and the specific implementation process may refer to the relevant description of the embodiments of the method, which is not repeated herein.
From the above, the embodiment of the invention realizes the full-automatic test of the control software of the servo system, and effectively improves the test efficiency of the control software of the servo system.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The method, the device and the computer readable storage medium for automatically testing the servo system control software provided by the application are described in detail. The principles and embodiments of the present application have been described herein with reference to specific examples, the description of which is intended only to facilitate an understanding of the method of the present application and its core ideas. It should be noted that it will be apparent to those skilled in the art that various modifications and adaptations of the application can be made without departing from the principles of the application and these modifications and adaptations are intended to be within the scope of the application as defined in the following claims.

Claims (10)

1. An automated test method of servo system control software is characterized by running on a laboratory virtual instrument engineering platform labview, comprising:
creating a test case generating template comprising a front panel and a plurality of child VI in advance;
filling test parameters, test conditions and corresponding expected results of an item to be tested into corresponding positions of the front panel, and calling a character string connection tool of the labview and each sub-VI to automatically generate a test case instruction based on an instruction type; the instruction types comprise a conventional instruction, a patrol instruction and a splicing instruction;
when a test request is detected, automatically sending corresponding test cases read from a test case table to a controller, and automatically generating a test result according to test data fed back by the controller and a corresponding expected result;
the plurality of sub-VI are steering engine signal conversion sub-VI, checksum generation sub-VI, instruction type identification sub-VI and table generation sub-VI; the steering engine signal conversion sub VI calls a positive and negative value judgment control and a formula control in the labview control to convert the actual stroke number of each steering engine into a corresponding hexadecimal character string; the checksum generation sub-VI calls a character string-to-byte array conversion control, a forced conversion control and a data splitting control in the labview control according to the character string to be calculated to generate a checksum; and the table generation sub-VI calls the instruction type identification sub-VI according to the item to be tested to generate a test case table.
2. The automated test method of servo system control software of claim 1, wherein the front panel comprises a plurality of steering engine position information input boxes, the steering engine position information being actual number of passes of the corresponding steering engine in decimal representation; the process of calling the positive and negative value judgment control and the formula control in the labview control by the steering engine signal conversion sub VI to convert the actual stroke number of each steering engine into the corresponding hexadecimal character string comprises the following steps:
acquiring precision information for carrying out data transformation on actual positions, wherein the precision information is 000-000%ZZZRepresents 0 DEG to 0 DEGM°,XXX~YYYRepresentation-N°~0°;
For each steering engine actual stroke number, a positive and negative value judging control is called to judge whether the current steering engine actual stroke number is positive or negative;
if the actual number of the current steering engine strokes is positive, a formula control is called to calculateObtaining an initial decimal value, splitting and forcedly converting the initial decimal value to obtain a corresponding hexadecimal character string; if the actual number of the current steering engine strokes is negative, calling a formula control to calculate +.>Obtaining an initial decimal value, splitting and forcedly converting the initial decimal value to obtain a corresponding hexadecimal character string; wherein (1) >For the actual number of passes of the current steering engine,ZXYis any value in hexadecimal system,Mis thatZZZThe travel corresponding to the number of digits,Nis thatXXXThe travel corresponding to the number of digits,XXX=ZZZ+001,/>is thatZZZConverted decimal character string->Is thatXXX-YYYThe converted decimal string.
3. The automated testing method of servo system control software of claim 1, wherein the generating a checksum sub-VI calls a string-to-byte array conversion control, a forced conversion control, and a data splitting control in the labview control to generate a checksum according to the string to be calculated, comprises:
converting the character string to be calculated into a byte array by utilizing a character string to byte array conversion control of the labview;
converting the byte array into a decimal array by using a forced conversion control, and converting the decimal array into an unsigned double-byte shaping array;
adding elements in the unsigned double-byte shaping array by using an array element adding control to obtain element sums;
splitting the element sum into high-eight bits and low-eight bits by utilizing a data splitting control;
and converting the split element sum into hexadecimal character strings by using the forced conversion control, and connecting the converted hexadecimal character strings according to requirements to generate a checksum.
4. The automated test method of servo control software of claim 1, wherein the process of the table generator VI calling the instruction type identifier VI to generate a test case table according to the item to be tested comprises:
generating an instruction character string by using the character string connection tool by each test parameter;
invoking the instruction type identifier VI to judge whether the generated instruction type is a splicing instruction type or a patrol instruction type;
if the instruction string is in the splicing instruction format, splitting the instruction string into two sub-instruction strings, and taking the sub-instruction strings as a testing splicing instruction; if the command string is in the patrol command format, splitting the command string into two sub-command strings, and integrating the sub-command strings with the command string to generate a new command string serving as a test patrol command; if the command is in the conventional command format, the command character string is directly output without processing;
generating an instruction array by the instruction character string or the test splicing instruction or the test inspection instruction or the conventional instruction, corresponding test conditions and expected results, and inserting the instruction array into a two-dimensional array corresponding to data to be displayed so as to display a currently generated test case instruction in the front panel;
And when a report saving request is received, storing each test case instruction in the front panel into the test case table.
5. The automated test method of servo control software of claim 4, wherein after displaying the currently generated test case instructions in the front panel, further comprising:
when a request for clearing the last piece of data is received, an array element deleting control is called to delete the last line of data in the two-dimensional array, and a new two-dimensional array is generated;
and initializing the two-dimensional array when a request for clearing all data is received, so as to clear all data in the two-dimensional array.
6. The automated test method of servo control software of claim 1, wherein automatically sending the corresponding test case read from the test case table to the controller comprises:
reading a storage path of the test case table and each test condition from the front panel, wherein the test condition is a transmission interval condition or a power-on operation condition;
calling a table data reading control according to the storage path to read each test case instruction from the test case table;
If the transmission interval condition is a continuous transmission instruction, sequentially transmitting each test case instruction to the controller through a VISA write control;
if the transmission interval condition is a discontinuous transmission instruction, judging whether the power-on operation condition is to be re-electrified, if so, displaying a re-electrification operation reminding message to a user, and when power-on completion instruction information is received, transmitting a current test case instruction to the controller through the VISA writing tool; if the power-on is not needed, when instruction sending indication information is received, the current test case instruction is sent to the controller through the VISA writing tool.
7. The automated test method of servo control software of any one of claims 1 to 6, wherein automatically generating test results from the test data fed back by the controller and the corresponding expected results comprises:
reading feedback result data after each steering engine executes the test case instruction from the controller through a VISA reading control, and reading effective data of each piece of feedback result data according to a preset feedback format;
the test condition is a continuous sending instruction, if the expected result is that the steering engine does not respond and does not have feedback, the character string length control is utilized to judge whether the data length of the effective data of the current feedback result data is 0, if the data length is 0, the output contains the steering engine and does not respond, the feedback does not exist, and the normal character string constant is tested; if the value is not 0, outputting a character string constant containing test abnormality and feedback content of a steering engine;
If the expected result is a steering engine response instruction and feedback exists, determining a frame head of a current test case instruction by utilizing a search/split character string control, and intercepting a character string with a preset instruction length from the current test case instruction by utilizing a character string intercepting control to obtain a target character string; converting the target character string into a target byte array by utilizing a character string-to-byte array conversion control; algebraic sum accumulation is carried out on all elements before the last two elements of the target byte array, and a digital splitting control is utilized to separate an accumulated result according to high-low 8-bit data; and if the split high-low data is consistent with the last two bit elements of the target byte array, connecting the content containing normal steering engine response and steering engine feedback with the target character string into a new character string by using a connecting character string tool, and outputting the new character string.
8. An automated testing device for servo system control software, wherein the automated testing device runs on a laboratory virtual instrument engineering platform labview, comprising:
the test case generation template creation module is used for creating a test case generation template comprising a front panel and a plurality of child VI; the plurality of sub-VI are steering engine signal conversion sub-VI, checksum generation sub-VI, instruction type identification sub-VI and table generation sub-VI; the steering engine signal conversion sub VI calls a positive and negative value judgment control and a formula control in the labview control to convert the actual stroke number of each steering engine into a corresponding hexadecimal character string; the checksum generation sub-VI calls a character string-to-byte array conversion control, a forced conversion control and a data splitting control in the labview control according to the character string to be calculated to generate a checksum; the table generation sub-VI calls the instruction type identification sub-VI according to the item to be tested to generate a test case table;
The automatic test case generating module is used for filling test parameters, test conditions and corresponding expected results of the items to be tested into corresponding positions of the front panel, and calling a character string connection tool of the labview and each sub-VI to automatically generate a test case instruction based on the instruction type; the instruction types comprise a conventional instruction, a patrol instruction and a splicing instruction;
and the automatic test module is used for automatically sending the corresponding test cases read from the test case table to the controller when the test request is detected, and automatically generating a test result according to the test data fed back by the controller and the corresponding expected result.
9. An automated test equipment for servo control software, comprising a processor for implementing the steps of the automated test method for servo control software according to any one of claims 1 to 7 when executing a computer program stored in a memory.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon an automated test program of servo control software, which when executed by a processor, implements the steps of the automated test method of servo control software according to any one of claims 1 to 7.
CN202011320815.XA 2020-11-23 2020-11-23 Automatic test method and device for servo system control software and storage medium Active CN112506759B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011320815.XA CN112506759B (en) 2020-11-23 2020-11-23 Automatic test method and device for servo system control software and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011320815.XA CN112506759B (en) 2020-11-23 2020-11-23 Automatic test method and device for servo system control software and storage medium

Publications (2)

Publication Number Publication Date
CN112506759A CN112506759A (en) 2021-03-16
CN112506759B true CN112506759B (en) 2023-11-14

Family

ID=74959937

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011320815.XA Active CN112506759B (en) 2020-11-23 2020-11-23 Automatic test method and device for servo system control software and storage medium

Country Status (1)

Country Link
CN (1) CN112506759B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113189909B (en) * 2021-04-29 2022-12-27 华人运通(上海)云计算科技有限公司 Control method, device and equipment of vehicle control instruction block and storage medium
CN113204447A (en) * 2021-04-30 2021-08-03 中国科学院长春光学精密机械与物理研究所 Calculation tool for data word message verification and calculation method thereof
CN114089725B (en) * 2021-11-18 2024-03-15 北京晶亦精微科技股份有限公司 Test method and device for control software of chemical mechanical polishing equipment and electronic equipment
CN114416458B (en) * 2022-03-30 2022-08-05 航天中认软件测评科技(北京)有限责任公司 Test method, device, equipment and storage medium
CN116599537A (en) * 2023-05-18 2023-08-15 哈尔滨市科佳通用机电股份有限公司 Unit test method of railway frequency shift signal decoding algorithm
CN116909932B (en) * 2023-09-12 2023-12-05 吉孚汽车技术(苏州)有限公司 Continuous integrated automatic software testing system and method based on VT system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103942092A (en) * 2014-04-25 2014-07-23 中国人民解放军装备学院 HLA co-simulation method supporting LabView graphical programming
CN104295561A (en) * 2014-10-15 2015-01-21 上海徽封机电设备有限公司 Proportional servo valve testing system and testing method thereof
CN105224447A (en) * 2014-06-11 2016-01-06 联创汽车电子有限公司 Engine controller software diagnosis module test method and test macro
CN105699105A (en) * 2016-01-29 2016-06-22 成都乐创自动化技术股份有限公司 An ST test system and method for an alternating current servo system
CN106294121A (en) * 2016-07-13 2017-01-04 北京航空航天大学 Aircraft embedded real-time diagnosis reasoning algorithm test method
CN108763076A (en) * 2018-05-22 2018-11-06 深圳乐信软件技术有限公司 A kind of Software Automatic Testing Method, device, equipment and medium
CN108983640A (en) * 2018-06-27 2018-12-11 南京理工大学 A kind of electric linear steering gear control system and method based on LabVIEW
CN110780597A (en) * 2019-10-23 2020-02-11 四川航天烽火伺服控制技术有限公司 Control method, device, equipment and medium for preventing steering engine from oscillating

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104063325B (en) * 2014-07-11 2016-10-26 电子科技大学 A kind of test exemple automation generating means for embedded software and method thereof

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103942092A (en) * 2014-04-25 2014-07-23 中国人民解放军装备学院 HLA co-simulation method supporting LabView graphical programming
CN105224447A (en) * 2014-06-11 2016-01-06 联创汽车电子有限公司 Engine controller software diagnosis module test method and test macro
CN104295561A (en) * 2014-10-15 2015-01-21 上海徽封机电设备有限公司 Proportional servo valve testing system and testing method thereof
CN105699105A (en) * 2016-01-29 2016-06-22 成都乐创自动化技术股份有限公司 An ST test system and method for an alternating current servo system
CN106294121A (en) * 2016-07-13 2017-01-04 北京航空航天大学 Aircraft embedded real-time diagnosis reasoning algorithm test method
CN108763076A (en) * 2018-05-22 2018-11-06 深圳乐信软件技术有限公司 A kind of Software Automatic Testing Method, device, equipment and medium
CN108983640A (en) * 2018-06-27 2018-12-11 南京理工大学 A kind of electric linear steering gear control system and method based on LabVIEW
CN110780597A (en) * 2019-10-23 2020-02-11 四川航天烽火伺服控制技术有限公司 Control method, device, equipment and medium for preventing steering engine from oscillating

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
Zhao Junpeng ; Liu Xinfu.Research on PID controller for hydraulic servo system based on LabVIEW.2015 International Conference on Fluid Power and Mechatronics (FPM).2015,1-4. *
伺服系统性能测试台的研究与开发;樊留群;万德科;;电机与控制应用(07);16-19、27 *
基于LabVIEW和DSP的数字舵机测控系统研究;权维利;姚晓先;林凡;;机床与液压(04);103-105 *
基于LabVIEW的伺服测试系统设计;宫玉琳;李锐;白晓东;;长春理工大学学报(自然科学版)(05);91-96 *

Also Published As

Publication number Publication date
CN112506759A (en) 2021-03-16

Similar Documents

Publication Publication Date Title
CN112506759B (en) Automatic test method and device for servo system control software and storage medium
US12079600B2 (en) Visual programming for deep learning
CN109614325B (en) Method and device for determining control attribute, electronic equipment and storage medium
CN104375934A (en) Method for testing reliability of Android mobile phone software
US20230066703A1 (en) Method for estimating structural vibration in real time
CN111782117A (en) Interface display method and device, storage medium and electronic device
CN113918465A (en) Compatibility testing method and device, electronic equipment and readable storage medium
CN111506305A (en) Tool kit generation method and device, computer equipment and readable storage medium
US20190138921A1 (en) Interactive guidance system for selecting thermodynamics methods in process simulations
CN113703637A (en) Inspection task coding method and device, electronic equipment and computer storage medium
CN114020717A (en) Method, device, equipment and medium for acquiring performance data of distributed storage system
CN113515354A (en) Unified processing system and method based on environment context consistency
CN118070892B (en) Intelligent input method and system based on knowledge base
CN111008140A (en) Cross-platform UI (user interface) automatic testing method and device
CN111522752A (en) Program test method, program test device, storage medium, and electronic apparatus
CN114475631B (en) Driving data processing method, device, automatic driving vehicle medium and product
EP4270121A1 (en) Method and system for seamless transition of runtime system from controller device to digitalization platform
CN117351173B (en) Three-dimensional building parameterization modeling method and device based on text driving
CN114462271A (en) Finite element model element layering information modification method, system, equipment and medium
JP5683209B2 (en) Client computer with automatic document generation function
CN116648689A (en) Method and device for generating automation script
CN118567938A (en) Model monitoring method and device
CN110637522B (en) Control law gain model automatic generation method and system
CN112560462A (en) Method, device, server and medium for generating event extraction service
CN117472690A (en) Performance monitoring method, device, equipment and medium for solid state disk

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
GR01 Patent grant
GR01 Patent grant