CN113361289B - Code identification processing method and device for dial switch and code reading circuit - Google Patents

Code identification processing method and device for dial switch and code reading circuit Download PDF

Info

Publication number
CN113361289B
CN113361289B CN202110468363.8A CN202110468363A CN113361289B CN 113361289 B CN113361289 B CN 113361289B CN 202110468363 A CN202110468363 A CN 202110468363A CN 113361289 B CN113361289 B CN 113361289B
Authority
CN
China
Prior art keywords
code
dial switch
stored
currently set
reading
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110468363.8A
Other languages
Chinese (zh)
Other versions
CN113361289A (en
Inventor
酉佳
陈庆
戴博文
谢永清
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhuzhou CRRC Times Electric Co Ltd
Original Assignee
Zhuzhou CRRC Times Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhuzhou CRRC Times Electric Co Ltd filed Critical Zhuzhou CRRC Times Electric Co Ltd
Priority to CN202110468363.8A priority Critical patent/CN113361289B/en
Publication of CN113361289A publication Critical patent/CN113361289A/en
Application granted granted Critical
Publication of CN113361289B publication Critical patent/CN113361289B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/04Methods or arrangements for sensing record carriers, e.g. for reading patterns by mechanical means, e.g. by pins operating electric contacts
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/04Methods or arrangements for sensing record carriers, e.g. for reading patterns by mechanical means, e.g. by pins operating electric contacts
    • G06K7/042Methods or arrangements for sensing record carriers, e.g. for reading patterns by mechanical means, e.g. by pins operating electric contacts controlling electric circuits
    • HELECTRICITY
    • H01ELECTRIC ELEMENTS
    • H01HELECTRIC SWITCHES; RELAYS; SELECTORS; EMERGENCY PROTECTIVE DEVICES
    • H01H15/00Switches having rectilinearly-movable operating part or parts adapted for actuation in opposite directions, e.g. slide switch
    • H01H15/02Details
    • HELECTRICITY
    • H01ELECTRIC ELEMENTS
    • H01HELECTRIC SWITCHES; RELAYS; SELECTORS; EMERGENCY PROTECTIVE DEVICES
    • H01H15/00Switches having rectilinearly-movable operating part or parts adapted for actuation in opposite directions, e.g. slide switch
    • H01H15/02Details
    • H01H15/06Movable parts; Contacts mounted thereon
    • H01H15/10Operating parts

Abstract

The application discloses a dial switch code identification processing method, a device and a code reading circuit, wherein the method comprises the following steps: reading the currently set code of the connected dial switch; if the currently set code is inconsistent with the preset code representing the effective dial switch, the stored code is read; and determining the address function code set when the dial switch is valid based on the stored code and the currently set code, and obtaining the correct code of the dial switch. By adopting the method and the device, the accuracy of code reading can be effectively ensured, the fault device does not need to be frequently replaced, the after-sale maintenance time and cost are reduced, and the after-sale maintenance difficulty and uncertainty are reduced.

Description

Code identification processing method and device for dial switch and code reading circuit
Technical Field
The present invention relates to the technical field of electrical devices, and in particular, to a method and an apparatus for identifying and processing a dial switch code, and a code reading circuit.
Background
With the economic and general considerations of electrical equipment, modular designs are becoming increasingly popular. For example, in rail transit vehicle equipment, the same set of hardware equipment is installed at different positions on the vehicle by using a modularized design, so that different configurations of a master-slave mode and network ports can be realized; different software is loaded on the same set of hardware equipment, so that different control functions can be realized. The dial switch is used as a binary coded switch, is widely applied to rail transit vehicle equipment, is arranged on a control board and is used for address coding and functional coding; the main controller can know the position of the equipment and the functions to be realized by identifying the address codes and the function codes of the main controller, and complete different modes, port configurations and specific control functions.
The dial switch is arranged on the vehicle, and the vibration, natural aging, or human false touch of the vehicle body can possibly cause errors of the dial position, so that error codes are read, and the code identification errors of the dial switch can cause identification addresses and function errors, so that the whole vehicle system is in an unsafe state. For example, when an address code identifies a wrong, it may cause the device to be configured as a wrong network port, thereby causing a network communication error for the entire train device; when the function code identifies a fault, it may cause the device to be configured as a wrong control function, resulting in a false output damaging the vehicle device.
The using method of the existing dial switch comprises the following steps: after power-on, the processor of the control panel reads the code of the dial switch and executes the corresponding control program according to the code value. If the dial switch fails in the running process, the processor reads the error code, which leads to the error reporting of the equipment, and the error control program is more seriously executed, thereby affecting the safety and the reliability of the system operation. In addition, if the situation occurs, the faults are generally difficult to accurately identify, and can be solved only by replacing the control panel, so that the time, cost, difficulty and uncertainty of after-sales maintenance are greatly increased.
Disclosure of Invention
The invention aims to solve the technical problems that: in the prior art, the code error is read due to the fault of the dial switch, so that the safety and reliability of the system work are low, and the cost, difficulty and uncertainty of after-sale maintenance time are increased.
In order to solve the technical problems, the invention provides a dial switch code identification processing method, which comprises the following steps:
reading the currently set code of the connected dial switch;
if the currently set code is inconsistent with the preset code representing the effectiveness of the dial switch, reading the stored code;
and determining an address function code set when the dial switch is valid based on the stored code and the currently set code, and obtaining the correct code of the dial switch.
In one embodiment, the preset code is a code in a state that each pin of the dial switch is turned on.
In one embodiment, after reading the currently set code of the connected dial switch, the method further includes:
and if the currently set code is consistent with the preset code representing that the dial switch is effective, storing the preset code, and executing a power-off indication operation.
In one embodiment, the determining the address function code set when the dial switch is active based on the stored code and the currently set code, to obtain the correct code of the dial switch, includes:
if the stored code is inconsistent with the preset code, the stored code is an address function code set when the dial switch is effective, and the stored code is used as a correct code of the dial switch;
and if the stored code is consistent with the preset code, taking the currently set code as the address function code of the dial switch to obtain the correct code of the dial switch, and updating the stored code by adopting the currently set code.
In one embodiment, after reading the currently set code of the connected dial switch, the method further includes:
and sending the read code to an information output device for information output.
In one embodiment, the determining the address function code set when the dial switch is valid based on the stored code and the currently set code further includes, after obtaining the correct code of the dial switch:
and executing the program corresponding to the correct code.
The application provides a dial switch code discernment processing apparatus, include:
the current code reading module is used for reading the currently set code of the connected dial switch;
the stored code reading module is used for reading the stored code when the currently set code is inconsistent with the preset code representing the effective dial switch;
and the code identification determining module is used for determining the address function code set when the dial switch is valid based on the stored code and the currently set code, and obtaining the correct code of the dial switch.
The application provides a code reading circuit which comprises a storage device and a processing device for realizing the method, wherein the processing device is connected with the storage device and a dial switch.
In one embodiment, the storage device is a non-volatile memory.
In one embodiment, the code reading circuit further includes a current limiting resistor and a pull-down resistor, the dial switch is connected to the processing device through the current limiting resistor, and one end of the pull-down resistor is connected to the dial switch, and the other end of the pull-down resistor is grounded.
One or more embodiments of the above-described solution may have the following advantages or benefits compared to the prior art: after the code currently set by the dial switch is read, if the code currently set is inconsistent with the preset code representing the effectiveness of the dial switch, the possibility that the current code is an error code is indicated, at the moment, the stored code is read, the correct code is determined based on the stored code and the code currently set, the obtained correct code is an address function code set when the dial switch is effective, error code reading is avoided under the condition that the current code is possibly wrong, and therefore the accuracy of code reading is effectively ensured, fault devices do not need to be replaced frequently, after-sale maintenance time and cost are reduced, and after-sale maintenance difficulty and uncertainty are reduced.
By applying the method and the device to the vehicle system, even if the dialing position of the dialing switch is wrong due to vibration, natural aging, human false touch and the like of the vehicle body, the correct code can be read in the running process, namely, the failure of the dialing switch can not cause any influence on the system, so that the safety and the reliability of the system operation can be improved; and the control panel does not need to be frequently replaced due to faults, so that the after-sale maintenance time and cost can be reduced, and the after-sale maintenance difficulty and uncertainty are reduced.
Drawings
The scope of the present disclosure may be better understood by reading the following detailed description of exemplary embodiments in conjunction with the accompanying drawings. The drawings included herein are:
FIG. 1 is a flow chart of a method for identifying and processing a coded code of a dial switch according to an embodiment;
FIG. 2 is a flowchart of a method for identifying a coded device according to another embodiment;
FIG. 3 is a schematic diagram of a device for identifying and processing a coded code of a dial switch according to an embodiment;
fig. 4 is a circuit configuration diagram of a code reading circuit in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following detailed description of the implementation method of the present invention will be given with reference to the accompanying drawings and examples, by which the technical means are applied to solve the technical problems, and the implementation process for achieving the technical effects can be fully understood and implemented accordingly.
In the prior art, a dial locking method is to lock codes by display screen software communicated with a control panel where a dial switch is located, and when the control panel is communicated with a display screen normally and the display screen software allows the dial switch to be set, the dial switch can be set and a new code can be read. The dialing locking mode can only prevent unauthorized dialing errors, and if the dialing switch is abnormal when the dialing switch is allowed to be set, the dialing switch can also cause reading error codes. A design of a device for detecting the error dialing of a dial switch in the prior art is that communication is established with a display screen, and the code of the read dial switch is displayed to judge whether the dial is correct or not. The method is only suitable for detecting the dialing code when an operator is present, has no dialing code locking, and cannot prevent the reading error code caused by vehicle vibration, switch aging and the like in the normal operation process.
In order to solve the above problems, the present application provides a method for identifying and processing a dial switch code, which can be applied to a processing device. Taking the application of the method to a processing device as an example, the method comprises the following steps:
s110: the currently set code of the connected dial switch is read.
The dial switch comprises a plurality of keys, wherein each key is independent and is not related to each other; each key is correspondingly provided with two pins, and when the key is dialed to the ON side, the two pins are communicated; otherwise, the switch is opened. The code currently set by the dial switch is the code corresponding to the position dialed by each key of the dial switch. The dial switch is electrically connected to the processing device, and the processing device can read the currently set code of the dial switch after power-on. Specifically, the processing device may read the pin levels of the keys of the dial switch to read the set codes. For example, the first key of the four-bit dial switch is turned off, the corresponding pin level is low, the other three are all dialed to the ON side, the corresponding pin level is high, and the code read at this time is 0111.
S130: if the currently set code is inconsistent with the preset code representing the effective dial switch, the stored code is read.
The preset code is a preset code, in particular to a code which characterizes the effective dial switch, namely the preset code is a code which can be set under the condition that all keys of the dial switch have no faults and can be effectively dialed. If the current code of the dial switch is inconsistent with the preset code, the current code of the dial switch may be an error code set under the condition of corresponding fault, and the dial switch may be faulty. At this time, the stored code is read; wherein the stored code is a code stored before that, and may specifically be stored in a storage device.
S150: and determining the address function code set when the dial switch is valid based on the stored code and the currently set code, and obtaining the correct code of the dial switch.
The address function code is a code for identifying an address and a function, and after the processing device reads the address function code, the processing device can identify a corresponding device address and execute a corresponding program to realize the corresponding function. The address function code set when the dial switch is effective is the correct code needed in the operation process. Specifically, the address function code set when the dial switch is active is different from the preset code.
According to the code identification processing method for the dial switch, after the code currently set by the dial switch is read, if the code currently set is inconsistent with the preset code representing the effectiveness of the dial switch, the possibility that the current code is an error code is indicated, at the moment, the stored code is read, the correct code is determined based on the stored code and the code currently set, the obtained correct code is the address function code set when the dial switch is effective, the error code reading is avoided under the condition that the current code is possibly wrong, the accuracy of code reading is effectively ensured, frequent replacement of fault devices is not needed, after-sale maintenance time and cost are reduced, and after-sale maintenance difficulty and uncertainty are reduced.
When the code identification processing method of the dial switch is applied to a vehicle system, even if the error of the dial position of the dial switch is caused by vibration, natural aging, artificial false touch and other reasons of the vehicle body, the correct code can be read in the running process, namely, the fault of the dial switch does not cause any influence on the system, so that the safety and reliability of the system operation can be improved; and the control panel does not need to be frequently replaced due to faults, so that the after-sale maintenance time and cost can be reduced, and the after-sale maintenance difficulty and uncertainty are reduced.
Specifically, the processing device can be a processor of a control board where the dial switch is located, namely, the dial switch code identification method is applied to the processor of the control board where the dial switch is located, and by means of code storage, other processing equipment is not required to be added, dial identification is completed only on the control board where the dial switch is located, and code reading is accurate.
In one embodiment, the preset code is a code in a state that each pin of the dial switch is turned on. The pins of the dial switch are pins corresponding to keys of the dial switch. The pins of each key of the dial switch are all switched ON, and then each key is dialed to the ON side, and the preset code is 1 for all bits by taking the level of the pin corresponding to the dialed ON side as 1 as an example. For example, for a four-bit dip switch, a preset code 1111 is set.
The failure/failure mode of the dial switch is open circuit, namely the failure of the dial switch is only possible to be in a pin off state and not possible to be in a pin on state; that is, if the dial switch is faulty (such as aged deformation, loose contacts, and human false touch), it is inevitable that the faulty bit switch is in an off state, it is impossible that all pins are turned on, and the processing device cannot read the code in the state that all pins are turned on. By utilizing the open-circuit failure characteristic of the dial switch, the absolute effective state of the dial switch can be accurately represented by taking the codes of the dial switch in the state that the pins are all connected as preset codes.
In one embodiment, after step S110, the method further includes: if the currently set code is consistent with the effective preset code of the characterization dial switch, the preset code is stored, and the power-off indication operation is executed.
Taking the preset code representing the effective dial switch as a judging sign of the power-off indication, and if the currently set code of the dial switch is consistent with the preset code, indicating that the equipment needs to be powered off; at this time, on the one hand, the preset code is stored, that is, the stored code is equal to the preset code; on the other hand, the power-off indication operation is executed, and the power-off indication operation can be to control the power supply to cut off the power supply so as to realize automatic power off, or can be to send the power-off indication operation to the information output device to output information so as to instruct an operator to perform manual power off. Specifically, after power-off, the operator may manually operate to restart, and after power-on, the processing device re-executes step S110 to re-perform code identification.
The address function code set when the dial switch is effective is different from the preset code, and the code of the dial switch is not set as the preset code in the normal operation process; and under the condition of the fault of the dial switch, the preset code which can be set only under the condition that the dial switch is effective in dial can not be changed. Specifically, when the power-off function is needed, an operator can dial the dial switch to a position corresponding to a preset code before powering on, and after powering on, the currently set code is read to be equal to the preset code, so that the preset code can be stored and power-off is indicated, and the function of powering off and restarting is realized.
In one embodiment, step S150 includes: if the stored code is inconsistent with the preset code, the stored code is an address function code set when the dial switch is effective, and the stored code is used as a correct code of the dial switch; if the stored code is consistent with the preset code, the currently set code is used as the address function code of the dial switch, the correct code of the dial switch is obtained, and the stored code is updated by adopting the currently set code.
Taking the preset code as 1 as an example, the workflow of the identification processing method of the dial switch code in this embodiment is shown in fig. 2. After power-on, the processing device executes the dial switch coding identification processing method. Firstly, the processing device reads the currently set code of the dial switch, when all the codes are 1, all the codes stored in the corresponding positions of the storage device are set to 1 (reset), then the power-off indication operation is executed, and after the power-off is waited to be powered on again, the currently set code of the dial switch is read again. When the codes of the dialing codes are not all 1 s, the codes in the storage equipment are read, if the codes in the storage equipment are all 1 s, the representative codes are reset, the new dialing codes are allowed to be written in, at the moment, the current codes (the codes of the new dialing codes) are stored in the corresponding positions of the storage equipment, and meanwhile, the codes of the new dialing codes are used as correct codes; when the memory codes are not all 1's, the representative code is locked and the new dialing code is not allowed to be written, and at this time, the old code stored in the memory device itself is taken as the correct code.
According to the above flow, when all keys of the dial switch are ON under the condition that the dial is effective and all keys are ON, the processing device recognizes that all pins are ON, and then the old codes in the storage device are subjected to power-off reset, and after the power-off reset, an operator can set the dial switch as the needed address function codes; the processing means will allow the code of the new dialing code read as the correct code at the next power up. The first dialing is adopted to carry out coding resetting, the second dialing is adopted to carry out new coding writing, correct codes are stored in storage equipment to carry out coding locking after the two dialing operations, if a dialing switch is faulty (such as ageing deformation, loose contacts and the like) or is vibrated or accidentally touched to cause the coding value to be wrong in the process, according to the failure characteristic of the studied dialing switch, the key position switch which is inevitably faulty is in an off state, a processing device cannot recognize that all pins are on, resetting and rewriting are not allowed, namely correct codes are input only after resetting and resetting are allowed under the condition that the dialing switch is effective, and the accuracy of stored codes is ensured. And in the running process, reset and rewriting are not needed, all keys are not reset and rewritten, if a dial switch fails in the running process, resetting and rewriting of codes are not allowed, the processing device is in a code locking state, and the processing device still can read old correct codes in the storage device for subsequent processing, so that normal work is not influenced.
By utilizing the failure characteristic of the dial switch, a coding locking scheme is formulated, reset rewriting is allowed to be carried out on the secondary dial only under the condition that the dial switch is effective in dial and pins of all keys are conducted, correct codes are locked, then the secondary dial is in a coding locking state in the operation process, the correct codes of storage locking are read, error codes caused by faults cannot be read even if the dial switch is faulty, and the correct codes can be read.
Based on the above, when the control board where the dial switch is located is installed on the vehicle for the first time or the installation position is replaced, and the address function code needs to be reconfigured, the following operation steps are needed: step (1), all keys of a dial switch are dialed to an ON side, all positions 1 are set, then the equipment is electrified, at the moment, a processing device works, the codes are reset, the code locking is released, and the power is off; and (2) dialing the dial switch to a correct coding position based on the address function code to be configured, powering up the device, reading a new code and writing the new code into the storage device at the moment, and completing the configuration of the new address function code.
In one embodiment, after step S110, the method further includes: and sending the read code to an information output device for information output.
The information output device can comprise a display screen and a device which can output information by the voice broadcasting device; the mode of display screen output information is the display information, and the mode of voice broadcast ware output information is voice broadcast. The read codes are sent to the information output device for information output, information is provided for operators on the scene, the operators can know the currently read codes, and the operators can conveniently analyze the correctness of the codes, so that maintenance processing can be performed in time.
For example, when the control board where the dial switch is located is first installed on a car or is changed in installation position and address function codes need to be reconfigured, in the step (1), under the condition of extremely low probability, the dial switch fails and cannot be successfully set as all 1 codes; through the output after reading the code, the operator that is present can in time discover whether all 1 codes set up successfully, if for not all 1 codes, indicate that the dial switch contact damage can't switch on this moment, only need to change new spare part control panel reconfiguration code can. When the step (2) is carried out, under the condition of extremely low probability, a code error caused by manually set code dialing errors can occur, and the problem can be solved by outputting the code after reading the code, enabling an operator in the presence to find the code setting errors in time or enabling the operator to find the error code to cause system error reporting, and only needing to re-execute the reset of the next step (1) and the setting of the correct code of the step (2). It can be seen that all equipment faults caused by the faults of the dial switch can be found when an operator reconfigures the address function codes in the presence, and other running time codes are always in a locking state, so that the faults of the dial switch can not cause any influence on an equipment system; therefore, the dial switch is prevented from being invalid, the correct code is read, the after-sale maintenance time and cost are saved, and the maintenance difficulty and the system uncertainty are reduced.
In one embodiment, after step S150, the method further includes: and executing the program corresponding to the correct code.
The correct code is an address function code for identifying an address and a function. After the processing device obtains the correct code, the processing device enters normal initialization configuration according to the code, executes a corresponding program, recognizes a corresponding address and executes a corresponding function.
It should be understood that, although the steps in the flowcharts of fig. 1-2 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least a portion of the steps in fig. 1-2 may include multiple steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the steps or stages are performed necessarily occur sequentially, but may be performed alternately or alternately with at least a portion of the steps or stages in other steps or other steps.
The application provides a dial switch code identification processing device, as shown in fig. 3, comprising a current code reading module 310, a stored code reading module 330 and a code identification determining module 350. Wherein:
the current code reading module 310 is configured to read a code currently set by the connected dial switch; the stored code reading module 330 is configured to read the stored code when the currently set code is inconsistent with the preset code indicating that the dial switch is valid; the code identification determining module 350 is configured to determine an address function code set when the dial switch is valid based on the stored code and the currently set code, and obtain a correct code for the dial switch.
Specifically, the address function code set when the dial switch is active is different from the preset code.
According to the code identification processing device for the dial switch, after the code currently set by the dial switch is read, if the code currently set is inconsistent with the effective preset code representing the dial switch, the possibility that the current code is an error code is indicated, at the moment, the stored code is read, the correct code is determined based on the stored code and the code currently set, the obtained correct code is the address function code set when the dial switch is effective, error code reading is avoided under the condition that the current code is possibly wrong, therefore, the code reading accuracy is effectively ensured, frequent replacement of fault devices is not needed, after-sale maintenance time and cost are reduced, and after-sale maintenance difficulty and uncertainty are reduced.
In one embodiment, the preset code is a code in a state that each pin of the dial switch is turned on. The pins of the dial switch are pins corresponding to keys of the dial switch. By utilizing the open-circuit failure characteristic of the dial switch, the absolute effective state of the dial switch can be accurately represented by taking the codes of the dial switch in the state that the pins are all connected as preset codes.
In one embodiment, the above-mentioned dial switch code identification processing apparatus further includes a reset module (not shown) configured to store a preset code and execute a power-off indication operation when the currently set code is consistent with a preset code indicating that the dial switch is valid. Specifically, after power-off, the operator can manually operate to restart, and after power-on, the current code reading module 310 executes corresponding functions again.
In one embodiment, the code identification determining module 350 is configured to, when the stored code is inconsistent with the preset code, set the stored code as the address function code when the dial switch is valid, and use the stored code as the correct code of the dial switch; when the stored codes are consistent with the preset codes, the currently set codes are used as address function codes of the dial switch, so that the correct codes of the dial switch are obtained, and the stored codes are updated by adopting the currently set codes.
By utilizing the failure characteristic of the dial switch, a coding locking scheme is formulated, reset rewriting is allowed to be carried out on the secondary dial only under the condition that the dial switch is effective in dial and pins of all keys are conducted, correct codes are locked, then the secondary dial is in a coding locking state in the operation process, the correct codes of storage locking are read, error codes caused by faults cannot be read even if the dial switch is faulty, and the correct codes can be read.
In one embodiment, the dial switch code identification processing device further includes an information output module (not shown) configured to send the read code to the information output device for information output. The read codes are sent to the information output device for information output, information is provided for operators on the scene, the operators can know the currently read codes, and the operators can conveniently analyze the correctness of the codes, so that maintenance processing can be performed in time.
In one embodiment, the above-mentioned coded identification processing device for a dial switch further includes a program execution module (not shown) for executing a program corresponding to the correct code after the correct code is obtained.
For specific limitations of the identification processing device for the code switch, reference may be made to the above limitation of the identification processing method for the code switch, which is not described herein. The above-mentioned all modules in the coded identification processing device of the dial switch can be implemented by means of all or part of software, hardware and their combination. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules. It should be noted that, in the embodiment of the present application, the division of the modules is schematic, which is merely a logic function division, and other division manners may be implemented in actual implementation.
The application provides a code reading circuit, which comprises a storage device and a processing device for realizing the code identification processing method of the dial switch, wherein the processing device is connected with the storage device and the dial switch.
Specifically, the processing device reads the currently set code of the connected dial switch; reading the stored codes from the storage device when the currently set codes are inconsistent with the preset codes which characterize the effectiveness of the dial switch; and determining the address function code set when the dial switch is valid based on the stored code and the currently set code, and obtaining the correct code of the dial switch.
The code reading circuit can adopt the processing device capable of realizing the code identification processing method of the dial switch, and can avoid error code reading under the condition that the current code is possibly wrong, thereby effectively ensuring the accuracy of code reading, avoiding frequent replacement of fault devices, reducing after-sale maintenance time and cost and reducing after-sale maintenance difficulty and uncertainty.
Specifically, the storage device and the processing device may be two devices packaged independently, or may be integrated on the same chip, for example, the processing device is a processor chip, and the storage device is Flash self-contained in the processor chip.
In one embodiment, the storage device is a non-volatile memory. The nonvolatile memory is used for storing codes, so that the stored codes are prevented from being lost, and the reliability of correctly reading the codes can be improved.
In one embodiment, the code reading circuit further comprises a current limiting resistor and a pull-down circuit. The dial switch is connected to the processing device through a current limiting resistor. One end of the pull-down resistor is connected with the dial switch, and the other end is grounded.
The current limiting resistor is used for limiting the current of the electric signal flowing into the processing device, so that the circuit is prevented from being damaged by large current, and the safety and reliability of the circuit are improved. The pull-down resistor is adopted to fix the level of the pin of the dial switch, so that the processing device can conveniently read the pin. The code reading circuit can simultaneously comprise a current limiting resistor and a pull-down resistor, and the stability of the circuit is high.
As shown in fig. 4, a four-bit dial switch is taken as an example; one side of all bit switches of the dial switch is connected with +3.3V level, and the other side is connected with a pull-down resistor and a current-limiting resistor and then enters a processor IO pin of a control panel where the dial switch is positioned for code reading. When the dial is ON, the switch is closed and turned ON, and the processor reads a value 1 (high level); when the dial is on the other side, the switch is opened and the processor reads the value 0 (low). In addition, the control panel processor is connected with a nonvolatile memory (or the processor chip is internally provided with Flash), and the processor can write the read codes into the nonvolatile memory for storage.
The code reading circuit can be arranged in a vehicle system, and even if the error of the code dialing position of the code dialing switch is caused by vibration, natural aging, artificial false touch and the like of the vehicle body, the code reading circuit can ensure that the correct code is read in the running process, namely, the fault of the code dialing switch can not cause any influence on the system, thereby improving the safety and the reliability of the system operation; and the control panel does not need to be frequently replaced due to faults, so that the after-sale maintenance time and cost can be reduced, and the after-sale maintenance difficulty and uncertainty are reduced.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
Although the embodiments of the present invention are disclosed above, the embodiments are only used for the convenience of understanding the present invention, and are not intended to limit the present invention. Any person skilled in the art can make any modification and variation in form and detail without departing from the spirit and scope of the present disclosure, but the scope of the present disclosure is still subject to the scope of the present disclosure as defined by the appended claims.

Claims (9)

1. The code identification processing method of the dial switch is characterized by comprising the following steps of:
reading the currently set code of the connected dial switch;
if the currently set code is inconsistent with the preset code representing the effectiveness of the dial switch, reading the stored code;
if the stored code is inconsistent with the preset code, the stored code is an address function code set when the dial switch is effective, and the stored code is used as a correct code of the dial switch;
and if the stored code is consistent with the preset code, taking the currently set code as the address function code of the dial switch to obtain the correct code of the dial switch, and updating the stored code by adopting the currently set code.
2. The method of claim 1, wherein the predetermined code is a code in a state where each pin of the dial switch is turned on.
3. The method of claim 1, wherein after reading the currently set code of the attached dial switch, further comprising:
and if the currently set code is consistent with the preset code representing that the dial switch is effective, storing the preset code, and executing a power-off indication operation.
4. The method of claim 1, wherein after reading the currently set code of the attached dial switch, further comprising:
and sending the read code to an information output device for information output.
5. The method of claim 4, wherein the address function code set when the dip switch is active, after obtaining the correct code for the dip switch, further comprises:
and executing the program corresponding to the correct code.
6. A coded identification processing device for a dial switch, comprising:
the current code reading module is used for reading the currently set code of the connected dial switch;
the stored code reading module is used for reading the stored code when the currently set code is inconsistent with the preset code representing the effective dial switch;
the code identification determining module is used for taking the stored code as the correct code of the dial switch if the stored code is inconsistent with the preset code and the stored code is the address function code set when the dial switch is effective; and if the stored code is consistent with the preset code, taking the currently set code as the address function code of the dial switch to obtain the correct code of the dial switch, and updating the stored code by adopting the currently set code.
7. A code reading circuit comprising a memory device and processing means for implementing the method of any of claims 1-5, said processing means being connected to said memory device and to a dial switch.
8. The code reading circuit of claim 7, wherein the memory device is a non-volatile memory.
9. The code reading circuit of claim 7, further comprising a current limiting resistor and a pull-down resistor, wherein the dial switch is connected to the processing device through the current limiting resistor, and one end of the pull-down resistor is connected to the dial switch, and the other end of the pull-down resistor is grounded.
CN202110468363.8A 2021-04-28 2021-04-28 Code identification processing method and device for dial switch and code reading circuit Active CN113361289B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110468363.8A CN113361289B (en) 2021-04-28 2021-04-28 Code identification processing method and device for dial switch and code reading circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110468363.8A CN113361289B (en) 2021-04-28 2021-04-28 Code identification processing method and device for dial switch and code reading circuit

Publications (2)

Publication Number Publication Date
CN113361289A CN113361289A (en) 2021-09-07
CN113361289B true CN113361289B (en) 2023-05-30

Family

ID=77525644

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110468363.8A Active CN113361289B (en) 2021-04-28 2021-04-28 Code identification processing method and device for dial switch and code reading circuit

Country Status (1)

Country Link
CN (1) CN113361289B (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5742644A (en) * 1992-03-12 1998-04-21 Ntp Incorporated Receiving circuitry for receiving serially transmitted encoded information
CN201191774Y (en) * 2008-04-24 2009-02-04 南京因泰莱配电自动化设备有限公司 24kV vacuum circuit breaker
CN103268751B (en) * 2013-05-09 2015-10-21 深圳市明微电子股份有限公司 A kind of geocoding wiring method of LED display and system
CN105512588B (en) * 2015-11-25 2018-07-31 安徽云硕科技有限公司 A kind of multi-code parsing converting system
CN106547267B (en) * 2017-01-03 2019-06-11 中车株洲电力机车有限公司 A kind of address code system and method for suspension controller
CN111127871B (en) * 2019-12-25 2020-12-08 浙江柿子新能源科技有限公司 Dial locking method

Also Published As

Publication number Publication date
CN113361289A (en) 2021-09-07

Similar Documents

Publication Publication Date Title
US8397103B2 (en) Method for detecting the improper removal of electronic equipment
US20110093741A1 (en) Method for recovering bios and computer system thereof
CN108646982B (en) Automatic data restoration method and device based on UBIFS
CN107534592B (en) Method for protecting configuration data of a data bus transceiver, data bus transceiver and data bus system
EP2042992A2 (en) Memory management apparatus
CN107239411B (en) Memory management method and system for vehicle-mounted controller
CN111694760B (en) Server system, flash memory module and method for updating firmware mapping file
CN113064757A (en) Server firmware self-recovery system and server
CN113672306B (en) Server component self-checking abnormity recovery method, device, system and medium
CN113361289B (en) Code identification processing method and device for dial switch and code reading circuit
US6363493B1 (en) Method and apparatus for automatically reintegrating a module into a computer system
CN111966071A (en) Data classification, storage and verification method for vehicle-mounted controller
CN111176878A (en) Server BBU (building base band Unit) standby power diagnosis method, system, terminal and storage medium
JPH07219860A (en) Memory rewrite control method/device
CN114184992A (en) Method, apparatus and computer program for verifying power supply monitoring
JP2000035923A (en) Abnormality detecting method and abnormality detecting device
EP1516256A1 (en) Method and base chip for monitoring the operation of a microcontroller unit
CN114637389B (en) Trigger state holding circuit and method
CN109522200A (en) A kind of raising stores the test method of disk array stability, system and terminal more
CN112015579A (en) Computer device and detection method of basic input and output system
CN111562956B (en) Theme switching method and device for terminal, storage medium and electronic equipment
CN108829417A (en) A kind of update device of CPLD, method, equipment and storage medium
JP3405215B2 (en) Update history management apparatus and update history management method for circuit board in electronic exchange
CN115658373B (en) Server-based memory processing method and device, processor and electronic equipment
CN113760335B (en) Server device and method for avoiding firmware from being unable to be updated again

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant