Signal conversion output device and method and electronic equipment

By designing a signal conversion output device, using serial protocol message analysis and circuit control, high-precision digital signal to analog signal conversion is realized, solving the problems of high cost and poor stability in the existing technology, and improving the accuracy of signal conversion and stability.

CN119232166APending Publication Date: 2024-12-31SHANGHAI FEEJOY ELECTRONICS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411325924.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The existing digital signal to analog signal converters are costly and have insufficient output accuracy, resulting in poor stability and inability to meet practical application requirements.

Method used

Design a signal conversion output device, including input module, conversion module and output module, and control current or voltage signals output from circuits such as DAC chip and operation amplifier to achieve accurate results by identifying and parsing command codes and function codes in serial port protocol messages. analog signal conversion.

Benefits of technology

It improves the accuracy and stability of signal conversion, reduces overall costs, and meets the diverse needs of users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119232166A_ABST
    Figure CN119232166A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of signal conversion, in particular to a signal conversion output device and method and electronic equipment, and the device comprises an input module which is used for receiving a digital signal, corresponding to a product demand, of signal input equipment; the conversion module is used for analyzing a serial port protocol message in the digital signal to generate an analysis result, and converting the digital signal into a corresponding analog signal according to the analysis result; and the output module is used for outputting the analog signal to target equipment. Therefore, the problems of poor stability, high cost and the like caused by the fact that signal conversion is realized only through a digital-to-analog converter and the output precision cannot be ensured in the related technology are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of signal conversion, and in particular to a signal conversion output device, method and electronic equipment. Background Art

[0002] With the development of electronic technology, digital signals have become the first choice for signal output due to their strong anti-interference, no noise accumulation, and easy encryption, storage, processing and exchange. However, in actual use, some auxiliary equipment requires analog input signals, and these devices are expensive and the replacement cost is too high, so devices that convert digital signals into analog signals are also needed. For example, the heading signal, pitch and roll attitude signal of the marine platform compass are divided into compass, heading data recorder, etc.

[0003] In the related art, a highly integrated digital signal to analog signal converter is used to achieve signal conversion, which is costly and cannot guarantee output accuracy, resulting in poor stability. Summary of the invention

[0004] The present application provides a signal conversion output device, method and electronic device to solve the problems in the related art of realizing signal conversion only through a digital-to-analog converter, failing to ensure output accuracy, resulting in poor stability and high cost.

[0005] The first aspect of the present application provides a signal conversion and output device, which is applied to a level detection device or a flow detection device, including: an input module, used to receive a digital signal corresponding to a product requirement of a signal input device; a conversion module, used to parse a serial port protocol message in the digital signal to generate a parsing result, and convert the digital signal into a corresponding analog signal according to the parsing result; an output module, used to output the analog signal to a target device.

[0006] Optionally, the conversion module includes: an identification unit, used to identify the command code and function code of the serial port protocol message; and a parsing unit, used to determine an analog signal of a corresponding output current value or output voltage value according to the command code and the function code.

[0007] Optionally, the conversion module also includes: a processing unit, used to control the current output circuit to output a corresponding current value when the analysis result is to output a preset current value; and, when the analysis result is to output a preset voltage value, control the voltage output circuit to output a corresponding voltage value.

[0008] Optionally, the current output circuit includes: a DAC chip, an operational amplifier, a MOS tube and an MCU control chip; wherein the input end of the DAC chip is connected to the output end of the MCU control chip; the input end of the operational amplifier is connected to the output end of the DAC chip; the gate of the MOS tube is connected to the output end of the operational amplifier, the source of the MOS tube is connected to the current output end, and the drain of the MOS tube is respectively grounded and connected to the reverse input end of the operational amplifier.

[0009] Optionally, the voltage output circuit includes: an operational amplifier, a transistor and an MCU control chip; wherein, the input end of the operational amplifier is connected to the output end of the MCU control chip, the output end of the operational amplifier is connected to the base of the transistor, the collector of the transistor is connected to the voltage output port, and the emitter of the transistor is connected to the inverting input end of the operational amplifier.

[0010] Optionally, the command code is set at the first preset field position of the serial port protocol message, and is used to map different working modes through command codes with different numerical values; wherein the working mode includes an output mode and a calibration mode; a function code is set at the second preset field position of the serial port protocol message; when the command code corresponds to the output mode, different analog signal output specifications are mapped through function codes with different numerical values; when the command code corresponds to the calibration mode, whether it can be written to a storage device is mapped through function codes with different numerical values; data bit information is set at the third preset field position of the serial port protocol message, and the data bit information includes an output current value or an output voltage value.

[0011] The second aspect of the present application provides a signal conversion and output method, which is applied to a level detection device or a flow detection device, and includes the following steps: obtaining a digital signal corresponding to a product requirement of a signal input device; parsing a serial port protocol message in the digital signal to generate a parsing result; converting the digital signal into a corresponding analog signal according to the parsing result; and outputting the analog signal to a target device.

[0012] Optionally, parsing the serial port protocol message in the protocol digital signal to generate a parsing result includes: identifying a command code and a function code of the serial port protocol message, wherein the command code defines different operating modes, and the operating modes include an output mode and a calibration mode; when the command code corresponds to the output mode, determining an output current value or an output voltage value according to the command code and the function code.

[0013] Optionally, converting the protocol digital signal into a corresponding analog signal according to the analysis result includes: when the command code corresponds to a calibration mode, executing the corresponding calibration data in the digital signal; after the calibration is completed, writing the calibration data into a memory and setting a successful calibration flag in the memory; judging whether the calibration data is stored according to the flag at the next startup; if the calibration data is stored, loading and executing the calibration data, otherwise waiting for the next calibration. .

[0014] Optionally, converting the protocol digital signal into a corresponding analog signal according to the analysis result includes: if the analysis result is to output a preset current value, then controlling the current output circuit to output the corresponding current value; the current output circuit includes a DAC chip, an operational amplifier, a MOS tube and an MCU control chip; if the analysis result is to output a preset voltage value, then controlling the voltage output circuit to output the corresponding voltage value; the voltage output circuit includes an operational amplifier, a transistor and an MCU control chip.

[0015] Therefore, this application has at least the following beneficial effects:

[0016] The embodiment of the present application can receive a digital signal corresponding to a product requirement of a signal input device, parse the serial port protocol message in the digital signal to generate a parsing result, convert the digital signal into a corresponding analog signal according to the parsing result, and output the analog signal to a target device to meet the diverse needs of users, improve the accuracy and stability of data output, and have a relatively low overall cost.

[0017] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0019] Figure 1 A block diagram of a signal conversion output device provided according to an embodiment of the present application;

[0020] Figure 2 A schematic diagram of a signal conversion output device provided according to an embodiment of the present application;

[0021] Figure 3 A schematic diagram of a current output circuit provided according to an embodiment of the present application;

[0022] Figure 4 A schematic diagram of a voltage output circuit provided according to an embodiment of the present application;

[0023] Figure 5 A schematic diagram of an MCU chip provided according to an embodiment of the present application;

[0024] Figure 6 This is a diagram showing the internal structure of a signal conversion and output device according to an embodiment of the present application;

[0025] Figure 7 A flowchart of a signal conversion output method provided according to an embodiment of the present application;

[0026] Figure 8 It is an initialization flow chart provided according to an embodiment of the present application;

[0027] Fig. 9 A flowchart of the working mode provided according to an embodiment of the present application;

[0028] Fig.10 A Flash read and write flow chart provided according to an embodiment of the present application;

[0029] Fig.11 The present invention provides a serial communication flow chart according to an embodiment of the present application. DETAILED DESCRIPTION

[0030] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0031] The signal conversion output device, method and electronic device of the present application are described below with reference to the accompanying drawings. Specifically, Figure 1 A schematic diagram of a signal conversion output device provided in an embodiment of the present application.

[0032] Figure 1 It is a block diagram of a signal conversion output device according to an embodiment of the present application.

[0033] like Figure 1 As shown, the signal conversion and output device 10 is applied to a level detection device or a flow detection device, and includes: an input module 100 , a conversion module 200 and an output module 300 .

[0034] Among them, the input module 100 is used to receive the digital signal corresponding to the product requirements of the signal input device; the conversion module 200 is used to parse the serial port protocol message in the digital signal to generate a parsing result, and convert the digital signal into a corresponding analog signal according to the parsing result; the output module 300 is used to output the analog signal to the target device.

[0035] It can be understood that the embodiments of the present application can receive the digital signal corresponding to the product requirements of the signal input device through the input module, parse the serial port protocol message in the digital signal through the conversion module to generate a parsing result, convert the digital signal into a corresponding analog signal according to the parsing result, and output the analog signal to the target device to meet the diverse needs of users and improve the accuracy and stability of data output.

[0036] It should be noted that if Figure 2 As shown, the input module includes: a pluggable and replaceable connecting connector and an input aviation interface, wherein one end of the connecting connector is connected to a signal input device, the other end is connected to the input aviation interface, and the other end of the input aviation interface is connected to a conversion module; the output module includes an output aviation connector.

[0037] Specifically, M12 connecting connectors are used on the physical structure to achieve quick plug-in and replacement, and the outer diameter of the shell itself is similar to that of the connecting wire, making it almost indistinguishable from the connecting wire. The signal does not require calibration or adjustment, making it plug-and-play, compact and stable. The input aviation connector is mainly connected to the signal input device to obtain the main interface for protocol signals and power supply. The output aviation connector serves as the main interface component for power supply input and analog signal output.

[0038] In the embodiments of the present application, Figure 2 As shown, the conversion module 200 includes: an identification unit, used to identify the command code and function code of the serial port protocol message; and a parsing unit, used to determine the analog signal of the corresponding output current value or output voltage value according to the command code and function code.

[0039] It can be understood that the conversion module of the embodiment of the present application can identify the command code and function code of the serial port protocol message, and determine the analog signal of the corresponding output current value or output voltage value according to the command code and function code to meet the diverse needs of users and improve the accuracy and stability of data output.

[0040] It should be noted that the conversion module includes a cavity and a circuit module, wherein the circuit module is placed in the cavity, one end of the circuit module is connected to the input aviation interface, and the other end is connected to the output module; the cavity serves as a protective structure for the circuit module, isolating the circuit from external contact to prevent damage; the circuit module is the core part of the device, responsible for completing the conversion of protocol signals and the output of analog data.

[0041] In the embodiment of the present application, the conversion module 200 also includes: a processing unit, which is used to control the current output circuit to output the corresponding current value when the analysis result is to output a preset current value; and, when the analysis result is to output a preset voltage value, control the voltage output circuit to output the corresponding voltage value.

[0042] Among them, Figure 3and Figure 5 As shown, the current output circuit includes: a DAC chip, an operational amplifier, a MOS tube and an MCU control chip.

[0043] Among them, the input end of the DAC chip is connected to the output end of the MCU control chip; the input end of the operational amplifier is connected to the output end of the DAC chip; the gate of the MOS tube is connected to the output end of the operational amplifier, the source of the MOS tube is connected to the current output end, and the drain of the MOS tube is respectively connected to the ground and the reverse input end of the operational amplifier.

[0044] It should be noted that the current output circuit outputs voltage to the op amp through the DAC chip, controls the OUT pin to output to the MOS tube, and then connects the op amp -IN pin through the MOS tube output to serve as negative feedback regulation to stabilize the current output; the second end of the MOS tube is connected to the current output port.

[0045] Specifically, if the command received is to output 4-20mA current, the MCU controls the output voltage of the DAC chip, thereby adjusting the op amp and MOS tube to adjust the corresponding output current through negative feedback.

[0046] Among them, Figure 4 and Figure 5 As shown, the voltage output circuit includes: an operational amplifier, a triode and an MCU control chip.

[0047] Among them, the input end of the operational amplifier is connected to the output end of the MCU control chip, the output end of the operational amplifier is connected to the base of the transistor, the collector of the transistor is connected to the voltage output port, and the emitter of the transistor is connected to the inverting input end of the operational amplifier.

[0048] It should be noted that when the voltage output circuit receives a command to output 0-5v / 0-10v voltage output, the PWM output is controlled by the MCU, thereby controlling the voltage output through the op amp and transistor.

[0049] In an embodiment of the present application, it also includes: setting a command code at a first preset field position of a serial port protocol message, for mapping different working modes through command codes with different numerical values; wherein the working mode includes an output mode and a calibration mode; setting a function code at a second preset field position of the serial port protocol message; when the command code corresponds to the output mode, mapping different analog signal output specifications through function codes with different numerical values; when the command code corresponds to the calibration mode, mapping whether it can be written to a storage device through function codes with different numerical values; setting data bit information at a third preset field position of the serial port protocol message, the data bit information including an output current value or an output voltage value.

[0050] Among them, the first preset field position is the fourth byte; the second preset field position is the fifth byte; the third preset field position is the sixth byte to the Nth byte, without specific limitation.

[0051] It should be noted that the serial port protocol message includes: first to Nth bytes.

[0052] Among them, the first byte and the second byte are the frame header, which are used to identify the frame start signal; the third byte is the device address, which is used for communication between different devices; the fourth byte includes the command code, which is used to implement the corresponding function through different command codes, wherein the command code includes the output mode and the calibration mode; the fifth byte includes the function code, which is used to implement the corresponding current or voltage output through different function codes, wherein the function code includes the first to third function codes; the sixth byte includes the data length, and the seventh to Nth bytes include the current value or the voltage value.

[0053] Specifically, the internal serial port protocol stipulates the following: the received data cannot exceed 512 bytes at most and cannot be less than 4 bytes at least. The first two bytes and the last two bytes of the received data have special meanings. Assuming that N bytes are received at one time:

[0054] 1 Byte 2Byte ...... N-1Byte N Byte

[0055] Bytes 1-2: Frame header; used to identify the start of frame signal

[0056] The third byte: device address; used for communication between different devices, one-to-many communication is possible, and different devices use different addresses;

[0057] The fourth byte: command code; for example, different command codes are used to implement actual functions, such as command code 0x01: output mode; 0x02: calibration mode;

[0058] The fifth byte: function code; for example: 0x01: current output; 0x02: 0-5v voltage output; 0x03: 0-10v voltage output;

[0059] The sixth byte: data length; the actual length of the data sent is n;

[0060] n bytes: data; among them, corresponding data values, such as current value, voltage value, etc.;

[0061] The module outputs analog quantity through the above serial port protocol control.

[0062] like Figure 6 As shown, the signal output device module of the present application consists of three parts: serial port input, circuit unit and analog output interface. During use, the digital signal to be output is received through the serial port, and the output port is controlled to output the corresponding analog signal (current signal / voltage signal).

[0063] According to the signal conversion and output device proposed in the embodiment of the present application, the digital signal corresponding to the product requirements of the signal input device is received through the input module, the serial port protocol message in the digital signal is parsed by the conversion module to generate a parsing result, the digital signal is converted into a corresponding analog signal according to the parsing result, and the analog signal is output to the target device to meet the diverse needs of users, improve the accuracy and stability of data output, and the overall cost is low.

[0064] Figure 7 A flow chart of a signal conversion output method provided in an embodiment of the present application.

[0065] like Figure 7 As shown, the signal conversion output method is applied to a level detection device or a flow detection device, wherein the method comprises the following steps:

[0066] In step S101, a digital signal corresponding to a product requirement of a signal input device is obtained.

[0067] It can be understood that the embodiment of the present application can obtain the digital signal of the signal input device corresponding to the product requirements, so as to facilitate the subsequent analysis of the serial port protocol message in the digital signal to generate the analysis result.

[0068] It should be noted that if Figure 8 and Fig. 9 As shown, before obtaining the digital signal corresponding to the product requirements of the signal input device, the main chip, serial port, and SPI need to be initialized; the serial port is converted to analog output, and data is received through the 485 interface and converted to analog output. The following mainly introduces the workflow of the software to convert digital signals into analog signals.

[0069] In an embodiment of the present application, it also includes: when the command code corresponds to the calibration mode, executing the corresponding calibration data in the digital signal; after the calibration is completed, writing the calibration data into the memory, and setting the calibration success flag in the memory; at the next startup, judging whether the calibration data is stored according to the flag; if the calibration data is stored, loading and executing the calibration data, otherwise waiting for the next calibration.

[0070] It can be understood that the embodiment of the present application can execute the corresponding calibration data in the digital signal when the command code corresponds to the calibration mode; after the calibration is completed, the calibration data is written into the memory, and the calibration success flag is set in the memory; at the next startup, it is determined whether the calibration data is stored according to the flag; if the calibration data is stored, the calibration data is loaded and executed, otherwise wait for the next calibration to prevent data loss due to power failure.

[0071] It should be noted that the protocol is used for calibration and control output. After the calibration is successful, there will be a mark position in the flash. At the same time, if the MCU reads the flash mark position, it means that the calibration is successful. If the mark position is not set, it means that the calibration has not been performed. After completing this set of actions, it means that the calibration is successful. At this time, the calibration data can be used to perform the test calculation. When it is started next time, it is determined whether there is calibration. If there is calibration data, the calibration data is used. If there is no calibration data, wait for the next calibration.

[0072] Specifically, if Fig.10 As shown in the figure, some data in the program need to be written to the Flash to prevent loss during power failure. To prevent misoperation, data is written to the Flash only when the write data flag is set to 1, and the values ​​are read from the Flash when the data is used. The specific process is as follows: Flash stores read data, determines whether calibration data exists, and if so, parses and calculates the data. Otherwise, waits for the calibration data to be written to the Flash memory.

[0073] In step S102, the serial port protocol message in the digital signal is parsed to generate a parsing result.

[0074] It is understandable that the embodiments of the present application can parse the serial port protocol message in the digital signal to generate a parsing result, so as to subsequently convert the digital signal into a corresponding analog signal according to the parsing result and output the analog signal to the target device.

[0075] It should be noted that if Fig.11 As shown, step 1, initialize the Universal Asynchronous Receiver / Transmitter (UART): set the baud rate, data bit, stop bit and other parameters of UART; step 2, determine whether data is received: if data is received, execute step 3, otherwise return to step 1; step 3, data analysis: parse the received data and extract useful data; step 4, determine whether the data message is correct: if the data message is correct, execute step 5, otherwise return to step 1; step 6, execute the corresponding function: execute the corresponding function according to the parsed data.

[0076] In an embodiment of the present application, a serial port protocol message in a protocol digital signal is parsed to generate a parsing result, including: identifying a command code and a function code of the serial port protocol message, wherein the command code defines different working modes, and the working modes include an output mode and a calibration mode; when the command code corresponds to the output mode, the output current value or the output voltage value is determined according to the command code and the function code.

[0077] It can be understood that the embodiments of the present application can identify the command code and function code of the serial port protocol message; the command code defines different operating modes; when the command code corresponds to the output mode, the output current value or the output voltage value is determined according to the command code and the function code to facilitate the subsequent output of the analog signal to the target device.

[0078] Specifically, if the command code is 0x01, the output function is implemented according to the function code, for example: 0x01 is current output; 0x02 is 0-5v voltage output; 0x03 is 0-10v voltage output; if the command code is 0x02, the calibration function is implemented, and the corresponding calibration value is output according to the calibration result.

[0079] In step S103 , the digital signal is converted into a corresponding analog signal according to the analysis result, and the analog signal is output to the target device.

[0080] It can be understood that the embodiments of the present application can convert digital signals into corresponding analog signals according to the analysis results, and output the analog signals to the target device to meet the diverse needs of users, improve the accuracy and stability of data output, and the overall cost is relatively low.

[0081] In an embodiment of the present application, the protocol digital signal is converted into a corresponding analog signal according to the analysis result, including: if the analysis result is to output a preset current value, then the current output circuit is controlled to output the corresponding current value; the current output circuit includes a DAC chip, an operational amplifier, a MOS tube and an MCU control chip; if the analysis result is to output a preset voltage value, then the voltage output circuit is controlled to output the corresponding voltage value; the voltage output circuit includes an operational amplifier, a transistor and an MCU control chip.

[0082] Among them, the preset current value can be 4-20mA, and the preset voltage value can be 0-5V or 0-10V, which can be set according to actual needs without specific limitation.

[0083] Specifically, if the command received is to output 4-20mA current output, the MCU controls the output voltage of the DAC chip, thereby adjusting the op amp and the MOS tube to adjust the output corresponding current through negative feedback, and the DAC chip outputs the voltage to the op amp, controls the OUT pin to output to the MOS tube, and then connects the op amp -IN pin through the MOS tube output, as a negative feedback adjustment to stabilize the current output; the second end of the MOS tube is connected to the current output port;

[0084] If the command received is to output 0-5v / 0-10v voltage output, the PWM output is controlled by the MCU, and the voltage output is controlled by the operational amplifier and the transistor; the input end of the operational amplifier is connected to the output end of the MCU control chip, the output end of the operational amplifier is connected to the base of the transistor, the collector of the transistor is connected to the voltage output port, and the emitter of the transistor is connected to the inverting input end of the operational amplifier.

[0085] It should be noted that the signal conversion output device is used to convert digital signals (such as RS-485 communication protocol) into analog signals (such as current or voltage) in order to interface and communicate with other devices or systems. Specifically:

[0086] 1. 485 to 4-20mA current conversion:

[0087] This device receives digital signals from the 485 bus and converts them into 4-20mA analog current signals through internal circuits.

[0088] 4-20mA current signal is usually used for remote transmission, and has the advantages of strong anti-interference ability and long transmission distance.

[0089] The output 4mA usually represents zero point, 20mA represents full scale, and the current values ​​in between correspond linearly to the input digital signal values.

[0090] 2. 485 to 0-5V voltage conversion:

[0091] This device converts the digital signal on the 485 bus into an analog voltage signal of 0-5V.

[0092] 0V usually represents the minimum value, 5V represents the maximum value, and the voltage values ​​in between correspond linearly to the input digital signal values.

[0093] 0-5V voltage signal is suitable for the interface of many sensors and control systems and has a wide range of application scenarios.

[0094] 3. 485 to 0-10V voltage conversion:

[0095] This device converts the digital signal on the 485 bus into a 0-10V analog voltage signal.

[0096] 0V represents the minimum value, 10V represents the maximum value, and the voltage values ​​in between are also linearly related.

[0097] 0-10V voltage signals are often used in applications that require higher accuracy and dynamic range, such as sensor interfaces in industrial control and process automation.

[0098] According to the signal conversion and output method proposed in the embodiment of the present application, a digital signal corresponding to the product requirements of a signal input device is received, the serial port protocol message in the digital signal is parsed to generate a parsing result, the digital signal is converted into a corresponding analog signal according to the parsing result, and the analog signal is output to the target device to meet the diverse needs of users and improve the accuracy and stability of data output.

[0099] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0100] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0101] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or N executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0102] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one or a combination of multiple of the following technologies known in the art: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0103] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

Claims

1. A signal conversion output device, characterized in that: Applied to level detection equipment or flow detection equipment, including: An input module is used to receive digital signals corresponding to product requirements from a signal input device; A conversion module, used for parsing the serial port protocol message in the digital signal to generate a parsing result, and converting the digital signal into a corresponding analog signal according to the parsing result; The output module is used to output the analog signal to the target device.

2. The signal conversion output device according to claim 1, characterized in that: The conversion module comprises: An identification unit, used for identifying the command code and function code of the serial port protocol message; The parsing unit is used to determine an analog signal of a corresponding output current value or output voltage value according to the command code and the function code.

3. The signal conversion output device according to claim 1, characterized in that: The conversion module also includes: The processing unit is used to control the current output circuit to output the corresponding current value when the analysis result is to output the preset current value; and to control the voltage output circuit to output the corresponding voltage value when the analysis result is to output the preset voltage value.

4. The signal conversion output device according to claim 3, characterized in that: The current output circuit includes: a DAC chip, an operational amplifier, a MOS tube and an MCU control chip; Wherein, the input end of the DAC chip is connected to the output end of the MCU control chip; The input end of the operational amplifier is connected to the output end of the DAC chip; The gate of the MOS tube is connected to the output end of the operational amplifier, the source of the MOS tube is connected to the current output end, and the drain of the MOS tube is respectively connected to the ground and the reverse input end of the operational amplifier.

5. The signal conversion output device according to claim 3, characterized in that: The voltage output circuit includes: an operational amplifier, a triode and an MCU control chip; Among them, the input end of the operational amplifier is connected to the output end of the MCU control chip, the output end of the operational amplifier is connected to the base of the transistor, the collector of the transistor is connected to the voltage output port, and the emitter of the transistor is connected to the inverting input end of the operational amplifier.

6. The signal conversion output device according to claim 1, characterized in that: The command code is set at the first preset field position of the serial port protocol message, so as to map different working modes through command codes with different values; wherein the working modes include output mode and calibration mode; A function code is set at a second preset field position of the serial port protocol message; when the command code corresponds to an output mode, different analog signal output specifications are mapped by function codes with different values; when the command code corresponds to a calibration mode, whether the function code with different values ​​can be written to a storage device is mapped; Data bit information is set at a third preset field position of the serial port protocol message, and the data bit information includes an output current value or an output voltage value.

7. A signal conversion output method, applied to a level detection device or a flow detection device, characterized in that: The following steps are involved: Obtain digital signals corresponding to product requirements from signal input devices; Parsing the serial port protocol message in the digital signal to generate a parsing result; Converting the digital signal into a corresponding analog signal according to the analysis result; The analog signal is output to a target device.

8. The signal conversion output method according to claim 7, characterized in that: The step of parsing the serial port protocol message in the protocol digital signal to generate a parsing result includes: Identify the command code and function code of the serial port protocol message, wherein the command code defines different working modes, and the working modes include output mode and calibration mode; When the command code corresponds to an output mode, an output current value or an output voltage value is determined according to the command code and the function code.

9. The signal conversion and output method according to claim 8, characterized in that: Also includes: When the command code corresponds to a calibration mode, executing the corresponding calibration data in the digital signal; After the calibration is completed, the calibration data is written into the memory, and a successful calibration flag is set in the memory; At the next startup, it is determined whether the calibration data is stored according to the identification bit; if the calibration data is stored, the calibration data is loaded and executed, otherwise, the next calibration is waited for.

10. The signal conversion output method according to claim 7, characterized in that: The converting the protocol digital signal into a corresponding analog signal according to the analysis result includes: If the analysis result is to output a preset current value, the current output circuit is controlled to output a corresponding current value; the current output circuit includes a DAC chip, an operational amplifier, a MOS tube and an MCU control chip; If the analysis result is to output a preset voltage value, the voltage output circuit is controlled to output the corresponding voltage value; the voltage output circuit includes an operational amplifier, a transistor and an MCU control chip.