Automatic parameter entry method and device for sensors
Patent Information
- Application Number
- CN202211726640.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-29
- Publication Date
- 2026-08-28
- Estimated Expiration
- 2042-12-29
AI Technical Summary
目前输入参数的方式基本上为手动输入,手动输入存在以下问题:1)输入效率低:参数需要一个个手动输入,一次输入需要输入数十个参数,会花费大量的时间;2)容易出错:用户输入时需要一个个核对参数,再将其依次输入,每个参数都需要精确到小数点后两位;当输入多个参数时,输入容易出错
Smart Images

Figure CN115952817B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automatic control technology, and in particular to a method and apparatus for automatically inputting sensor parameters. Background Technology
[0002] With the rapid development of the biopharmaceutical field, sensor technology is also advancing rapidly. In the biological culture process, a disposable optical sensor is used. This sensor is attached to the inside of a disposable culture bag and is replaced with each cell culture session. Furthermore, before each use, multiple calibration parameters need to be entered. These calibration parameters are usually attached to the bag, and the user needs to input them into the system according to the parameters on the bag.
[0003] Due to the large number of parameters, and the fact that the parameters vary each time they are calibrated, the current method of inputting parameters is basically manual. Manual input has the following problems: 1) Low input efficiency: Parameters need to be entered manually one by one, and dozens of parameters need to be entered at a time, which takes a lot of time; 2) Prone to errors: Users need to check the parameters one by one before entering them in sequence, and each parameter needs to be accurate to two decimal places; when inputting multiple parameters, it is easy to make mistakes. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a method and apparatus for automatically inputting sensor parameters, which can improve the efficiency and accuracy of parameter input.
[0005] In a first aspect, embodiments of the present invention provide an automatic parameter input method for sensors, applied to a PLC, the method comprising: Receive string-type QR code data sent by the barcode scanner; Convert the string-type QR code data into floating-point data; The number of integer digits and the number of decimal digits are determined based on the floating-point data. The number of integer digits and the number of decimal digits are calculated to obtain data in a standard format; Determine whether the data in the standard format is within the preset parameter threshold range; If present, the standard format data will be transferred to the corresponding register.
[0006] Furthermore, determining the number of integer digits and the number of decimal digits based on the floating-point data includes: Determine the first value of the floating-point data; The number of integer digits and the number of decimal digits are determined based on the first digit.
[0007] Furthermore, the number of integer digits and the number of decimal digits are calculated to obtain standard format data, including: The value of the integer part is determined based on the number of integer parts. The value of the decimal place is determined based on the number of decimal places; The integer part of the data is added to the fractional part of the data to obtain the data in the standard format.
[0008] Furthermore, determining whether the data in the standard format is within the preset parameter threshold range also includes: If not, a prompt message will pop up indicating that the QR code data is incorrect.
[0009] Furthermore, the method also includes: Obtain the data in the standard format input by the user; The data in the standard format is converted to obtain the converted format data; The converted format data is input into the QR code generator to obtain the QR code data.
[0010] Secondly, embodiments of the present invention provide an automatic parameter input device for sensors, applied to a PLC, the device comprising: The receiving module is used to receive string-type QR code data sent by the barcode scanner; The conversion module is used to convert the string-type QR code data into floating-point data; The determining module is used to determine the number of integer digits and the number of decimal digits based on the floating-point data; The calculation module is used to calculate the number of integer digits and the number of decimal digits to obtain data in a standard format; The judgment module is used to determine whether the data in the standard format is within the preset parameter threshold range; The transmission module is used to transmit the standard format data to the corresponding register when the data is within a preset parameter threshold range.
[0011] Furthermore, the determining module is specifically used for: Determine the first value of the floating-point data; The number of integer digits and the number of decimal digits are determined based on the first digit.
[0012] Furthermore, the calculation module is specifically used for: The value of the integer part is determined based on the number of integer parts. The value of the decimal place is determined based on the number of decimal places; The integer part of the data is added to the fractional part of the data to obtain the data in the standard format.
[0013] Thirdly, embodiments of the present invention provide an electronic device, including a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the processor executes the computer program to implement the method described above.
[0014] Fourthly, embodiments of the present invention provide a non-volatile computer-readable medium having processor-executable program code that causes the processor to perform the method described above.
[0015] This invention provides a method and apparatus for automatically inputting sensor parameters, applied to a PLC, comprising: receiving string-type QR code data sent by a barcode scanner; converting the string-type QR code data into floating-point data; determining the number of integer digits and the number of decimal digits based on the floating-point data; calculating the number of integer digits and the number of decimal digits to obtain data in a standard format; determining whether the data in the standard format is within a preset parameter threshold range; if so, transmitting the data in the standard format to the corresponding register; thereby improving the efficiency and accuracy of parameter input.
[0016] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.
[0017] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0018] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0019] Figure 1 This is a flowchart of the automatic parameter input method for a sensor provided in Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of the connection between the PLC and the barcode scanner provided in Embodiment 1 of the present invention; Figure 3 This is a schematic diagram of the automatic parameter input device for the sensor provided in Embodiment 2 of the present invention.
[0020] icon: 1-Receiving module; 2-Conversion module; 3-Determination module; 4-Calculation module; 5-Judgment module; 6-Transmission module. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] To facilitate understanding of this embodiment, the embodiments of the present invention will be described in detail below.
[0023] Example 1: Figure 1 This is a flowchart of the automatic parameter input method for a sensor provided in Embodiment 1 of the present invention.
[0024] Reference Figure 1 When applied to a PLC, this method includes the following steps: Step S101: Receive QR code data of string type sent by the barcode scanner; Here, when the barcode scanner successfully scans the code, the PLC's receive signal instruction (RCV_PTP instruction) will receive the string-type QR code data sent by the scanner. (Refer to...) Figure 2 The PLC is connected to the barcode scanner via a 232-to-Ethernet port, and the barcode scanner is powered by a 5V switching power supply.
[0025] Step S102: Convert the string-type QR code data into floating-point data; Here, since the QR code data needs to be processed, but string-type QR code data cannot be processed, it is necessary to convert the string-type QR code data into floating-point data. Because the data volume is large, this conversion needs to be performed sequentially using a FOR loop.
[0026] Step S103: Determine the number of integer digits and the number of decimal digits based on the floating-point data; Specifically, after the data format conversion is complete, the first data processing is required: determining the number of integer digits and the number of decimal digits based on the first digit of the floating-point data. Since the data volume is large, a FOR loop is used to process the data sequentially.
[0027] Step S104: Calculate the number of integer digits and the number of decimal digits to obtain data in standard format; Specifically, after determining the number of integer digits and the number of decimal digits, a second data processing step is required. The processed values are then summed to obtain data in a standard format. Due to the large volume of data, a FOR loop is used to process the data sequentially.
[0028] Step S105: Determine whether the standard format data is within the preset parameter threshold range; if it is, proceed to step S106; if not, proceed to step S107. Step S106: Transfer the standard format data to the corresponding register; In step S107, a prompt message pops up indicating that the QR code data is incorrect.
[0029] Here, the preset parameter threshold range includes an upper limit and a lower limit for data. If the standard format data is within the range of the lower and upper limits, the QR code data is correct. At this time, the standard format data is transferred to the corresponding register, that is, to the corresponding address. If the standard format data is higher than the upper limit or lower than the lower limit, a prompt message will pop up. At this time, it is necessary to check whether the QR code data is correct.
[0030] In this embodiment, after scanning the QR code with a barcode scanner, the string-type QR code data is sent to the PLC. The PLC will automatically identify and distinguish the data and input it. This method can improve the efficiency of data input. Furthermore, by judging whether the data in the standard format is within the preset parameter threshold range, if it does not meet the requirement, a prompt message will pop up, thereby improving the accuracy of data input.
[0031] Furthermore, step S103 includes the following steps: Step S201: Determine the first and second digits of the floating-point data; Step S202: Determine the number of integer digits and the number of decimal digits based on the first digit.
[0032] Furthermore, step S104 includes the following steps: Step S301: Determine the value of the integer part based on the number of integer parts; Step S302: Determine the value of the decimal places based on the number of decimal places; Step S303: Add the integer part value to the decimal part value to obtain data in standard format.
[0033] Specifically, first, the number of integer digits is determined based on the value of the first digit of the floating-point data. For example, if the floating-point data is OABCDE, with the first digit being 0; when the value of 0 is 2, the number of integer digits is 2 (i.e., AB), and the number of decimal digits is 3 (i.e., CDE); when the value of 0 is 3, the number of integer digits is 3 (i.e., ABC), and the number of decimal digits is 2 (i.e., DE). Secondly, determine the value of the integer part based on the number of integer parts; determine the value of the decimal part based on the number of decimal parts. For example, when there are two integer parts (AB), multiply A by 10 and B by 1 to get the integer parts values of 10A and 1B; when there are two decimal parts (CD), divide C by 10 and D by 100 to get the decimal parts values of C / 10 and D / 100. Finally, the integer and decimal values are added together to obtain the data in standard format; that is, 10A + 1B + C / 10 + D / 100, forming the data in standard format AB.CD. Due to the large amount of data, a FOR loop is used to process the data sequentially.
[0034] Furthermore, the method also includes the following steps: Step S401: Obtain data in a standard format input by the user; Step S402: Convert the standard format data to obtain the converted format data; Step S403: Input the converted format data into the QR code generator to obtain QR code data.
[0035] Specifically, the data that users typically input into the instrument is in a standard format, such as AB.CD. Before generating QR code data, to ensure easy reading by the PLC (Programmable Logic Controller), the decimal point of the standard format data needs to be removed, and it needs to be converted to ABCD format. For example, if the standard format data is 56.34, it will be converted to 5634, and then further data processing will be performed in the PLC program.
[0036] After converting the standard format data to the converted format, all the data needs to be written on the same line to generate the QR code data. Then, the converted format data is input into the QR code generator to finally generate the QR code data. The QR code data is then affixed to a scanning bag and scanned using a barcode scanner. This application combines complex data with a barcode scanner to improve the efficiency and accuracy of data input, especially in situations involving large amounts of data and frequent data entry.
[0037] This invention provides an automatic parameter input method for sensors, applied to a PLC, comprising: receiving string-type QR code data sent by a barcode scanner; converting the string-type QR code data into floating-point data; determining the number of integer digits and the number of decimal digits based on the floating-point data; calculating the number of integer digits and the number of decimal digits to obtain data in a standard format; determining whether the data in the standard format is within a preset parameter threshold range; if so, transmitting the data in the standard format to the corresponding register; thereby improving the efficiency and accuracy of parameter input.
[0038] Example 2: Figure 3 This is a schematic diagram of the automatic parameter input device for the sensor provided in Embodiment 2 of the present invention.
[0039] Reference Figure 3 Applied to PLCs, the device includes: Receiver module 1 is used to receive string-type QR code data sent by the barcode scanner; Conversion module 2 is used to convert string-type QR code data into floating-point data; Module 3 is used to determine the number of integer digits and the number of decimal digits based on floating-point data. Calculation module 4 is used to calculate the number of integer digits and the number of decimal digits to obtain data in a standard format; Module 5 is used to determine whether data in standard format is within the preset parameter threshold range; The transmission module 6 is used to transmit standard format data to the corresponding register when the standard format data is within the preset parameter threshold range.
[0040] Furthermore, module 3 is specifically used for: Determine the first value of a floating-point data type; The number of integer digits and the number of decimal digits are determined based on the first digit.
[0041] Furthermore, the calculation module 4 is specifically used for: The value of the integer part is determined by the number of integer digits. The value of the decimal places is determined by the number of decimal places. Add the integer part of the value to the decimal part to obtain the data in the standard format.
[0042] Furthermore, the judgment module 5 is specifically used for: If not, a prompt message will pop up indicating that the QR code data is incorrect.
[0043] Furthermore, the device also includes: A data acquisition module (not shown) is used to acquire data in a standard format input by the user. The format conversion module (not shown) is used to convert data in a standard format to obtain the converted format data. The input module (not shown) is used to input the converted format data into the QR code generator to obtain QR code data.
[0044] This invention provides an automatic parameter input device for sensors, applied to a PLC, comprising: receiving string-type QR code data sent by a barcode scanner; converting the string-type QR code data into floating-point data; determining the number of integer digits and the number of decimal digits based on the floating-point data; calculating the number of integer digits and the number of decimal digits to obtain data in a standard format; determining whether the data in the standard format is within a preset parameter threshold range; if so, transmitting the data in the standard format to the corresponding register; thereby improving the efficiency and accuracy of parameter input.
[0045] This invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the automatic parameter input method for the sensor provided in the above embodiments.
[0046] This invention also provides a computer-readable medium having processor-executable non-volatile program code, on which a computer program is stored, and which, when run by a processor, executes the steps of the sensor parameter automatic input method described above.
[0047] The computer program product provided in this embodiment of the invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation details, please refer to the method embodiments, which will not be repeated here.
[0048] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0049] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.
[0050] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0051] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0052] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for automatically inputting sensor parameters, characterized in that, Applied to a PLC, the method includes: Receive string-type QR code data sent by the barcode scanner; Convert the string-type QR code data into floating-point data; The number of integer digits and the number of decimal digits are determined based on the floating-point data. The number of integer digits and the number of decimal digits are calculated to obtain data in a standard format; Determine whether the data in the standard format is within the preset parameter threshold range; If present, the standard format data will be transferred to the corresponding register. Determining the number of integer digits and the number of decimal digits based on the floating-point data includes: Determine the first value of the floating-point data; The number of integer digits and the number of decimal digits are determined based on the first digit. The number of integer digits and the number of decimal digits are calculated to obtain standard format data, including: The value of the integer part is determined based on the number of integer parts. The value of the decimal place is determined based on the number of decimal places; The integer part of the data is added to the fractional part of the data to obtain the data in the standard format.
2. The automatic parameter input method for the sensor according to claim 1, characterized in that, Determining whether the standard format data is within the preset parameter threshold range also includes: If not, a prompt message will pop up indicating that the QR code data is incorrect.
3. The automatic parameter input method for the sensor according to claim 1, characterized in that, The method further includes: Obtain the data in the standard format input by the user; The data in the standard format is converted to obtain the converted format data; The converted format data is input into the QR code generator to obtain the QR code data.
4. An automatic parameter input device for a sensor, characterized in that, The device, applied to a PLC, includes: The receiving module is used to receive string-type QR code data sent by the barcode scanner; The conversion module is used to convert the string-type QR code data into floating-point data; The determining module is used to determine the number of integer digits and the number of decimal digits based on the floating-point data; The calculation module is used to calculate the number of integer digits and the number of decimal digits to obtain data in a standard format; The judgment module is used to determine whether the data in the standard format is within the preset parameter threshold range; The transmission module is used to transmit the standard format data to the corresponding register when the standard format data is within a preset parameter threshold range; The determining module is specifically used for: Determine the first value of the floating-point data; The number of integer digits and the number of decimal digits are determined based on the first digit. The calculation module is specifically used for: The value of the integer part is determined based on the number of integer parts. The value of the decimal place is determined based on the number of decimal places; The integer part of the data is added to the fractional part of the data to obtain the data in the standard format.
5. An electronic device, comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor executes the computer program, it implements the method described in any one of claims 1 to 3.
6. A non-volatile computer-readable medium having processor-executable program code, characterized in that, The program code causes the processor to execute the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Optical fiber grating sensor sensing parameter coding and decoding method and coding and decoding terminal
CN106404012A
Ultrasonic color imaging processing method and device thereof
CN111265246A