A method and control system for preventing failure of a dial switch

Through manual dialing and address solidification processing in the firmware program, the device addressing problem caused by the failure of the dial switch is solved, ensuring that the device can still work normally after failure, improving stability and reducing maintenance costs, and realizing device address Visual solidification.

CN117951066BActive Publication Date: 2024-08-27CHANGZHOU CHUANGHE TRADING CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202410050213.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-11
Publication Date
2024-08-27
Estimated Expiration
2044-01-11

AI Technical Summary

Technical Problem

The failure of the DIP switch causes the device address code to change, and the master device cannot accurately address the slave device, which affects the communication of other devices on the communication bus.

Method used

When the firmware program is running, manually dial the code and read the dial switch information to determine whether it is a special code. If so, erase and recode it. If not, use the dial code information as the address, complete the address solidification and write it to the flash memory chip. , to ensure that the system is running; and identify the cured address through the flashing of the breathing light.

Benefits of technology

In the event of DIP switch failure, the equipment can still continue to work, improving stability and reliability, reducing maintenance costs, being compatible with existing technology and hardware, and is simple to operate without the need for special tools.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117951066B
    Figure CN117951066B
Patent Text Reader

Abstract

A method and control system for preventing a dip switch from failing. The method is implemented before the dip switch fails and comprises the following steps: S1, when the firmware program of the device is running, the information of the dip switch is read after manual dialing and manual power-on to determine whether the code of the dip switch is a special code; S2, determining whether the address information in a flash storage chip is a fixed address; if so, continuing to run using the fixed address; if not, continuing to run using the dip information as the address; S3, determining whether a fixing instruction of a host computer is received; if not, continuing to run the system; if received, entering the address fixing logic, first reading the dip switch information, then running the address fixing operation, writing the latest read dip information as the address code into the flash storage chip, and then using the address fixed in the flash storage chip for system operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of dip switches, and in particular to a control system for preventing dip switches from failing. Background Art

[0002] The addressing application of the dip switch in the bus communication architecture. In the communication architecture that connects multiple devices in series by bus communication (such as 485 bus, CAN bus, etc.), the master device (i.e. the request initiator) uses the bus addressing method to find the slave device (the request responder), and the device mostly uses the dip switch to encode the device according to the 8421 encoding rule, which is called the address code (or address). By giving different address codes to different devices, all devices on the communication bus can be distinguished, so as to accurately control the target device and distinguish the information returned by different devices.

[0003] The disadvantages are as follows:

[0004] The method of using a dip switch to encode the device according to the 8421 encoding rule has a disadvantage, that is, when any of the dip switches fails, the address code of the device may change. When the address code of the device changes, the master device (the request initiator) will not be able to accurately find the slave device (the request responder) through addressing, and the communication on the bus will be disturbed by the presence of the wrong address code device.

[0005] Right now:

[0006] A. Failure of the DIP switch will result in the inability to address the target device, control the target device, and receive information from the target device;

[0007] B. Failure of the DIP switch will cause interference to the communication bus and affect the communication of other devices.

[0008] The reasons for the failure of the DIP switch are as follows:

[0009] During the life cycle of a DIP switch, there is a possibility of failure of the internal mechanical reed contact of the DIP switch and failure of the contact of the welding point of the DIP switch device due to external environments such as dust, smoke, and hot and cold stress. This is collectively referred to as a DIP switch failure.

[0010] In view of this, those skilled in the art need to effectively control the existing DIP switches to prevent failure. Summary of the invention

[0011] The main purpose of this application is to provide a method and a control method for preventing the failure of a dip switch, which can ensure that the device can continue to work after the dip switch fails.

[0012] In order to achieve the above-mentioned purpose, in a first aspect, the present application provides a method for preventing a dip switch from failing, which is implemented before the dip switch fails, and comprises the following steps:

[0013] S1. When the firmware program of the device is running, the information of the dip switch is read after manual dialing and manual power-on to determine whether the code of the dip switch is a special code. If it is not a special code, the storage information in the flash storage chip is directly read for system operation. If it is a special code, the address clearing operation is first performed to erase the address information in the flash storage chip, and then the power is manually turned off and the code of the dip switch is dialed to the required code, and then the power is turned on again, and the information of the dip switch is read and used as the address for system operation, wherein the special code is the code information of all 0s or all 1s;

[0014] S2, determine whether the address information in the flash storage chip is a fixed address, if yes, continue to run using the fixed address, if not, continue to run using the dial code information as the address;

[0015] S3. Determine whether the curing instruction from the host computer is received. If not, continue to run the system. If received, enter the address curing logic, first read the DIP switch information, then run the address curing operation, write the latest DIP switch information as the address code into the flash storage chip, and then use the address cured in the flash storage chip for system operation.

[0016] A further improvement is that after the address solidification logic is completed, the breathing light on the main control board is controlled to flash regularly, and the solidified address used by the current device is identified by the number of flashes.

[0017] In order to achieve the above-mentioned purpose, in a second aspect, the present application provides a control system for preventing the failure of a dip switch, comprising a main control MCU, a dip switch connected to the main control MCU, a flash storage chip, and a communication module connecting the main control MCU and a communication bus, the flash storage chip being used to store address information of the dip switch, the main control MCU having a reading module for reading the information of the dip switch, an input module for inputting a fixed instruction of a host computer, an address fixing module for writing the read address code into the flash storage chip, and an address clearing module for clearing the address code in the flash storage chip.

[0018] A further improvement is that it also includes a breathing light connected to the main control MCU, and the breathing light flashes regularly based on the solidified address currently used by the device.

[0019] A further improvement is that the communication bus is a 485 bus, and the communication module is a 485 communication module.

[0020] In order to achieve the above-mentioned purpose, in a third aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the above-mentioned method for preventing the failure of a dip switch.

[0021] In order to achieve the above-mentioned purpose, in a fourth aspect, the present application provides a computer-readable storage medium, an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor executes the above-mentioned method for preventing failure of a dip switch.

[0022] The present invention provides a method for preventing a DIP switch from failing. Compared with the prior art, the method has the following beneficial effects: A. The method can be operated in batches through instructions, thereby saving the operating cost after upgrading and iterating the equipment that has left the factory; B. The method can continue to work when the DIP switch fails, thereby improving the stability and reliability of the product; C. The method can continue to work when the DIP switch fails, without replacing a new device or a device mainboard, thereby reducing the maintenance cost of the subsequent equipment; D. The method is compatible with the prior art and hardware, is easy to operate, and achieves visualization of the device address from encoding to solidification without the need for special auxiliary tools. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 is a flow chart of the method;

[0024] Figure 2 It is the schematic diagram of the control system;

[0025] Figure 3 This is the circuit diagram of the main control MCU;

[0026] Figure 4 This is the circuit diagram of the communication module;

[0027] Figure 5 This is the circuit diagram of the flash memory chip;

[0028] Figure 6 Circuit diagram of the DIP switch;

[0029] Figure 7 This is the circuit diagram of the breathing light. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiment of the present application will be clearly and completely described below in combination with the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present application.

[0031] It should be noted that the terms "first", "second" etc. of the specification and claims of the present application are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged in appropriate circumstances, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, the process, method, system, product or equipment comprising a series of steps or units need not be limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0032] In addition, some of the above terms may be used to express other meanings in addition to indicating orientation or positional relationship. For example, the term "on" may also be used to express a certain dependency or connection relationship in some cases. For those of ordinary skill in the art, the specific meanings of these terms in this application can be understood according to specific circumstances.

[0033] In addition, the term "plurality" shall mean two or more.

[0034] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below in conjunction with the embodiments.

[0035] like Figure 1 As shown, a method for preventing a DIP switch from failing is implemented before the DIP switch fails, and includes the following steps:

[0036] S1. When the firmware program of the device is running, the code is manually dialed and the code is manually powered on to read the information of the code switch, and it is determined whether the code of the code switch is a special code. If it is not a special code (such as 0011), the storage information in the flash storage chip is directly read for system operation. If it is a special code, the address clearing operation is first performed to erase the address information in the flash storage chip, and then the power is manually turned off and the code of the code switch is dialed to the required code (such as 0011), and then the power is turned on again, and the information of the code switch is read and used as the address for system operation, wherein the special code is the code information of all 0s or all 1s;

[0037] S2, determine whether the address information in the flash storage chip is a fixed address, if yes, continue to run using the fixed address, if not, continue to run using the dial code information as the address;

[0038] S3. Determine whether the curing instruction from the host computer is received. If not, continue to run the system. If received, enter the address curing logic, first read the DIP switch information, then run the address curing operation, write the latest DIP switch information as the address code into the flash storage chip, and then use the address cured in the flash storage chip for system operation.

[0039] After completing the address solidification logic, control the breathing light on the main control board to flash regularly, and identify the address currently used by the device, that is, the solidified address, by the number of flashes.

[0040] like Figure 2-Figure 7 As shown, a control system for preventing a DIP switch from failing comprises a main control MCU, a DIP switch connected to the main control MCU, a flash storage chip and a communication module connecting the main control MCU and a communication bus, wherein the flash storage chip is used for storing address information of the DIP switch, and the main control MCU comprises a reading module for reading information of the DIP switch, an input module for inputting a solidification instruction of a host computer, an address solidification module for writing the read address code into the flash storage chip, and an address clearing module for clearing the address code in the flash storage chip.

[0041] Among them, MCU: the main control chip on the main control circuit board of the device is called MCU, or main control MCU.

[0042] The flash storage chip is used to store necessary parameter information and work logs of the device.

[0043] Address solidification: Write the read address code into the flash of the main control circuit board. This operation is called address solidification.

[0044] Address clearing: Clear the address code in the flash of the main control circuit board. This operation is called address clearing.

[0045] Firmware program: A program that runs on the device's main MCU chip and controls the device to operate as designed.

[0046] Breathing light: An indicator light on the device circuit board used to display the working status of the main control MCU chip.

[0047] Preferably, it also includes a breathing light connected to the main control MCU, and the breathing light flashes regularly based on the solidified address currently used by the device.

[0048] A hardware architecture including a dip switch, a main control MCU, a flash memory chip, a breathing light, and a communication module is adopted. The address is stored in the flash memory chip. When the program is working normally, the address is called from the flash memory chip. The address is cleared by dialing the dip switch to a specific code (such as all 0s or all 1s). The address is solidified through the address solidification instruction. The address is input using the dip switch and the solidified address is displayed using the breathing light. It is compatible with existing technology and hardware, easy to operate, and can visualize the device address from coding to solidification without the need for special auxiliary tools.

[0049] Preferably, the communication bus is a 485 bus, and the communication module is a 485 communication module. It should be noted that the implementation of the present application is not limited to 485 communication, and CAN and other communication methods can also be implemented.

[0050] A computer-readable storage medium stores computer instructions, wherein the computer instructions are used to enable the computer to execute the above-mentioned method for preventing a DIP switch from failing.

[0051] An electronic device comprises: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor executes the above-mentioned method for preventing failure of a dip switch.

[0052] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips. A general-purpose processor may be a microprocessor or the processor may be any conventional processor.

[0053] The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the control method in the embodiment of the present disclosure. The processor executes various functional applications and data processing of the server by running the non-transitory software programs, instructions and modules stored in the memory, that is, the method of implementing the above method embodiment.

[0054] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of a processing device operated by the server, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to a network connection device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0055] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment method can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the process of the embodiment of the above-mentioned method. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.

[0056] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for preventing a DIP switch from failing, implemented before the DIP switch fails, characterized in that: The following steps are involved: S1. When the firmware program of the device is running, the information of the dip switch is read after manual dialing and manual power-on to determine whether the code of the dip switch is a special code. If it is not a special code, the storage information in the flash storage chip is directly read for system operation. If it is a special code, the address clearing operation is first performed to erase the address information in the flash storage chip, and then the power is manually turned off and the code of the dip switch is dialed to the required code, and then the power is turned on again, and the information of the dip switch is read and used as the address for system operation, wherein the special code is the code information of all 0s or all 1s; S2, determine whether the address information in the flash storage chip is a fixed address, if yes, continue to run using the fixed address, if not, continue to run using the dial code information as the address; S3. Determine whether the curing instruction from the host computer is received. If not, continue to run the system. If received, enter the address curing logic, first read the DIP switch information, then run the address curing operation, write the latest DIP switch information as the address code into the flash storage chip, and then use the address cured in the flash storage chip for system operation.

2. A method for preventing a DIP switch from failing as claimed in claim 1, characterized in that: It also includes controlling the breathing light on the main control board to flash regularly after completing the address solidification logic, and identifying the solidified address used by the current device by the number of flashes.

3. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the method for preventing the failure of a dip switch as described in any one of claims 1-2.

4. An electronic device, characterized in that: include: at least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor executes the method for preventing the failure of a dip switch as described in any one of claims 1-2.

Citation Information

Patent Citations

  • Dial locking method

    CN111127871A

  • Dial switch code identification processing method and device and code reading circuit

    CN113361289A

  • Communication node address calibration method and device, electronic equipment and storage medium

    CN116886670A

  • Automatic dial-up method and system, computer equipment and storage medium

    CN117271412A

  • Waterproof sealed temperature and humidity sensor with dial switch provided with communication address

    CN209589125U