Automatic report output method based on Labview
By combining single-time and repeated report output methods, using Labview's preset templates and Excel tables to store data, the problem of high complexity of Labview's own report output control is solved, and efficient automatic output of large data reports is achieved, which significantly improves the Office efficiency and programming simplification.
Patent Information
- Application Number
- CN202411325346.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-01-10
AI Technical Summary
The existing report output controls that come with Labview require input of a large number of initial parameters when generating reports, resulting in high complexity in generation and are only suitable for simple reports and cannot efficiently process report outputs with large data volumes.
The automatic report output method based on Labview is adopted, and a combination of single report output and repeated report output is used to store data using preset templates and Excel tables to realize automatic report output, simplifying parameter setting and data processing.
It realizes the function of ensuring repeated data writing, automatically generates the required file format, saves manpower and time, improves office efficiency, simplifies programming complexity, improves efficiency by nearly 20 times, and simplifies programming complexity by nearly 5/ 6.
Smart Images

Figure CN119294369A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to an automatic output report design method, in particular to an automatic report output method based on Labview. Background Art
[0002] At present, the report output control that comes with Labview (laboratory virtual instrument engineering platform) requires a large number of initial parameters to be input when generating reports. For example, multiple parameters such as font size, report page margins, report printing direction, report page breaks, etc. need to be set. The complexity of generating reports is relatively high and it is only applicable to the generation of simple reports. When generating reports with large amounts of data, too many parameters need to be set, and the workload of report output is relatively large.
[0003] With the increasing requirements for equipment automation, the demand for test report output, especially large data output, is imminent. There is an urgent need for an automatic report output method that can improve programming efficiency while ensuring large amounts of data output. Summary of the invention
[0004] The purpose of the present invention is to solve the technical problems that the existing Labview built-in report output control needs to input a large number of initial parameters when generating, the complexity of generating reports is high, and it is only applicable to the generation of simple reports. When generating reports with large data volumes, too many parameters need to be set, and the workload of report output is large. A method for automatic report output based on Labview is provided.
[0005] To achieve the above purpose, the technical solution adopted by the present invention is:
[0006] A Labview-based report automatic output method includes the following steps:
[0007] Step 1: Respond to the report output command through Labview and start report output;
[0008] Step 2: Use Labview to determine whether it is the first report output. If yes, go to step 3; if no, go to step 4;
[0009] Step 3: Output the report according to the single report output process;
[0010] Step 4: Open the report that needs to be modified and output the report according to the repeated report output process;
[0011] Step 5: Get the report that needs to be output and complete the automatic output of the report.
[0012] Furthermore, step 3 is specifically as follows:
[0013] Step 3.1, write the initial positioning label parameters required for report output into the corresponding label of the Labview preset template in a preset manner;
[0014] Step 3.2, write the initial positioning tag parameters in the corresponding tag into the string array of the Labview report record output to realize the report output;
[0015] Step 3.3: After the report output is completed, Labview performs initialization operations, assigns 0 to all labels and string arrays, and waits for the next report output.
[0016] Furthermore, in step 3.1, the preset method is to adopt a cluster form of tag name + data information.
[0017] Furthermore, step 4 is specifically as follows:
[0018] Step 4.1. Take the report to be modified as the original report and set the original report path where the data needs to be inserted.
[0019] Step 4.2: Convert the insertion data required for the new report output into a string with preset precision, and store it in the preset location of the original report according to the original report path, and generate a new report to be inserted;
[0020] Step 4.3, set the report type of the new report VI provided by Labview to Excel and the window status to nochange to display the report normally;
[0021] Step 4.4, set the index mode of the Add Report Text VI provided by Labview to the Excel table name of the new report, and initialize the string value written to the new report to 0 to clear the string value cached in the current Add Report Text VI;
[0022] Step 4.5. After initialization is completed, store the string that needs to be inserted into the new report into Labview's built-in report text adding VI to complete the change of the report content and realize report output.
[0023] Furthermore, in step 4.2, the preset precision is 3.
[0024] The beneficial effects of the present invention are:
[0025] 1. The present invention adopts a combination of single report output and repeated report output, which can meet the report output needs in different situations, meet the requirements of repeatedly writing data into reports, and automatically generate the required file format.
[0026] 2. The present invention responds to report output instructions through Labview, and can automatically generate reports with one key after inputting a character string, saving manpower and time and improving office efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION
[0028] To make the purpose, advantages and features of the present invention clearer, the following is a further detailed description of a Labview-based report automatic output method proposed by the present invention in conjunction with the accompanying drawings and specific embodiments. According to the following specific implementation methods, the advantages and features of the present invention will be clearer.
[0029] See also Figure 1 The present embodiment provides a method for automatically outputting reports based on Labview, which specifically includes the following steps:
[0030] Step 1: Respond to the report output command through Labview and start report output.
[0031] Step 2: Use Labview to determine whether it is the first report output. If so, execute step 3; if not, execute step 4.
[0032] Step 3: Output the report according to the report output process of method 1 (i.e. single time).
[0033] Step 3.1, write the initial positioning tag parameters required for report output into the corresponding tag of the preset template in the form of a cluster of tag name + data information; for example, store the "41" line at the position of the "41" line of the preset template.
[0034] Step 3.2, write the "41" line in the label "41" line into the string array of the report record output to realize the report output.
[0035] Step 3.3: After the report output is completed, perform initialization operations, assign 0 to all labels and string arrays, and wait for the next report output.
[0036] Step 4: Open the report that needs to be modified and output the report according to the report output process of method 2 (i.e., repeat).
[0037] Step 4.1: Set the report that needs to be changed as the original report and set the original report path where the data needs to be inserted.
[0038] Step 4.2: Convert the inserted data required for the new report output into a string of preset precision. In this embodiment, the preset precision is 3, that is, output three-dimensional decimals, accurate to thousandths, and store them in the preset position of the original report according to the original report path to generate a new report that needs to be inserted.
[0039] For example, convert the data named "1 Single Receipt V34" into a string value with a decimal string precision of 3, store it in the Q33 position of the Excel table of "Insert File Path" and generate a new report to be inserted.
[0040] Step 4.3, set the report type of Labview's new report VI to Excel and the window status to nochange. The purpose of this setting is to display the report normally after it is generated.
[0041] Step 4.4, set the index mode of Labview's built-in Add Report Text VI to the name of the Excel table for the new report, and initialize the string value written to the new report to 0 to clear the string value cached in the current Add Report Text VI. When the new report is output, the latest string value to be inserted will overwrite 0, and the string input of the new report can be realized.
[0042] Step 4.5: After initialization is completed, store the string to be inserted in the new report into the MS office cluster of Labview's built-in report text adding VI, merge the string value to be inserted with the string output by the previous report stored in Labview, complete the change of the report content, and realize repeated report output.
[0043] Based on the original report, the report output process of this second method can realize the re-filling of partial data under multiple report generation, ensure the integrity of the data, and facilitate the integrated analysis of the data.
[0044] Step 5: Get the report that needs to be output and complete the automatic output of the report.
[0045] The automatic report output design of this embodiment is programmed by combining two report output methods. Since the structure of method 1 is composed of multiple parts, the advantage is that it is simple and easy to understand and easy to change. The disadvantage is that the label filled in the template can only be used once. When it is necessary to fill in data multiple times and generate reports, this method is not feasible. Since method 2 stores data in the table position of the Excel file, it has the advantage of having the characteristic of repeatedly writing data. However, when this method is used alone for generating reports with large amounts of data, it is difficult to add / delete intermediate data due to the large amount of data in the string array, so there is a disadvantage of difficulty in changing.
[0046] However, the report output method based on the combination of the two report output methods can effectively combine the advantages of both, which can not only meet the requirements of repeatedly writing data into the report, but also achieve the purpose of being simple and easy to change.
[0047] It has been verified through experiments that the automatic report output method based on Labview is compared with manual data recording and processing under the premise of meeting the design functions. The method of the present invention does not require manual addition, modification, and merging of reports. Therefore, the efficiency is improved by nearly 20 times, and the programming complexity of the report output control that comes with Labview is reduced by nearly 5 / 6.
Claims
1. A report automatic output method based on Labview, characterized in that: The following steps are involved: Step 1: Respond to the report output command through Labview and start report output; Step 2: Use Labview to determine whether it is the first report output. If yes, go to step 3; if no, go to step 4; Step 3: Output the report according to the single report output process; Step 4: Open the report that needs to be modified and output the report according to the repeated report output process; Step 5: Get the report that needs to be output and complete the automatic output of the report.
2. The method for automatically outputting reports based on Labview according to claim 1, characterized in that: Step 3 is as follows: Step 3.1, write the initial positioning label parameters required for report output into the corresponding label of the Labview preset template in a preset manner; Step 3.2, write the initial positioning tag parameters in the corresponding tag into the string output by the Labview report record to realize the report output; Step 3.3: After the report is output, Labview performs initialization operations, assigns 0 to all labels and strings, and waits for the next report output.
3. The method for automatically outputting reports based on Labview according to claim 2, characterized in that: In step 3.1, the preset method is to adopt a cluster form of tag name + data information.
4. A Labview-based automatic report output method according to any one of claims 1 to 3, characterized in that: Step 4 is as follows: Step 4.
1. Take the report to be modified as the original report and set the original report path where the data needs to be inserted. Step 4.2: Convert the insertion data required for the new report output into a string with preset precision, and store it in the preset location of the original report according to the original report path, and generate a new report to be inserted; Step 4.3, set the report type of the new report VI provided by Labview to Excel and the window status to nochange to display the report normally; Step 4.4, set the index mode of the Add Report Text VI provided by Labview to the Excel table name of the new report, and initialize the string value written to the new report to 0 to clear the string value cached in the current Add Report Text VI; Step 4.
5. After initialization is completed, store the string that needs to be inserted into the new report into Labview's built-in report text adding VI to complete the change of the report content and realize report output.
5. The method for automatically outputting reports based on Labview according to claim 4, characterized in that: In step 4.2, the preset precision is 3.