Card address node issuing method based on industrial bus
Through the card address node issuance method based on industrial bus, the controller monitors the level changes and random number generation algorithm in real time, solves the problem of address recognition errors when multiple cards are online and the system reliability is low, and the automatic allocation and self-check of card addresses are realized, improving the automation and stability of the system.
Patent Information
- Application Number
- CN202411517663.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-10-29
AI Technical Summary
The prior art cannot effectively deal with the problems of hot plugging and unplugging of multiple cards online at the same time, easy address recognition, low system reliability and high maintenance difficulties.
The card address node issuance method based on industrial bus is adopted, and the pin level changes are detected through the controller in real time, the number of card cards is dynamically judged, and packet conflicts are avoided through the random number generation algorithm and wait mechanism, so as to realize automatic allocation and self-test of card addresses.
It improves the automation and reliability of the system, supports hot-swap and unplugging of multiple cards at the same time, reduces cost and maintenance difficulties, and enhances the stability and adaptability of the system.
Smart Images

Figure CN119596756A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic digital data processing, and in particular to error detection. Background Art
[0002] At present, the address nodes of rack card components are usually sent down by physical address dial / knob method, and the card component only reads the node address when it is powered on. This method has many disadvantages. For example, in the face of harsh industrial environments, the failure rate of the dial switch is high, which will cause many chain failures. In addition, the current card node acquisition mechanism is not related to the working status of the card itself and the bus status, which may cause the problem card to go online incorrectly and affect the entire bus. In the face of the hot-swap impact of multiple cards going online at the same time, the existing technology may cause address recognition errors, thereby affecting bus communication.
[0003] For example, the Chinese patent with publication number CN112380082A discloses a board compatibility management system and method based on a networked test service node, and provides the following technical solutions. The present invention is a board compatibility management method based on a networked test service node, which belongs to the field of intelligent transportation, and aims to solve the problem that the board cannot be compatible because of the complex traffic intersection. The present invention includes that when the board is inserted, the power supply system supplies power and monitors whether the board current is normal, and then automatically allocates the hardware address through the address manager. After the address recognition is normal, the communication is established with the host through the CAN bus to inform the main board of the current board power supply and address status information, etc. After the bus communication is successful, data exchange is performed through the serial port or Ethernet to realize the complete operation of the hardware board system; the present invention is simple in design and easy to use: different types and different numbers of data acquisition cards can be matched arbitrarily, and no manual and designer management is required, which is convenient for development and maintenance. However, the above-mentioned board compatibility management method based on a networked test service node relies on the networked test node, increases the complexity and cost of the system, has limited hot plug support, and address resolution may cause conflicts, and the maintenance difficulty is increased, and the compatibility is not as stable as the traditional method. Summary of the invention
[0004] The present invention solves the problems in the prior art that it is unable to cope with hot plugging of multiple cards online at the same time, address recognition is prone to errors, the system reliability is low and the maintenance difficulty is high, and proposes a card address node sending method based on an industrial bus, which achieves the purposes of high reliability, simultaneous hot plugging of multiple cards online, low cost and easy maintenance.
[0005] To achieve the above object, the present invention adopts the following technical solution: A method for issuing a card address node based on an industrial bus comprises the following steps: S1: The controller monitors the level change of the detection pin in real time; S2: Determine the number of cards online according to the level change and send corresponding confirmation signals; S3: After receiving the confirmation signal, the card performs a self-check and replies with a response packet; S4: The controller sends node information, and the card replies with a secondary response signal after receiving it. After receiving it, the controller sends an online signal, and the card is officially online.
[0006] The advantage of this design is that it can realize the automatic distribution of card addresses and improve the automation and reliability of the system.
[0007] Preferably, step S2 comprises the following steps: S2.1: Determine the number of cards online according to the level change. If there is only one card, proceed to step S2.3; if there are multiple cards, proceed to step S2.2; S2.2: Add the random number enable flag to the online confirmation signal data packet; S2.3: The controller sends an online confirmation signal data packet through the bus.
[0008] The advantage of this design is that it can dynamically adjust the processing logic according to the number of cards, avoid conflicts when multiple cards are online at the same time, and improve the accuracy of address allocation and system stability.
[0009] Preferably, in step S3, after the card receives the online confirmation signal data packet, it enters the corresponding self-test program according to the bus status, outputs the self-test result after the self-test is completed, and the self-test result and the card information together constitute a card response packet, which is replied to the controller and waits for the next progress; the card response packet includes the card version model information and the self-test result information.
[0010] The advantage of this design is that, through self-checking and information feedback, it ensures that the card is in good condition and meets system requirements, thereby improving the overall reliability and compatibility of the system.
[0011] Preferably, in step S3, if multiple cards are online, after the card receives and parses the online confirmation signal data packet, it will generate a random number through a built-in random number generation algorithm and convert it to finally generate a serial number, and then wait according to the serial number and restore the data packet according to the waiting time interval.
[0012] The advantage of this design is that, through the random sequence number and waiting mechanism, it avoids data packet conflicts caused by simultaneous replies from multiple cards, ensuring the smooth progress of the address allocation process.
[0013] Preferably, the step S4 includes the following steps: S4.1: The controller comprehensively determines whether the card going online will affect the communication bus based on the response packet information. If so, the controller refuses to allow the card to go online. If not, the controller proceeds to step S4.2. S4.2: The controller sends a node address data packet; S4.3: After receiving the node address data packet, the card records the node address sent by the controller, and then replies to the controller with a secondary response signal; S4.4: After receiving the secondary response signal, the controller sends a card online signal through the bus or communicates with the card through the GPIO port to officially go online; S4.5: After receiving the card online signal, the card records its own node address and working mode, enters the corresponding working mode according to the requirements of the controller, accesses the bus and enters the normal operating state.
[0014] The advantage of this design is that, through comprehensive judgment, it can ensure that the status and version of the card meet the requirements before it goes online, preventing incompatible or faulty cards from affecting the entire system.
[0015] Preferably, the online confirmation signal data packet includes a system node sending status enable bit, a main controller information bit and a reserved bit; in step S2.2, the random number enable flag is added to the reserved bit.
[0016] The advantage of this design is that the flexibility and information volume of the data packet are enhanced through the status enable bit and the main controller information bit, which improves the maintainability of the system. The reserved bit is used to add a random number enable flag to avoid bus conflicts caused by multiple cards replying to response packets at the same time.
[0017] Preferably, the comprehensive judgment on whether the online card will affect the communication bus includes judging whether the card status is good, judging whether the card version information is consistent with the configuration requirements, judging whether the version model of the card meets the requirements based on its own configuration information and version information library, and judging whether the self-test results of the verification equipment meet the requirements; the node address data packet includes the node address data packet flag, the device working mode information and the device node address.
[0018] The advantage of this design is that the comprehensive judgment mechanism ensures that only qualified cards can go online, avoiding communication failures caused by version mismatch or abnormal status, and improving the overall stability of the system.
[0019] Preferably, the detection pin adopts an ADC pin with a voltage sampling function, and the pin connecting the hanging card and the detection pin includes a pull-down resistor with different resistance values. When the hanging card is inserted, the equivalent resistance of the detection pin to the ground changes, causing the sampling level to change, and the number of currently inserted cards is determined according to the degree of level change.
[0020] The advantage of this design is that the number of cards can be accurately detected through voltage sampling and resistance changes, which improves the accuracy and reliability of detection and ensures the accuracy of the number of inserted cards.
[0021] Preferably, the random number generation algorithm adopts the Mersenne twister algorithm or the Xorshit algorithm; if the random number algorithm generates repetitions, resulting in the same generated serial numbers, which in turn leads to time slot report conflicts, the controller detects the abnormality in the packet parsing of the conflicting card and re-initiates a round of confirmation signal confirmation for the problematic card, among which the cards that have been confirmed to have passed do not participate until the card has completed the normal packet return.
[0022] The advantage of this design is that it uses efficient random number algorithms and conflict detection mechanisms to reduce communication conflicts caused by duplicate serial numbers, thereby improving the success rate of address issuance and system stability.
[0023] Preferably, in normal working state, the controller will periodically communicate with the downstream card. When it is detected that the card's reply data packet is abnormal or fails to reply within the specified time slot, a confirmation signal will be sent down. After the node address is sent down, the card will receive the confirmation signal and enter its own state response and perform self-inspection. If it detects that its own state is abnormal, it will reply with a response packet confirmation state. If there is a fault, it will enter the fault state, light up the card fault indicator light, close the interface connected to the bus, and exit the bus.
[0024] The advantage of this design is that the continuous monitoring and exception handling mechanism can promptly detect and isolate faulty components, prevent the fault from spreading, and ensure the normal operation of the entire communication bus.
[0025] Compared with the prior art, the invention has the following beneficial effects.
[0026] 1. The present invention can accurately determine the number of online cards by monitoring the change of the detection pin level in real time through the controller, and dynamically send a confirmation signal according to the situation to realize the automatic allocation of the card address. This automated process effectively avoids the errors and inconveniences caused by traditional manual dialing, and significantly improves the overall reliability of the system. At the same time, after receiving the confirmation signal, the card performs a self-check and feeds back the status information, ensuring that only cards in good condition and meeting the version requirements can be officially online, further ensuring the stable operation of the system, greatly reducing the risk of system failure caused by card failure or incompatibility, and improving the overall reliability and work efficiency of the control system.
[0027] 2. The present invention effectively solves the data packet conflict problem that may be caused when multiple cards are online at the same time by introducing a random number generation algorithm and a waiting mechanism. When multiple cards are inserted at the same time, the randomly generated sequence number and waiting time ensure that each card replies to the response packet in different time intervals, avoiding bus communication conflicts and address allocation errors. In addition, the mechanism of comprehensively judging whether the card going online will affect the communication bus ensures that only qualified cards can go online, preventing system instability caused by the simultaneous operation of multiple cards, not only improving the accuracy of address allocation and the stability of system communication, but also supporting the hot plug operation of the card, enhancing the flexibility and adaptability of the system.
[0028] 3. The present invention reduces hardware costs and maintenance difficulties by eliminating traditional physical address dial switches and slot dial switches. The ADC pins with voltage sampling function and pull-down resistors with different resistance values are used to accurately detect the number of card components, thereby improving detection accuracy and system reliability. The periodic communication and exception handling mechanism enable the system to detect and isolate faulty card components in a timely manner, reducing the workload of maintenance personnel and system downtime, thereby reducing maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 The present invention is a general flow chart of a method for sending a card address node based on an industrial bus.
[0030] Figure 2 The present invention is a flow chart of a periodic detection method of a card address node sending method based on an industrial bus. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical scheme and advantages of the present disclosure clearer, the following will further describe the embodiments of the present disclosure in detail with reference to the accompanying drawings. The proportions of the components are not drawn according to the actual proportions, and the proportions and sizes shown in the accompanying drawings should not limit the substantial technical scheme of the present invention. These embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described.
[0032] See also Figure 1-2 As shown, a method for sending a card address node based on an industrial bus is characterized by comprising the following steps: S1: The controller monitors the level change of the detection pin in real time; S2: Determine the number of cards online according to the level change and send corresponding confirmation signals; S3: After receiving the confirmation signal, the card performs a self-check and replies with a response packet; S4: The controller sends node information, and the card replies with a secondary response signal after receiving it. After receiving it, the controller sends an online signal, and the card is officially online.
[0033] like Figure 1 In one embodiment shown, Figure 1 The present invention is a method for sending card address nodes based on an industrial bus. The present invention proposes a method for sending card address nodes based on an industrial bus, aiming to effectively solve the problems of hot-swap management difficulties, address recognition errors, low system reliability, and high maintenance difficulty faced when multiple cards are online at the same time in the prior art. The present invention monitors the level changes of the detection pins in real time through a controller, dynamically determines the number of online cards, and sends corresponding confirmation signals according to different situations, thereby realizing the automatic allocation of card addresses and significantly improving the automation level and overall reliability of the system.
[0034] Specifically, the controller first monitors the level change of the detection pin in real time through the ADC pin with voltage sampling function. When a card is inserted or removed, the pull-down resistors with different resistance values will cause the change of the equivalent resistance of the detection pin to the ground, which will lead to the change of the sampling level. The controller accurately determines the number of currently inserted cards according to the degree of level change. If it is detected that only a single card is online, the controller will directly send the online confirmation signal data packet through the bus to ensure that the single card can quickly and accurately obtain the address information; if multiple cards are detected to be online at the same time, the system will add a random number enable flag to the confirmation signal data packet, and generate a unique serial number through the built-in random number generation algorithm (such as the Mersenne rotation algorithm or the XORShift algorithm), so that each card can reply to the response packet at different time intervals, thereby effectively avoiding data packet conflicts and ensuring that each card can successfully obtain a unique address.
[0035] After the card receives the confirmation signal, it enters the self-test program according to the bus status. After completing the self-test, it will form a response packet with the self-test result and the card version model information and reply to the controller. Based on the response packet information, the controller comprehensively determines whether the card status and version information meet the system requirements to ensure that only cards with good status and matching versions can be officially online. If the evaluation results show that the card going online will not have an adverse effect on the communication bus, the controller will send down the node address data packet, and the card will record the node address and reply to the secondary response signal, and finally send the online signal through the bus or GPIO port, and the card will be officially connected to the bus and enter the normal operation state.
[0036] In one embodiment, the hardware requirement is that the main controller sets one or more GPIO (General propose input / output) for card insertion detection, and is connected to each slot of the rack. The core triggering step is that the controller address node detection pin detects the level change, and judges whether a single node is online or multiple cards are closely online according to the level change degree, and enters different node address delivery logic according to different situations. The core mechanism of node address online detection is that the controller sets up one or more detection pins for card insertion detection, judges whether a single card is inserted or multiple cards are inserted according to the level change amplitude detected by the pin, and enters different processing branches to prevent address acquisition anomalies and bus communication anomalies caused by multiple card insertion. The detection pin should be an ADC pin with voltage sampling function, and the pin connected to the lower hanging card and the detection pin contains a pull-down resistor with different resistance values. As the lower hanging card is inserted, the equivalent resistance of the pin to the ground changes, causing the sampling level to change, and the number of currently inserted cards is determined according to the degree of level change. After detecting the card is inserted, the controller will send an "online confirmation signal" through the bus. Its core content includes inquiring / judging the working status of the card, judging the current bus status, notifying the card of the current bus status and the requirements for the card. After receiving the "online confirmation signal" data packet, the card enters the corresponding self-test program according to the bus status, and outputs the self-test results after the self-test is completed. The self-test results and the card information together form a card response packet, which is replied to the controller and waits for the next step. Based on the response packet information, the controller determines whether the card status is good, whether the card version information is consistent with the configuration requirements, and comprehensively judges whether the card going online will affect the communication bus. After the judgment decision is passed, the controller sends a confirmation packet containing node address information and working mode information. After receiving the confirmation packet, the downstream card records its own node address and working mode, enters the corresponding working mode according to the controller's requirements, connects to the bus, and enters normal operation.
[0037] When multiple cards are inserted, in order to avoid bus conflicts caused by multiple cards replying to response packets at the same time, a random allocation mechanism for card reply packet time slots is introduced. When the controller detects that multiple cards are inserted, the "reserved" bit in the confirmation signal sent by the controller will add a random number enable flag. After the downstream card receives and parses the data packet, it will generate and convert a random number through the built-in random number generation algorithm, and finally generate a sequence number of 1 to 16, and then wait according to the generated sequence number. The waiting time = sequence number * 10ms, and the data packet is restored according to this time interval. Correspondingly, when the controller detects that multiple cards are online, the waiting time for the downstream card to reply to the data packet will also be changed to 200ms to ensure that it receives the reply packets of all cards.
[0038] The random number generation algorithm can use Mersenne Twister algorithm, Xorshit algorithm, etc. If the random number algorithm generates repetitions, resulting in the same generated serial number, which in turn leads to a conflict in the time slot report, the controller detects the abnormal parsing of the conflicting card's reply packet and re-initiates a round of confirmation signal confirmation for the problematic card. The cards that have been confirmed to have passed will not participate until the card has completed the normal reply packet.
[0039] The frame structure of the "signal confirmation" data packet sent by the controller is shown in the following table: The "confirmation signal" data packet sent by the controller mainly includes: source address, destination address, system node status enable, controller model, and controller version number. The addition of the system node status enable can effectively avoid the problem that when the card is abnormally cold reset / hot reset, the card is unclear about its own status, thereby affecting the bus working logic. It is more reliable for the main controller to control this state. After receiving the "confirmation signal", the card determines which working state it should enter, completes the self-test, and chooses the appropriate time to reply to the "response packet" to the bus according to the card online situation mentioned above, and then waits for the main controller to send node information.
[0040] The frame structure of the node's reply packet to the main controller is shown in the following table: The data packet of the node's reply to the main controller's "response packet" mainly includes: source address, destination address, device model, version number, and device self-test result. After receiving the "response packet", the main controller determines whether the version model of the card meets the requirements based on its own configuration information and version information library, and then verifies the device self-test result. After completing all information confirmation, the controller begins to send the "node address data packet".
[0041] Among them, the frame structure of the "node address data packet" sent by the controller is shown in the following table: The "node address data packet" sent by the controller contains the source address, target address, device working mode information, and device node address. After receiving the "node address data packet", the card records the node address sent by the main controller and then replies to the main controller with the "secondary response signal".
[0042] The frame structure of the "secondary response signal" data packet that the node replies to the main controller is shown in the following table: The node replies to the main controller with the "secondary response signal" containing the source address, target address, and card node address reception success flag. After receiving the "secondary response signal", the controller can send the "card online signal" through the bus or inform the card through the GPIO port that it can go online and participate in the normal operation of the system according to the actual situation.
[0043] The present invention proposes a method for issuing card address nodes based on an industrial bus. Through a series of precise steps and mechanisms, the automatic and accurate allocation of card addresses is realized, which significantly improves the overall performance and reliability of the industrial control system. Specifically, the controller uses an ADC pin with a voltage sampling function to monitor the level change of the detection pin in real time, and accurately judges the number of currently inserted cards through the different resistance changes of the pull-down resistor. This high-precision detection mechanism not only avoids the errors and inconveniences caused by traditional manual dial switches or physical address settings, but also greatly improves the dynamic adaptability of the system, so that the system can respond to the insertion and removal of cards in real time, and enhances the flexibility and adaptability of the system.
[0044] When a single card is detected to be online, the controller can quickly send a confirmation signal through the bus to ensure that the card can quickly and accurately obtain address information, thereby improving the efficiency and accuracy of address allocation. In the case of multiple cards online at the same time, the system adds a random number enable flag to the confirmation signal data packet, and uses the built-in random number generation algorithm (such as the Mersenne Twister algorithm or the XORShift algorithm) to generate a unique serial number, so that each card replies to the response packet at different time intervals, effectively avoiding data packet conflicts. This mechanism not only ensures that each card can successfully obtain a unique address, but also improves the stability and reliability of the communication bus, prevents address acquisition anomalies and bus communication anomalies caused by multiple cards online at the same time, and solves the core bottleneck of traditional methods when dealing with multiple cards online.
[0045] After the card receives the confirmation signal, it performs a self-check according to the bus status, and sends the self-check result and the card version model information together to form a response packet to reply to the controller. This self-check mechanism ensures that only cards with good status and matching versions can be officially put online, further ensuring the stable operation of the system. Based on the response packet information, the controller comprehensively judges whether the card status and version information meet the system requirements, avoiding system communication failures or functional abnormalities caused by card failures or version mismatches. This comprehensive judgment mechanism not only improves the reliability and compatibility of the system, but also ensures the efficient collaboration of all cards in the system, thereby improving the overall performance of the entire industrial control system.
[0046] In addition, the present invention designs a complete fault detection and exception handling mechanism. The controller will periodically communicate with the hanging card during normal operation to monitor the status and communication quality of the card in real time. When it is detected that the card reply data packet is abnormal or fails to reply within the specified time slot, the controller will send a confirmation signal to prompt the card to perform a self-check. If the card detects that its own state is abnormal, it will enter a fault state, light up the fault indicator light, and close the interface to exit the bus to prevent the faulty card from affecting the stable operation of the entire system. This mechanism not only improves the system's fault resistance, but also reduces the workload of maintenance personnel and the system's downtime, significantly reducing the system's maintenance cost. By timely discovering and isolating faulty cards, the normal operation of the communication bus is guaranteed, and the overall reliability and availability of the system are further improved.
[0047] In terms of hardware design, the present invention reduces hardware cost and maintenance difficulty compared to traditional physical dial switches and slot dial switches. The ADC pins with voltage sampling function and pull-down resistors with different resistance values are used to accurately detect the number of card components, thereby improving detection accuracy and system reliability. This not only simplifies hardware design and reduces production costs, but also reduces errors caused by inaccurate physical dials, and improves the stability and reliability of the system. The introduction of random number generation and conflict resolution mechanisms ensures that data packets do not conflict when multiple card components are online at the same time, thereby improving the success rate of address allocation and the communication stability of the system. At the same time, the system designs a rich content of the online confirmation signal data packet, including the system node status enable bit, the main controller information bit and the reserved bit, which enhances the flexibility and information volume of the data packet, and reserves space for future system expansion and function upgrades. This flexible information transmission design not only improves the maintainability and scalability of the system, but also provides convenience for the long-term evolution and upgrade of the system.
[0048] When multiple cards are online at the same time, the design effectively prevents data packet conflicts through random number generation algorithms and waiting mechanisms, ensuring that each card can successfully obtain a unique address. The Mersenne Twister algorithm or XORShift algorithm is used to generate efficient, low-conflict random numbers, reducing the possibility of serial number duplication and improving the efficiency of conflict resolution. When random number generation causes serial number duplication and causes time slot packet return conflicts, the controller can detect and re-initiate confirmation signals to ensure that all cards can eventually reply normally, ensuring the smooth progress of the address issuance process. This efficient random number generation and conflict resolution mechanism not only improves the success rate of address issuance, but also enhances the stability and reliability of the system in high-load or dynamically changing industrial environments.
[0049] like Figure 2 In one embodiment shown, Figure 2The present invention is a flow chart of a periodic detection method of a method for sending a card address node based on an industrial bus. In normal working state, the controller will periodically communicate with the hanging card. Once it detects that the card reply data packet is abnormal or does not reply within the specified time slot, it will send a "confirmation signal" and wait for the target card to reply. After the node address is sent, if the card receives a "confirmation signal", it will enter its own state response and perform self-check. If it detects that its own state is abnormal, it will reply with a "response packet" to confirm the state; if it is faulty, it will enter the fault state, light up the card fault indicator, and mainly close the IO connected to the bus, exit the bus, and prevent the bus from being affected.
[0050] The design of this step of the present invention enables periodic communication between the controller and the hanging card under normal working conditions, and when it is detected that the card reply data packet is abnormal or fails to reply within the specified time slot, it actively sends a "confirmation signal" and waits for the response of the target card. This design brings many significant advantages. First, the periodic communication mechanism ensures the real-time monitoring and management of each card by the system, and can timely discover potential problems and prevent problems from expanding. This active monitoring not only improves the reliability of the system, but also enhances the overall stability, reduces the system downtime caused by card failure, and thus improves production efficiency.
[0051] Secondly, when the card receives the "confirmation signal" after the node address is sent and performs a self-check, this self-check process ensures that only cards in good condition and normal function can continue to participate in the system operation. If the card detects that its own state is abnormal, it will reply with a "response packet" to confirm, enter the fault state, light up the fault indicator, and close the IO port connected to the bus, and actively exit the bus. This mechanism effectively isolates the faulty card to prevent it from having an adverse effect on the entire bus system, avoids system-level failures caused by a single card failure, and significantly improves the system's anti-interference and fault-tolerance capabilities.
[0052] In addition, this design simplifies the fault detection and handling process and reduces reliance on manual maintenance. When the faulty card automatically enters the fault state and indicates the fault location, maintenance personnel can quickly locate and handle the fault, shortening maintenance time and reducing maintenance costs. At the same time, the system reduces the risk of human operation errors and improves the overall safety of the system through an automated fault handling mechanism.
[0053] Furthermore, the design of closing the IO port connected to the bus and exiting the bus ensures the normal operation of the bus communication and avoids the interference of faulty cards on data transmission and normal operation of other cards. This not only maintains the stability of communication, but also ensures that the system can still operate efficiently and stably under high load or complex environment.
[0054] The present invention is not limited to the above-mentioned embodiments. No matter any changes are made in the shape or material composition, any structural design provided by the present invention is a variation of the present invention and should be considered to be within the protection scope of the present invention.
Claims
1. A method for issuing card address nodes based on industrial bus, characterized in that: The following steps are involved: S1: The controller monitors the level change of the detection pin in real time; S2: Determine the number of cards online according to the level change and send corresponding confirmation signals; S3: After receiving the confirmation signal, the card performs a self-check and replies with a response packet; S4: The controller sends node information, and the card replies with a secondary response signal after receiving it. After receiving it, the controller sends an online signal, and the card is officially online.
2. A method for issuing card address nodes based on an industrial bus according to claim 1, characterized in that: The step S2 comprises the following steps: S2.1: Determine the number of cards online according to the level change. If there is only one card, proceed to step S2.3; if there are multiple cards, proceed to step S2.2; S2.2: Add the random number enable flag to the online confirmation signal data packet; S2.3: The controller sends an online confirmation signal data packet through the bus.
3. A method for issuing card address nodes based on an industrial bus according to claim 1 or 2, characterized in that: In step S3, after the card receives the online confirmation signal data packet, it enters the corresponding self-test program according to the bus status, outputs the self-test result after the self-test is completed, and the self-test result and the card information together constitute a card response packet, which is replied to the controller and waits for the next step of progress; the card response packet includes the card version model information and the self-test result information.
4. A method for issuing card address nodes based on an industrial bus according to claim 3, characterized in that: In step S3, if multiple cards are online, after the card receives and parses the online confirmation signal data packet, it will generate a random number through a built-in random number generation algorithm and convert it to finally generate a serial number, then wait according to the serial number and restore the data packet according to the waiting time interval.
5. A method for issuing card address nodes based on an industrial bus according to claim 1, 2 or 4, characterized in that: The step S4 includes the following steps: S4.1: The controller comprehensively determines whether the card going online will affect the communication bus based on the response packet information. If so, the controller refuses to allow the card to go online. If not, the controller proceeds to step S4.
2. S4.2: The controller sends a node address data packet; S4.3: After receiving the node address data packet, the card records the node address sent by the controller, and then replies to the controller with a secondary response signal; S4.4: After receiving the secondary response signal, the controller sends a card online signal through the bus or communicates with the card through the GPIO port to officially go online; S4.5: After receiving the card online signal, the card records its own node address and working mode, enters the corresponding working mode according to the requirements of the controller, accesses the bus and enters the normal operating state.
6. A method for issuing card address nodes based on industrial bus according to claim 2, characterized in that: The online confirmation signal data packet includes a system node sending status enable bit, a main controller information bit and a reserved bit; in step S2.2, the random number enable flag is added to the reserved bit.
7. A method for issuing card address nodes based on industrial bus according to claim 5, characterized in that: The comprehensive judgment of whether the card going online will affect the communication bus includes judging whether the card status is good, judging whether the card version information is consistent with the configuration requirements, judging whether the version model of the card meets the requirements based on its own configuration information and version information library, and judging whether the self-test results of the verification equipment meet the requirements; the node address data packet includes the node address data packet flag, the device working mode information and the device node address.
8. A method for issuing card address nodes based on an industrial bus according to claim 1, 2 or 7, characterized in that: The detection pin adopts an ADC pin with a voltage sampling function. The pin connecting the hanging card and the detection pin includes a pull-down resistor with different resistance values. When the hanging card is inserted, the equivalent resistance of the detection pin to the ground changes, causing the sampling level to change. The number of currently inserted cards is determined according to the degree of level change.
9. A method for sending card address nodes based on industrial bus according to claim 4, characterized in that: The random number generation algorithm adopts the Mersenne twister algorithm or the Xorshit algorithm; if the random number algorithm generates repetitions, resulting in the same generated serial number, which in turn leads to time slot report conflicts, the controller detects that the conflicting card's reply packet parsing is abnormal and re-initiates a round of confirmation signal confirmation for the problematic card, among which the cards that have been confirmed to have passed do not participate until the card has completed the normal reply packet.
10. A method for issuing card address nodes based on an industrial bus according to claim 1, 2 or 9, characterized in that: In normal working state, the controller will periodically communicate with the downstream card. When it detects that the card's reply data packet is abnormal or fails to reply within the specified time slot, it will send a confirmation signal. After the node address is sent, the card receives the confirmation signal and enters its own state response and performs self-inspection. If it detects that its own state is abnormal, it will reply with a response packet confirmation state. If it fails, it will enter the fault state, light up the card fault indicator, close the interface connected to the bus, and exit the bus.
Citation Information
Patent Citations
Method for realizing self-detection of hot-plug board card
CN101567810A
Multi-board-card communication equipment, method and system based on CAN2.0
CN109379264A
Board card compatibility management system and method based on network connection test service node
CN112380082A
High-speed communication backboard with redundant controller and communication method thereof
CN116346580A
Address allocation method and device for multi-board topology cascade structure and storage medium
CN118138569A