IO module configuration method and device, storage medium and processor
By automatically assigning the register address of the IO module, the problems of cumbersome IO module configuration and high error rate in the PLC control system are solved, a fast and accurate configuration process is achieved, and the workload and failure rate are reduced.
Patent Information
- Application Number
- CN202310379448.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-11
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2043-04-11
AI Technical Summary
The IO module configuration method in the existing PLC control system is cumbersome and requires filling in the address for each variable, which is error-prone and increases the workload and failure rate.
By obtaining the module address parameters, allocate the corresponding register address according to the preset initial IO module configuration, and automatically generate the final IO module configuration. You only need to fill in one module address parameter, and automatically match the variable address, saving filling time and reducing the error rate. .
It greatly shortens the programming time, reduces the failure rate and troubleshooting time, and improves the accuracy and efficiency of the configuration process.
Smart Images

Figure CN118795831A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of PLC control technology, and in particular to an IO module configuration method, an IO module configuration device, a machine-readable storage medium and a processor. Background Art
[0002] Generally speaking, a PLC control system consists of a main controller and IO modules (analog input module, switch input module, analog output module, switch output module, etc.). In the use of the PLC control system, the hardware IO module is connected to the field equipment through hard wiring. At the same time, the corresponding IO module configuration is required on the PLC software platform, and each channel of the module needs to fill in a corresponding input or output address. In addition, the prefix of the address filled in is different for different data types.
[0003] At present, most PLCs on the market use this method, such as Bachmann, Beckhoff, Phoenix, etc. All addressable operands can be accessed and operated in four ways: bit (X), byte (B), word (W) and double word (D). Among them, the switch quantity is the bool type in the PLC data type, and the analog quantity includes real, uint, int, dint and other types. And the entire address filled in should include the prefix and the address corresponding to the variable. Taking the input switch quantity as an example, when filling in the address for a certain switch quantity, it should be filled in as %IX0.0. Because each switch quantity occupies one "bit", so in order, the address of the next switch quantity should be filled in as %IX0.1. Taking the input analog quantity of "int" type as an example, if this point is immediately after the second switch quantity mentioned above, its address should be filled in as %IB1. Each int occupies two "bytes", and the above analog quantity occupies the first and second bytes. So in order, if it is still an analog input point after it, the address should be filled in as %IB3. If it is an int type, it occupies the third and fourth bytes. If it is of dint type, it occupies 4 bytes, namely the 3rd, 4th, 5th and 6th bytes.
[0004] This method of filling in variable addresses is more complicated, and each variable of each IO module needs to be filled in. The input and output addresses of variables are different, so first you need to distinguish whether it is an input or output variable, and then fill in the position according to the bytes occupied by the variable data type. This method increases the workload and is prone to errors.
[0005] Therefore, the existing IO module configuration method requires filling in the address of each variable, which causes cumbersome work and prone to errors. Summary of the invention
[0006] The purpose of the embodiments of the present invention is to provide an IO module configuration method, an IO module configuration device, a machine-readable storage medium and a processor. The IO module configuration method can automatically fill in variable addresses and reduce the error rate in the configuration process.
[0007] In order to achieve the above-mentioned object, the first aspect of the present application provides an IO module configuration method, comprising:
[0008] Get module address parameters;
[0009] According to the module address parameters, corresponding register addresses are assigned to variables in the preset initial IO module configuration to obtain variable addresses to generate a final IO module configuration;
[0010] The preset initial IO module configuration is obtained by allocating register addresses of a preset length according to the position sequence of the actual IO modules.
[0011] In the embodiment of the present application, the corresponding register address is assigned to the variable in the preset initial IO module configuration according to the module address parameter, including:
[0012] Determine whether the module address parameters match the address parameters of the preset initial IO module configuration,
[0013] It is determined that the module address parameter matches the address parameter of the preset initial IO module configuration, and corresponding register addresses are allocated to variables in the preset initial IO module configuration according to the module address parameter.
[0014] In the embodiment of the present application, it also includes:
[0015] It is determined that the module address parameter does not match the address parameter of the preset initial IO module configuration, and status information is generated.
[0016] In the embodiment of the present application, the actual IO module includes multiple types of card components, and the preset initial IO module configuration includes initial IO module configurations corresponding to various types of card components;
[0017] The step of allocating corresponding register addresses to variables in the preset initial IO module configuration according to the module address parameters to obtain variable addresses includes:
[0018] According to the module address parameter, a corresponding initial IO module configuration is selected, and corresponding register addresses are allocated to variables in the initial IO module configuration to obtain variable addresses.
[0019] In the embodiment of the present application, the construction process of the initial IO module configuration includes:
[0020] Determine the number of bytes required for each type of card when all channels are occupied;
[0021] Determine the maximum value of the number of bytes required when all channels are occupied by the various types of cards;
[0022] Determining a preset length according to the maximum value;
[0023] According to the actual position sequence of the various types of cards, register addresses of preset lengths are allocated to obtain an initial IO module configuration.
[0024] In the embodiment of the present application, determining the preset length according to the maximum value includes:
[0025] Taking the maximum value as the byte size occupied by the data information;
[0026] The byte size occupied by the data information and the byte size occupied by the preset basic information are summed to obtain the preset length.
[0027] A second aspect of the present application provides an IO module configuration device, comprising:
[0028] Get module, used to get module address parameters;
[0029] An allocation module is used to allocate corresponding register addresses to variables in a preset initial IO module configuration according to the module address parameters to obtain variable addresses so as to generate a final IO module configuration; wherein the preset initial IO module configuration is obtained by allocating register addresses of a preset length in the order of positions of actual IO modules.
[0030] In the embodiment of the present application, the actual IO module includes multiple types of card components, and the preset initial IO module configuration includes initial IO module configurations corresponding to various types of card components;
[0031] The allocation module comprises:
[0032] The selection allocation unit is used to select the corresponding initial IO module configuration according to the module address parameter, and allocate the corresponding register address to the variable in the initial IO module configuration to obtain the variable address.
[0033] A third aspect of the present application provides a processor configured to execute the above-mentioned IO module configuration method.
[0034] A fourth aspect of the present application provides a machine-readable storage medium, on which instructions are stored, and the instructions are used to enable a machine to execute any of the above-mentioned IO module configuration methods of the present application.
[0035] Through the above technical solution, by obtaining the module address parameter; then according to the module address parameter, the variable in the preset initial IO module configuration is assigned the corresponding register address to obtain the variable address, so as to generate the final IO module configuration; wherein, the preset initial IO module configuration is obtained by assigning the register address of the preset length according to the position order of the actual IO module. During the configuration process, only one parameter of this module address parameter needs to be filled in, and the variable address on the IO module can automatically assign the corresponding register address according to this module address, saving the time of filling in the address of each channel of the IO module and reducing the error rate in the configuration process. The module address parameter only needs to correspond to the actual installation position of each hardware IO module one by one, and the variable address can be matched. Compared with the previous need to fill in the address of each channel of each IO module, and the need to distinguish the input type or the output type, now only one module address parameter needs to be filled in for the IO module, and the variable address can correspond to its internal channel, which greatly shortens the programming time, reduces the failure rate, and shortens the troubleshooting time.
[0036] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:
[0038] Figure 1 A schematic diagram of a flow chart of an IO module configuration method according to an embodiment of the present application is shown;
[0039] Figure 2 A schematic diagram of IO module distribution according to an embodiment of the present application is shown;
[0040] Figure 3 The schematic diagram of the IO module configuration according to the embodiment of the present application is shown schematically;
[0041] Figure 4 The following schematically shows a structural block diagram of an IO module configuration device according to an embodiment of the present application;
[0042] Figure 5 The internal structure diagram of the device according to the embodiment of the present application is schematically shown.
[0043] Description of Reference Numerals
[0044] 410 - acquisition module; 420 - allocation module; 40 - device; 401 - processor; 402 - memory; 403 - bus. DETAILED DESCRIPTION
[0045] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.
[0046] Please see Figure 1-Figure 3 , Figure 1 A schematic diagram of a flow chart of an IO module configuration method according to an embodiment of the present application is shown; Figure 2 A schematic diagram of IO module distribution according to an embodiment of the present application is shown; Figure 3 The figure schematically shows a configuration diagram of an IO module according to an embodiment of the present application.
[0047] This embodiment provides an IO module configuration method, comprising the following steps:
[0048] Step 210: Obtain module address parameters;
[0049] In this embodiment, the module address parameter refers to the module address address. When the host computer configures the PLC program, this module address parameter must correspond to the actual placement of the IO module. For example, unit#1 indicates that the address of the IO module is 1, (i.e. Figure 2 The address of the switch input DI module is 1), uint#3 indicates that the address of the IO module is 3, (i.e. Figure 2 It should be noted that the module address parameter may be a number, a character, or the like, which is not limited in this embodiment.
[0050] Step 220: assigning corresponding register addresses to variables in the preset initial IO module configuration according to the module address parameters to obtain variable addresses to generate a final IO module configuration;
[0051] The preset initial IO module configuration is obtained by allocating register addresses of a preset length according to the position sequence of the actual IO modules.
[0052] In this embodiment, a fixed-length register address can be allocated in advance at the bottom layer of the module algorithm as the initial IO module configuration. During the configuration process, only one parameter, the module address parameter of the IO module, needs to be filled in, and the variable address on the IO module can automatically allocate the corresponding register address according to the module address parameter. The allocation of the corresponding register address can be performed by calculating the corresponding variable address according to the number of address bytes occupied by each channel.
[0053] Considering that commonly used IO module cards include switch input cards, switch output cards, analog input cards, analog output cards, etc., the actual IO module may include multiple types of cards. Accordingly, the preset initial IO module configuration includes the initial IO module configuration corresponding to various types of cards.
[0054] Wherein, the step of allocating corresponding register addresses to variables in the preset initial IO module configuration according to the module address parameters to obtain variable addresses includes:
[0055] According to the module address parameter, a corresponding initial IO module configuration is selected, and corresponding register addresses are allocated to variables in the initial IO module configuration to obtain variable addresses.
[0056] In this embodiment, since different cards correspond to their own initial IO module configurations, the corresponding initial IO module configuration may be selected first, and then the corresponding register address may be allocated to the variable.
[0057] Accordingly, the construction process of the initial IO module configuration includes the following steps:
[0058] First, determine the number of bytes required for each type of card when all channels are occupied;
[0059] Then, determine the maximum value of the number of bytes required by the various types of cards when all channels are occupied;
[0060] Then, according to the maximum value, a preset length is determined;
[0061] Specifically, the maximum value may be used as the byte size occupied by the data information; and then the byte size occupied by the data information and the byte size occupied by the preset basic information are summed to obtain the preset length.
[0062] Finally, according to the actual position sequence of the various types of cards, register addresses of preset lengths are allocated to obtain an initial IO module configuration.
[0063] In this embodiment, considering that all channels of several commonly used types of cards (switch input cards, switch output cards, analog input cards, and analog output cards) are occupied, the register of their channel data is the maximum number of bytes they occupy, and the maximum value when all card channels are occupied is taken as the fixed-length number of bytes occupied by the channel data of each IO module, such as 64, 128, or 256 BYTEs, and the addresses occupied by some basic and necessary information of the cards are added. Here, it is taken as an example that the basic information of each card occupies 6 BYTEs and the data information occupies 64 BYTEs, that is, each IO module occupies 70 BYTEs.
[0064] By setting the same preset length for the initial IO module configurations corresponding to various types of cards, it is possible to facilitate searching for the IO module configurations later.
[0065] The IO module configuration method in this embodiment is described below on the assumption that each IO module occupies 70 BYTEs.
[0066] For example: the IO module with the actual card address of 1 is the switch input module DI card, and its occupied module address is 1. This IO module occupies a total of 70 BYTEs, of which the first 6 BYTEs are the basic information of the card, and the following 64 BYTEs are the bytes occupied by the channel data of this card. The registers occupied by the data on each channel are arranged in sequence here. When configuring, the switch quantity of the first channel actually only occupies one bit. In order to facilitate data observation, the 7th BYTE is directly used as the data of the first channel. The switch quantity of the second channel occupies the 8th BYTE, and so on. This card has a total of 32 channels, so the switch quantity of the last channel occupies the address of the 38th BYTE position, and the remaining 39th to 70th BYTE positions are free. The card with the actual address of 2 does not actually exist, but the number of bytes occupied by the second card is still the 71st-140th BYTE. Although the actual IO module does not exist, the register address still needs to be free. The corresponding register position is left for this module address to facilitate the addition of an IO module at this position later. The card with the actual address of 3 is a switch output module. This card also occupies 70 BYTEs, that is, the 141st-210th BYTE. The 141st-146th BYTE is the byte occupied by the basic information of the card, and the 147th byte is the channel data information of this card. The position with the actual address of 4 is still empty and still occupies the 211th-280th BYTE. The actual address of 5 is an analog input AI module, which still occupies 281-350 BYTEs. The first 7 BYTEs, i.e. 281-287, are the basic information of the module. Assuming that the AI module has 8 channels in total, each channel occupies 2 BYTEs, the bytes occupied by the data part are 16 BYTEs, i.e. 288-303 BYTEs are the data bytes of this AI module. Similarly, the actual address of 7 is an analog output AO card, which occupies 351-420 BYTEs. The first 7 BYTEs, i.e. 351-357, are the basic information of the module. The AO module has 8 channels in total, each channel occupies 2 BYTEs, so the bytes occupied by the data part are 16 BYTEs, i.e. 358-373 BYTEs are the data bytes of this AI module. If there are IO modules in the future, the same method can be used.
[0067] In the above implementation process, the module address parameter is obtained; then according to the module address parameter, the corresponding register address is assigned to the variable in the preset initial IO module configuration to obtain the variable address, so as to generate the final IO module configuration; wherein, the preset initial IO module configuration is obtained by assigning the register address of the preset length according to the position order of the actual IO module. In the configuration process, only one parameter of this module address parameter needs to be filled in, and the variable address on the IO module can automatically assign the corresponding register address according to this module address, saving the time of filling in the address of each channel of the IO module and reducing the error rate in the configuration process. The module address parameter only needs to correspond to the actual installation position of each hardware IO module one by one, and the variable address can be matched. Compared with the previous need to fill in the address of each channel of each IO module, and the need to distinguish the input type or the output type, now only one module address parameter needs to be filled in for the IO module, and the variable address can correspond to its internal channel, which greatly shortens the programming time, reduces the failure rate, and shortens the troubleshooting time.
[0068] In some embodiments, in order to ensure the correctness of the configuration, a state judgment may also be performed, that is, according to the module address parameter, a corresponding register address is assigned to the variable in the preset initial IO module configuration, including the following steps:
[0069] First, determine whether the module address parameters match the address parameters of the preset initial IO module configuration.
[0070] Then, it is determined that the module address parameter matches the address parameter of the preset initial IO module configuration, and corresponding register addresses are allocated to variables in the preset initial IO module configuration according to the module address parameter.
[0071] Then, it is determined that the module address parameter does not match the address parameter of the preset initial IO module configuration, and status information is generated.
[0072] In this embodiment, by judging whether the module address parameter matches the address parameter of the preset initial IO module configuration, it can be determined whether the current initial IO module configuration corresponds to the hardware IO module to be actually configured. Only when they match, variable addresses are allocated to obtain the final IO module configuration, thereby ensuring the correctness of the configuration. Accordingly, in the case of mismatch, status information is generated so that the user can promptly learn the matching status and adjust the module address parameters.
[0073] Figure 1 FIG. 1 is a flow chart of an IO module configuration method in one embodiment. It should be understood that although Figure 1The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0074] Based on the same inventive concept, this embodiment provides an IO module configuration device, see 4, Figure 4 The schematic diagram shows a structural block diagram of an IO module configuration device according to an embodiment of the present application. The IO module configuration device includes an acquisition module 410 and an allocation module 420, wherein:
[0075] An acquisition module 410 is used to acquire module address parameters;
[0076] The allocation module 420 is used to allocate corresponding register addresses to variables in the preset initial IO module configuration according to the module address parameters to obtain variable addresses to generate the final IO module configuration; wherein the preset initial IO module configuration is obtained by allocating register addresses of a preset length in the order of the positions of the actual IO modules.
[0077] The actual IO module includes multiple types of cards, and the preset initial IO module configuration includes initial IO module configurations corresponding to various types of cards;
[0078] The allocation module 420 includes:
[0079] The selection allocation unit is used to select the corresponding initial IO module configuration according to the module address parameter, and allocate the corresponding register address to the variable in the initial IO module configuration to obtain the variable address.
[0080] The IO module configuration device includes a processor and a memory. The acquisition module 410 and the allocation module 420 are stored in the memory as program units. The processor executes the program units stored in the memory to implement corresponding functions.
[0081] The processor contains a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the variable address can be automatically filled in by adjusting the kernel parameters to reduce the error rate during the configuration process.
[0082] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0083] An embodiment of the present invention provides a machine-readable storage medium on which a program is stored. When the program is executed by a processor, the IO module configuration method is implemented.
[0084] An embodiment of the present invention provides a processor, which is used to run a program, wherein the IO module configuration method is executed when the program is running.
[0085] Please see Figure 5 , Figure 5 The internal structure diagram of the device according to the embodiment of the present application is schematically shown. The embodiment of the present invention provides a device 40, which includes at least one processor 401, and at least one memory 402 and a bus 403 connected to the processor 401; wherein the processor 401 and the memory 402 communicate with each other through the bus 403; the processor 401 is used to call the program instructions in the memory 402 to execute the above-mentioned IO module configuration method. The device 40 in this article can be a server, a PC, a PAD, a mobile phone, etc.
[0086] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing the following method steps:
[0087] Get module address parameters;
[0088] According to the module address parameters, corresponding register addresses are assigned to variables in the preset initial IO module configuration to obtain variable addresses to generate a final IO module configuration;
[0089] The preset initial IO module configuration is obtained by allocating register addresses of a preset length according to the position sequence of the actual IO modules.
[0090] In one embodiment, the assigning corresponding register addresses to variables in the preset initial IO module configuration according to the module address parameters includes:
[0091] Determine whether the module address parameters match the address parameters of the preset initial IO module configuration,
[0092] It is determined that the module address parameter matches the address parameter of the preset initial IO module configuration, and corresponding register addresses are allocated to variables in the preset initial IO module configuration according to the module address parameter.
[0093] In one embodiment, it further includes:
[0094] It is determined that the module address parameter does not match the address parameter of the preset initial IO module configuration, and status information is generated.
[0095] In one embodiment, the actual IO module includes multiple types of card components, and the preset initial IO module configuration includes initial IO module configurations corresponding to the various types of card components;
[0096] The step of allocating corresponding register addresses to variables in the preset initial IO module configuration according to the module address parameters to obtain variable addresses includes:
[0097] According to the module address parameter, a corresponding initial IO module configuration is selected, and corresponding register addresses are allocated to variables in the initial IO module configuration to obtain variable addresses.
[0098] In one embodiment, the construction process of the initial IO module configuration includes:
[0099] Determine the number of bytes required for each type of card when all channels are occupied;
[0100] Determine the maximum value of the number of bytes required when all channels are occupied by the various types of cards;
[0101] Determining a preset length according to the maximum value;
[0102] According to the actual position sequence of the various types of cards, register addresses of preset lengths are allocated to obtain an initial IO module configuration.
[0103] In one embodiment, determining the preset length according to the maximum value includes:
[0104] Taking the maximum value as the byte size occupied by the data information;
[0105] The byte size occupied by the data information and the byte size occupied by the preset basic information are summed to obtain the preset length.
[0106] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0107] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0108] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0109] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0110] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0111] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0112] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0113] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0114] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. An IO module configuration method, characterized in that: include: Get module address parameters; According to the module address parameters, corresponding register addresses are assigned to variables in the preset initial IO module configuration to obtain variable addresses to generate a final IO module configuration; The preset initial IO module configuration is obtained by allocating register addresses of a preset length according to the position sequence of the actual IO modules.
2. The IO module configuration method according to claim 1, characterized in that: The step of allocating corresponding register addresses to variables in the preset initial IO module configuration according to the module address parameters includes: Determine whether the module address parameters match the address parameters of the preset initial IO module configuration, It is determined that the module address parameter matches the address parameter of the preset initial IO module configuration, and corresponding register addresses are allocated to variables in the preset initial IO module configuration according to the module address parameter.
3. The IO module configuration method according to claim 2, characterized in that: Also includes: It is determined that the module address parameter does not match the address parameter of the preset initial IO module configuration, and status information is generated.
4. The IO module configuration method according to claim 1, characterized in that: The actual IO module includes various types of cards, and the preset initial IO module configuration includes initial IO module configurations corresponding to various types of cards; The step of allocating corresponding register addresses to variables in the preset initial IO module configuration according to the module address parameters to obtain variable addresses includes: According to the module address parameter, a corresponding initial IO module configuration is selected, and corresponding register addresses are allocated to variables in the initial IO module configuration to obtain variable addresses.
5. The IO module configuration method according to claim 4, characterized in that: The construction process of the initial IO module configuration includes: Determine the number of bytes required for each type of card when all channels are occupied; Determine the maximum value of the number of bytes required when all channels are occupied by the various types of cards; Determining a preset length according to the maximum value; According to the actual position sequence of the various types of cards, register addresses of preset lengths are allocated to obtain an initial IO module configuration.
6. The IO module configuration method according to claim 5, characterized in that: The step of determining a preset length according to the maximum value includes: Taking the maximum value as the byte size occupied by the data information; The byte size occupied by the data information and the byte size occupied by the preset basic information are summed to obtain the preset length.
7. An IO module configuration device, characterized in that: include: Get module, used to get module address parameters; An allocation module is used to allocate corresponding register addresses to variables in a preset initial IO module configuration according to the module address parameters to obtain variable addresses so as to generate a final IO module configuration; wherein the preset initial IO module configuration is obtained by allocating register addresses of a preset length in the order of positions of actual IO modules.
8. The IO module configuration device according to claim 7, characterized in that: The actual IO module includes various types of cards, and the preset initial IO module configuration includes initial IO module configurations corresponding to various types of cards; The allocation module comprises: The selection allocation unit is used to select the corresponding initial IO module configuration according to the module address parameter, and allocate the corresponding register address to the variable in the initial IO module configuration to obtain the variable address.
9. A processor, characterized in that: The device is configured to execute the IO module configuration method according to any one of claims 1 to 6.
10. A machine-readable storage medium having instructions stored thereon, characterized in that: When the instruction is executed by a processor, the processor is configured to execute the IO module configuration method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Systems and methods for register allocation
CN105637474A
Allocating method and system of register addresses and related device
CN108280030A
Register configuration method and device of circuit system
CN115543444A
Parameter configuration method and system of processing equipment and storage medium
CN115904534A
Method and apparatus for configurable address mapping and protection architecture and hardware for on-chip systems
US20040088566A1
Cited By
Configuration table analysis method, electronic device and program product
CN121173887A
