CN105527881A - Command processing method and device - Google Patents

Command processing method and device Download PDF

Info

Publication number
CN105527881A
CN105527881A CN201410522774.0A CN201410522774A CN105527881A CN 105527881 A CN105527881 A CN 105527881A CN 201410522774 A CN201410522774 A CN 201410522774A CN 105527881 A CN105527881 A CN 105527881A
Authority
CN
China
Prior art keywords
address
register
instruction
continuous print
frequency converter
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.)
Granted
Application number
CN201410522774.0A
Other languages
Chinese (zh)
Other versions
CN105527881B (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.)
Town In Shanghai River Electrically Powered Machine Co Ltd
Shanghai Yaskawa Drive Co Ltd
Original Assignee
Town In Shanghai River Electrically Powered Machine 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 Town In Shanghai River Electrically Powered Machine Co Ltd filed Critical Town In Shanghai River Electrically Powered Machine Co Ltd
Priority to CN201410522774.0A priority Critical patent/CN105527881B/en
Publication of CN105527881A publication Critical patent/CN105527881A/en
Application granted granted Critical
Publication of CN105527881B publication Critical patent/CN105527881B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Communication Control (AREA)

Abstract

An embodiment of the invention relates to the field of electronic technologies, in particular to a command processing method and a command processing device, which are used for improving communication efficiency. The command processing method comprises the steps of: acquiring an initial address and number N of registers carried in a command after receiving the command; and determining N continuous first addresses according to the initial address and the number N of the registers, acquiring N register addresses in one-to-one correspondence with the N continuous first addresses, and executing the command according to the N register addresses which are discontinuous addresses. Since the discontinuous N register addresses required to be sent can be corresponded to the N continuous first addresses, the discontinuous N register addresses can be sent through one command, thereby improving the communication efficiency.

Description

A kind of command processing method and device
Technical field
The present invention relates to electronic technology field, particularly relate to a kind of command processing method and device.
Background technology
Modbus is a kind of general purpose language be applied on electronic controller.Modbus communication system is made up of a controller (Ye Cheng main website) and multiple stage frequency converter (also claiming slave station), and controller can be host computer or logical control device (ProgrammableLogicController is called for short PLC).Controller is communicated with frequency converter by Modbus agreement, to monitor the running status of frequency converter, and sets or checks parameter etc.
The process that controller sends an instruction by a communication cycle to frequency converter is as follows: controller sends instruction to frequency converter, and frequency converter receives this instruction of rear execution, and sends response message to controller.The instruction that controller sends may be used for indicating frequency converter to read the data of multiple register memory storage, frequency converter maybe can be indicated to multiple register write data, only when the address of described multiple register is continuation address, controller is just by sending an instruction to realize the operation of the data in the multiple register of above-mentioned reading or the operation to multiple register write data.When needing to read the data in the discontinuous register in multiple address, or to multiple address during discontinuous register write data, controller need by sending many instructions to frequency converter to complete aforesaid operations.Such as, when user need to read address is respectively the register of 0001H, 0100H, 1000H in frequency converter time, controller need to read data in these three registers by sending three instructions to frequency converter.
Owing to can only send an instruction in a communication cycle, therefore when the address of the register read or write is discontinuous, the command processing method that prior art provides has comparatively long time delay, and then reduces communication efficiency.
As can be seen here, need a kind of command processing method and device badly, in order to reduce communication delay, improve communication efficiency.
Summary of the invention
The embodiment of the present invention provides a kind of command processing method and device, in order to reduce communication delay, improves communication efficiency.
The embodiment of the present invention provides a kind of command processing method, is applied to and adopts Modbus communication protocol to carry out the system communicated, comprising:
Receive instruction;
Obtain the start address and register number of carrying in described instruction, described register number is N, N >=1;
Determine N number of first address of continuous print according to described start address and register number, and obtain and N number of first address of described continuous print N number of register address one to one, wherein, described N number of register address is discontinuous address;
Described instruction is performed according to described N number of register address.
Such as, the instruction that controller sends is received.The send mode of described instruction and form etc. meet Modbus communication protocol.Can by resolving the start address and register number that obtain and carry in instruction, register number is N, N >=1.
Determine N number of first address of continuous print according to described start address and register number, and obtain and N number of first address of described continuous print N number of register address one to one, perform described instruction according to described N number of register address; Wherein, described N number of register address is discontinuous address.
One preferably embodiment is before acquisition with N number of first address of described continuous print one to one N number of register address, judge to determine whether N number of first address of continuous print is in the first address set according to described start address and register number, if N number of first address of continuous print that described start address and register number are determined is in the first address set, then according to the corresponding relation between each the first address and each register address comprised in described first address set, be N number of register address by N number of for continuous print the first address one_to_one corresponding.
Preferably, N number of first address of described continuous print of presetting and the corresponding relation of N number of register address, or the corresponding relation between each the first address and each register address comprised in described first address set, all can store in the mode of mapping table.
Address in first address set is virtual register address, that is, the length of the address in the first address set is identical with the length of register address, but the span of address in the first address set is not within the register address span of frequency converter.Address in first address set also can be unappropriated register address, namely, the span of the address in the first address set within the register address span of frequency converter, but the register corresponding to address in the first address set not use by frequency converter.
In embodiments of the present invention, for needing the demand of by an instruction, the discontinuous register in multiple address being carried out to process operation, preset special first address set, and the one section of continuous print address (N number of first address of continuous print described above) that discontinuous for multiple address register pair be should be in the first address set, and this corresponding relation is configured to command reception end, in such as frequency converter.Each the first address comprised in above-mentioned first address set and the corresponding relation of each register address, can be stored as corresponding table.Because N number of first address of above-mentioned continuous print is namely inner at the first address set, therefore first address N number of with continuous print N number of register address corresponding respectively can be obtained according to the corresponding relation preset.This correspondence table is configured to command reception end, such as frequency converter, and can be accessed by frequency converter.In such first address set, the number of address can be greater than N, and can select N as required.
At instruction transmitting terminal, such as controller, N number of first address of described continuous print can be indicated in instruction, be used for representing the discontinuous register in described N number of address.At command reception end, such as frequency converter, after receiving this instruction, according to the one-to-one relationship of N number of first address of continuous print and register address, N number of for continuous print the first address is corresponded to discontinuous N number of register address.
Another kind, preferably in implementation, at command reception end, such as frequency converter, after receiving this instruction, first judges whether this N number of first address of continuous print shown in instruction indication is in the first address set.If judge, this N number of first address of continuous print shown in instruction indication is in the first address set, then according to the corresponding relation of the first address and register address, N number of for continuous print the first address is corresponded to discontinuous N number of register address.If judge, this N number of first address of continuous print shown in instruction indication is not in the first address set, then process according to current Modbus communication protocol, such as, carries out process operation for the register indicated by N number of first address of continuous print.
According to Modbus communication protocol, issue in the instruction of frequency converter and carry function code.If the function code of carrying in instruction is be used to indicate to read the function code of register, then frequency converter is after according to this instruction fetch to the data in corresponding registers, the data read is carried on response message, and sends this response message.This response message meets the regulation of Modbus communication protocol.Some register stores the information of monitored parameter, controller often needs to read different monitored parameter in register to confirm the operation conditions of frequency converter, such as U1 is status surveillance, U2 is that fault is followed the tracks of, U3 is failure logging, U4 monitors for safeguarding, when user needs the information reading monitored parameter, the function code being used to indicate and reading register is carried in instruction, and N number of register address that the N number of first address correspondence of continuous print obtains is the address of the N number of register for storing monitored parameter, now, user reads the information of monitored parameter from the N number of register storing monitored parameter.
If the function code of carrying in instruction is be used to indicate the function code to register write data, then the data that the needs carried in this instruction write are write corresponding register according to this instruction by frequency converter.
By above-mentioned known, due to N number of first address of continuous print can be determined according to the start address in received instruction and register number, then obtain and N number of first address of continuous print N number of register address one to one, so, N number of discontinuous register address can be corresponded to N number of first address of continuous print, such instruction transmitting terminal can indicate N number of first address of this continuous print in an instruction, and be N number of discontinuous register address at signaling receiving end by N number of for this continuous print the first address one_to_one corresponding, thus indicate by an instruction read or write is carried out to the discontinuous register in N number of address.Therefore having come to carry out compared with read or write to the discontinuous register in N number of address with using many instructions in prior art, having adopted the above embodiment of the present invention to reduce communication delay, improving communication efficiency.
The embodiment of the present invention additionally provides another kind of command processing method, is applied to and adopts Modbus communication protocol to carry out the system communicated, comprising:
In order to obtain and N number of discontinuous register address N number of first address one to one, obtain start address and the register number of described first address, N >=1;
Generate instruction, wherein, in instruction, carry start address and register number; Start address and the register number of N number of first address of continuous print is at least carried in the instruction generated.The form of the instruction generated meets the regulation of Modbus communication protocol.
Send instruction.
Specifically, user ask start address in the register address at the parameter place read or write and register number by user interface input institute, and submission comprises the request message of this start address and register number.As previously mentioned, for needing the demand of by an instruction, the discontinuous register in multiple address being carried out to process operation, N number of first address of continuous print can be corresponded to by needing the address of being carried out the discontinuous register in multiple addresses of process operation by an instruction.Preferably, N number of first address of continuous print that described start address and register number are determined is in the first address set, the one_to_one corresponding between each the first address and each register address comprised in the first address set.N number of first address of continuous print is one section of continuous print address in the first address set, start address entrained in the request message that user submits to is the start address of N number of first address of this continuous print, and N number of first address of this continuous print may correspond to as N number of discontinuous register address.
Preferably, N number of first address of described continuous print of presetting and the corresponding relation of N number of register address, or the corresponding relation between each the first address and each register address comprised in described first address set, all can store in the mode of mapping table.
Described first address set presets, first address set is virtual register address, that is, the length of the first address set is identical with the length of register address, but the span of the first address set is not within the register address span of frequency converter.First address set also can be unappropriated register address, that is, the span of the first address set is within the register address span of frequency converter, but register corresponding to the first address set not use by frequency converter.
In embodiments of the present invention, for needing the demand of by an instruction, the discontinuous register in multiple address being carried out to process operation, preset special first address set, and the one section of continuous print address (N number of first address of continuous print described above) that discontinuous for multiple address register pair be should be in the first address set, and this corresponding relation is configured to command reception end, in such as frequency converter.Each the first address comprised in above-mentioned first address set and the corresponding relation of each register address, can be stored as corresponding table.Because N number of first address of above-mentioned continuous print is namely inner at the first address set, therefore first address N number of with continuous print N number of register address corresponding respectively can be obtained according to the corresponding relation preset.This correspondence table is configured to command reception end, such as frequency converter, and can be accessed by frequency converter.In such first address set, the number of address can be greater than N, and can select N as required.
According to Modbus communication protocol, such as, issue in the instruction of frequency converter and carry function code.If the function code of carrying in instruction is be used to indicate to read the function code of register, then frequency converter is after according to this instruction fetch to the data in corresponding registers, the data read is carried on response message, and sends this response message to controller.This response message meets the regulation of Modbus communication protocol.Some register stores the information of monitored parameter, controller often needs to read different monitored parameter in register to confirm the operation conditions of frequency converter, such as U1 is status surveillance, U2 is that fault is followed the tracks of, U3 is failure logging, U4 monitors for safeguarding, when user needs the information reading monitored parameter, the function code being used to indicate and reading register is carried in instruction, and N number of register address that the N number of first address correspondence of continuous print obtains is the address of the N number of register for storing monitored parameter, now, user reads the information of monitored parameter from the N number of register storing monitored parameter.
If the function code of carrying in instruction is be used to indicate the function code to register write data, then the data that the needs carried in this instruction write are write corresponding register according to this instruction by frequency converter.
By above-mentioned known, due to N number of first address of continuous print can be determined according to the start address in received instruction and register number, then obtain and N number of first address of continuous print N number of register address one to one, so, N number of discontinuous register address can be corresponded to N number of first address of continuous print, such instruction transmitting terminal can indicate N number of first address of this continuous print in an instruction, and be N number of discontinuous register address at signaling receiving end by N number of for this continuous print the first address one_to_one corresponding, thus indicate by an instruction read or write is carried out to the discontinuous register in N number of address.Therefore having come to carry out compared with read or write to the discontinuous register in N number of address with using many instructions in prior art, having adopted the above embodiment of the present invention to reduce communication delay, improving communication efficiency.
The embodiment of the present invention also provides a kind of instruction processing unit, is applied to and adopts Modbus communication protocol to carry out the system communicated, comprising:
Receiving element, for receiving instruction.Such as, the instruction that controller sends is received.The send mode of described instruction and form etc. meet Modbus communication protocol.
Acquiring unit, for acquiring the start address and register number of carrying in instruction, register number is N, N >=1.
Processing unit, for determining N number of first address of continuous print according to described start address and register number, and obtains and N number of first address of described continuous print N number of register address one to one, and performs described instruction according to described N number of register address; Wherein, described N number of register address is discontinuous address.
Above-mentioned instruction processing unit can be frequency converter.
By above-mentioned known, due to N number of first address of continuous print can be determined according to the start address in received instruction and register number, then obtain and N number of first address of continuous print N number of register address one to one, so, N number of discontinuous register address can be corresponded to N number of first address of continuous print, such instruction transmitting terminal can indicate N number of first address of this continuous print in an instruction, and be N number of discontinuous register address at signaling receiving end by N number of for this continuous print the first address one_to_one corresponding, thus indicate by an instruction read or write is carried out to the discontinuous register in N number of address.Therefore having come to carry out compared with read or write to the discontinuous register in N number of address with using many instructions in prior art, having adopted the above embodiment of the present invention to reduce communication delay, improving communication efficiency.
The embodiment of the present invention additionally provides a kind of instruction processing unit, is applied to and adopts Modbus communication protocol to carry out the system communicated, comprising:
Obtain unit, for receiving request message, in order to obtain and N number of discontinuous register address N number of first address one to one, obtain start address and the register number of described first address, register number is N, N >=1; Wherein, N number of first address of continuous print determined according to described start address and register number and N number of register address one_to_one corresponding, described N number of register address is discontinuous address.
Processing unit, for generating instruction, carries start address and register number in instruction; Wherein, start address and the register number of N number of first address of continuous print is at least carried in instruction.The form of the instruction generated meets the regulation of Modbus communication protocol.
Transmitting element, for sending instruction.
Above-mentioned instruction processing unit can be the controller of frequency converter.
By above-mentioned known, due to N number of first address of continuous print can be determined according to the start address in received instruction and register number, then obtain and N number of first address of continuous print N number of register address one to one, so, N number of discontinuous register address can be corresponded to N number of first address of continuous print, such instruction transmitting terminal can indicate N number of first address of this continuous print in an instruction, and be N number of discontinuous register address at signaling receiving end by N number of for this continuous print the first address one_to_one corresponding, thus indicate by an instruction read or write is carried out to the discontinuous register in N number of address.Therefore having come to carry out compared with read or write to the discontinuous register in N number of address with using many instructions in prior art, having adopted the above embodiment of the present invention to reduce communication delay, improving communication efficiency.
Accompanying drawing explanation
The employing Modbus communication protocol that Fig. 1 is suitable for by the embodiment of the present invention carries out the system architecture schematic diagram communicated;
Fig. 2 is the schematic diagram of the communication sequential between prior art middle controller and frequency converter;
Fig. 3 is the schematic diagram of the order format that the invention process csr controller sends to frequency converter;
The structural representation of a kind of instruction processing unit that Fig. 4 provides for the embodiment of the present invention;
The structural representation of a kind of instruction processing unit that Fig. 5 provides for the embodiment of the present invention;
A kind of command processing method schematic flow sheet that Fig. 6 provides for the embodiment of the present invention;
The another kind of command processing method schematic flow sheet that Fig. 7 provides for the embodiment of the present invention;
Fig. 8 is the schematic diagram of the communication sequential between prior art middle controller and frequency converter;
Fig. 9 is the schematic diagram of the communication sequential between prior art middle controller and frequency converter.
Embodiment
The embodiment of the present invention provides a kind of command processing method and device, can be applicable to adopt Modbus communication protocol to carry out the system communicated.
In order to make object of the present invention, technical scheme and beneficial effect better clear, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
As shown in Figure 1, Fig. 1 illustrate the embodiment of the present invention a kind of Modbus of employing communication protocol of being suitable for carry out the system architecture that communicates.Usually this system architecture comprises a controller (main website) 101 and multiple stage frequency converter 102 (slave station), and controller 101 can be host computer or PLC.Controller 101 pairs of frequency converters 102 preset address, and controller 101 broadcast type sends instruction, when the destination address that frequency converter 102 finds to comprise in this instruction is Self address, perform this instruction, and send response to frequency converter 101.
As shown in Figure 2, the communication sequential that what Fig. 2 was exemplary show between controller and frequency converter.As shown in Figure 2, a complete communication cycle T1 comprises: controller transmitting time S1, frequency converter receive and the time S2 processed, response time S3, and the first minimum stand-by period S4 between S2 and S3.In order to prevent the overshoot of controller side, and prevent the loss of data, frequency converter needed to send response message to controller after the first minimum stand-by period.Can find out thus, the time needed for a communication cycle is longer.
As shown in Figure 2, in order to prevent the overshoot of frequency converter side, and preventing the loss of data, usually through the second minimum stand-by period S5 between the first communication cycle T1 and second communication cycle T 2, namely controller again sends instruction to same frequency converter through the second minimum stand-by period S5 after.Such as, when the instruction that controller sends is used to indicate the data in frequency converter reading register, the second minimum stand-by period was 5ms.Can find out thus, the time sent spent by many instructions to same frequency converter is longer.
As shown in Figure 3, order format that controller sends to frequency converter that what Fig. 3 was exemplary show, a complete instruction comprises frequency converter address 301, function code 302, data 303, error-checking 304.Frequency converter receive instruction and the frequency converter address obtained in instruction is Self address time, perform this instruction.
Function code 302, in order to indicate the function of this instruction, when the value as function code is 03H, represents that this instruction is used to indicate the data in frequency converter reading storage register; When the value of function code is 08H, represent that this instruction is used to indicate frequency converter and carries out loop-around test; When the value of function code is 10H, represent that this instruction is used to indicate frequency converter to multiple register write data.In prior art, according to Modbus agreement regulation, at most only can read 16 continuous print registers by an instruction; Same, also only can write data in 16 continuous print registers at most by an instruction.When supposing to need to read the data in multiple register, when the span of register address is more than 16, then need to read data in above-mentioned multiple register by sending many instructions.
Content in data 303 has different implications according to the difference of function code value, and such as, when the value of function code is 03H, the content of data 303 is the address needing the destination register read; When the value of function code is 10H, the content of data 303 is the address needing the destination register of write and the data that need write.
Error-checking 304 can generate automatically according to the content in this instruction, carries out transmission fault detection for frequency converter.
As described in the foregoing example, when the value of the function code in instruction is 03H, represent that this instruction is used to indicate the data in frequency converter reading register, according to Modbus agreement regulation, now in data 303, the target register address shown in indication is necessary for a continuous print address.The start address of target register address and the quantity of destination register is used to carry out indicating target register address in data 303.Such as, the start address of the target register address in data 303 is 0020H, and the quantity of destination register is 3, then the target register address indicated by data 303 is 0020H, 0021H, 0022H.
As described in the foregoing example, when the value of the function code in instruction is 10H, represent that this instruction is used to indicate frequency converter and writes data to register, specify according to Modbus agreement, now in data 303, the register address shown in indication is also necessary for a continuous print address, uses the start address of target register address and the quantity of destination register to carry out indicating target register address in data 303.
If user needs the data read by controller in the discontinuous register in multiple addresses of same frequency converter, or need by the multiple addresses discontinuous register write data of controller to same frequency converter, then according to the aforementioned description to prior art, controller need send many instructions to this frequency converter.
Composition graphs 2 is given one example, if user needs the data read by controller in three discontinuous registers in address of same frequency converter, as 0010H, 0100H, 1000H.Due in prior art, by can read at most continuous print 16 registers in address in an instruction, register 0010H is read for needs, 0100H, the demand of the data in 1000H, obviously cannot be realized by an instruction, and need to read data in these 3 registers by sending three instructions, as shown in Figure 2, this Time Controller sends the time span T0 that these three instructions and frequency converter carry out responding and comprises: the first communication cycle T1, first communication cycle T1 and the second minimum stand-by period S5 between the second communication cycle, second communication cycle T 2, between second communication cycle T 2 and the third communication cycle second minimum stand-by period S6, and third communication cycle T 3.
Can find out from said process, prior art middle controller needs to read data in same frequency converter in the discontinuous register in multiple address or to multiple address in same frequency converter during discontinuous register write data, need multiple communication cycle, communication efficiency is lower.
For this reason, a kind of instruction process solution corresponding based on address is embodiments provided.
The structure of what Fig. 4 was exemplary show a kind of instruction processing unit that the embodiment of the present invention provides.This instruction processing unit can be applicable to carry out based on the employing Modbus communication protocol shown in Fig. 1 the system architecture that communicates.As shown in Figure 4, instruction processing unit 401 can comprise receiving element 402, acquiring unit 403, processing unit 404, and further, this frequency converter also can comprise transmitting element 405.This instruction processing unit can be frequency converter, wherein above-mentioned functions module can software simulating also can hardware implementing, during hardware implementing, the receiving port that acquiring unit 403, processing unit 404 can be one or two processors, receiving element 402 can be instruction processing unit, transmitting element 405 can be the transmit port of instruction processing unit.
The structure of the instruction processing unit obtained based on above-mentioned functions Module Division is only a kind of example, such as, can also be obtained the instruction processing unit of other structures by the mode splitting above-mentioned module or combine.
Below based on the structure shown in Fig. 4, and when being frequency converter based on instruction processing unit, the major function of each functional module of instruction processing unit 401 is described.
Receiving element 402 is for receiving instruction.Such as, receiving element 402 is for receiving the instruction of controller transmission.Described instruction is used to indicate frequency converter and carries out particular procedure operation, and such as, described instruction includes but not limited to indicate frequency converter to read the data in register or the instruction to register write data.The send mode of described instruction and form etc. meet Modbus communication protocol.
Acquiring unit 403 is for acquiring the start address and register number of carrying in instruction, and register number is N, N >=1, and according to Modbus communication protocol, the maximum occurrences of N is 16.According to Modbus communication protocol, register address indicated in an instruction should be continuous, therefore can indicate continuous print register address with start address and register number, to represent that the register for this address carries out respective handling operation.
Processing unit 404, for determining N number of first address of continuous print according to described start address and register number, and obtain and N number of first address of described continuous print N number of register address one to one, and perform described instruction according to described N number of register address.
Wherein, described N number of register address is discontinuous address.The technical scheme of the embodiment of the present invention, is equally applicable to the situation that N number of register address is continuous print address.N number of register address that correspondence obtains is discontinuous or is continuous print, is determined by practical operation.
One preferably embodiment is before acquisition with N number of first address of described continuous print one to one N number of register address, judge to determine whether N number of first address of continuous print is in the first address set according to described start address and register number, if N number of first address of continuous print that described start address and register number are determined is in the first address set, then according to the corresponding relation between each the first address and each register address comprised in described first address set, be N number of register address by N number of for continuous print the first address one_to_one corresponding.
In embodiments of the present invention, for needing the demand of by an instruction, the discontinuous register in multiple address being carried out to process operation, preset special first address set, and the one section of continuous print address (N number of first address of continuous print described above) that discontinuous for multiple address register pair be should be in the first address set, and this corresponding relation is configured to command reception end, in such as frequency converter.Each the first address comprised in above-mentioned first address set and the corresponding relation of each register address, can be stored as corresponding table.Because N number of first address of above-mentioned continuous print is namely inner at the first address set, therefore first address N number of with continuous print N number of register address corresponding respectively can be obtained according to the corresponding relation preset.This correspondence table is configured to command reception end, such as frequency converter, and can be accessed by frequency converter.In such first address set, the number of address can be greater than N, and can select N as required.
At instruction transmitting terminal, such as controller, N number of first address of described continuous print can be indicated in instruction, be used for representing the discontinuous register in described N number of address.At command reception end, such as frequency converter, after receiving this instruction, according to the one-to-one relationship of N number of first address of continuous print and register address, N number of for continuous print the first address is corresponded to discontinuous N number of register address.
Another kind is preferably in implementation, and at command reception end, such as frequency converter, after receiving element 402 receives this instruction, processing unit 404 first judges whether this N number of first address of continuous print shown in instruction indication is in the first address set.If judge, this N number of first address of continuous print shown in instruction indication is in the first address set, then according to the corresponding relation of the first address and register address, N number of for continuous print the first address is corresponded to discontinuous N number of register address.If judge, this N number of first address of continuous print shown in instruction indication is not in the first address set, then process according to current Modbus communication protocol, such as, carries out process operation for the register indicated by N number of first address of continuous print.
Address in first address set is virtual register address, that is, the length of the address in the first address set is identical with the length of register address, but the span of address in the first address set is not within the register address span of frequency converter.Address in first address set also can be unappropriated register address, namely, the span of the address in the first address set within the register address span of frequency converter, but the register corresponding to address in the first address set not use by frequency converter.
Preferably, N number of first address of described continuous print of presetting and the corresponding relation of N number of register address, or the corresponding relation between each the first address and each register address comprised in described first address set, all can store in the mode of mapping table.This correspondence table is configured to command reception end, such as frequency converter, and can be accessed by the processor 404 of frequency converter.According to actual needs, allow to upgrade this correspondence table.Such as, when needing to carry out operational processes by an instruction to new parameter combinations, and the address storing the register of described new parameter combinations discontinuous time, the address of the register storing described new parameter combinations is corresponded to one section of continuation address in the first address set, and this corresponding relation is added in this correspondence table.
According to Modbus communication protocol, issue in the instruction of frequency converter and carry function code.If the function code of carrying in instruction is be used to indicate the function code reading register, then the processing unit 404 of frequency converter is after according to this instruction fetch to the data in corresponding registers, the data read are carried on response message, and send this response message by transmitting element 405.This response message meets the regulation of Modbus communication protocol.Some register stores the information of monitored parameter, controller often needs to read different monitored parameter in register to confirm the operation conditions of frequency converter, such as U1 is status surveillance, U2 is that fault is followed the tracks of, U3 is failure logging, U4 monitors for safeguarding, when user needs the information reading monitored parameter, the function code being used to indicate and reading register is carried in instruction, and N number of register address that the N number of first address correspondence of continuous print obtains is the address of the N number of register for storing monitored parameter, now, user reads the information of monitored parameter from the N number of register storing monitored parameter.
If the function code of carrying in instruction is be used to indicate the function code to register write data, then the data that the needs carried in this instruction write are write corresponding register according to this instruction by the processing unit 404 of frequency converter.
By describing above and can finding out, due to N number of first address of continuous print can be determined according to the start address in received instruction and register number, then obtain and N number of first address of continuous print N number of register address one to one, so, N number of discontinuous register address can be corresponded to N number of first address of continuous print, such instruction transmitting terminal can indicate N number of first address of this continuous print in an instruction, and be N number of discontinuous register address at signaling receiving end by N number of for this continuous print the first address one_to_one corresponding, thus indicate by an instruction read or write is carried out to the discontinuous register in N number of address.Therefore having come to carry out compared with read or write to the discontinuous register in N number of address with using many instructions in prior art, having adopted the above embodiment of the present invention to reduce communication delay, improving communication efficiency.
Based on identical design, what the embodiment of the present invention that what Fig. 5 was exemplary show provided is a kind ofly applied to the instruction processing unit 501 adopting Modbus communication protocol to carry out the system communicated, as shown in Figure 5, this instruction processing unit 501 can comprise acquisition unit 502, processing unit 503, transmitting element 504.Wherein, instruction processing unit 501 can be controller, be that controller is introduced based on this command device in following embodiment, this controller can be PLC or host computer, above-mentioned acquisition unit 502, processing unit 503, transmitting element 504 can software simulating also can hardware implementing, during hardware implementing, the receiving port that processing unit 503 can be processor, acquisition unit 502 can be instruction processing unit, transmitting element 504 can be the transmit port of instruction processing unit.
The controller architecture obtained based on above-mentioned functions Module Division is only a kind of example, such as, can also be obtained the controller of other structures by the mode splitting above-mentioned module or combine.
Below based on the structure shown in Fig. 5, the major function of each functional module of controller 501 is described.
Obtain unit 502 in order to obtain and N number of discontinuous register address N number of first address one to one, obtain start address and the register number of described first address.
For example, user ask start address in the register address at the parameter place read or write and register number by user interface input institute, and submission comprises the request message of this start address and register number.As previously mentioned, for needing the demand of by an instruction, the discontinuous register in multiple address being carried out to process operation, N number of first address of continuous print can be corresponded to by needing the address of being carried out the discontinuous register in multiple addresses of process operation by an instruction.Preferably, N number of first address of continuous print that described start address and register number are determined is in the first address set, the one_to_one corresponding between each the first address and each register address comprised in the first address set.N number of first address of continuous print is one section of continuous print address in the first address set, start address entrained in the request message that user submits to is the start address of N number of first address of this continuous print, and N number of first address of this continuous print may correspond to as N number of discontinuous register address.
Preferably, N number of first address of described continuous print of presetting and the corresponding relation of N number of register address, or the corresponding relation between each the first address and each register address comprised in described first address set, all can store in the mode of mapping table.
Described first address set presets, first address set is virtual register address, that is, the length of the first address set is identical with the length of register address, but the span of the first address set is not within the register address span of frequency converter.First address set also can be unappropriated register address, that is, the span of the first address set is within the register address span of frequency converter, but register corresponding to the first address set not use by frequency converter.
In embodiments of the present invention, for needing the demand of by an instruction, the discontinuous register in multiple address being carried out to process operation, preset special first address set, and the one section of continuous print address (N number of first address of continuous print described above) that discontinuous for multiple address register pair be should be in the first address set, and this corresponding relation is configured to command reception end, in such as frequency converter.Each the first address comprised in above-mentioned first address set and the corresponding relation of each register address, can be stored as corresponding table.Because N number of first address of above-mentioned continuous print is namely inner at the first address set, therefore first address N number of with continuous print N number of register address corresponding respectively can be obtained according to the corresponding relation preset.This correspondence table is configured to command reception end, such as frequency converter, and can be accessed by frequency converter.In such first address set, the number of address can be greater than N, and can select N as required.
Processing unit 503, for generating instruction, carries start address and register number in instruction; Wherein, start address and the register number of N number of first address of continuous print is at least carried in instruction.The form of the instruction that processing unit 503 generates meets the regulation of Modbus communication protocol.
Transmitting element 504 is for sending instruction.Based on the system architecture shown in Fig. 1, this instruction is sent to another instruction processing unit, as frequency converter.Frequency converter receives described in the process ditto after this instruction.
According to Modbus communication protocol, issue in the instruction of frequency converter and carry function code.If the function code of carrying in instruction is be used to indicate to read the function code of register, then frequency converter is after according to this instruction fetch to the data in corresponding registers, the data read is carried on response message, and sends this response message to controller 501.This response message meets the regulation of Modbus communication protocol.Some register stores the information of monitored parameter, controller often needs to read different monitored parameter in register to confirm the operation conditions of frequency converter, such as U1 is status surveillance, U2 is that fault is followed the tracks of, U3 is failure logging, U4 monitors for safeguarding, when user needs the information reading monitored parameter, the function code being used to indicate and reading register is carried in instruction, and N number of register address that the N number of first address correspondence of continuous print obtains is the address of the N number of register for storing monitored parameter, now, user reads the information of monitored parameter from the N number of register storing monitored parameter.
If the function code of carrying in instruction is be used to indicate the function code to register write data, then the data that the needs carried in this instruction write are write corresponding register according to this instruction by frequency converter.
By describing above and can finding out, due to N number of first address of continuous print can be determined according to the start address in received instruction and register number, then obtain and N number of first address of continuous print N number of register address one to one, so, N number of discontinuous register address can be corresponded to N number of first address of continuous print, such instruction transmitting terminal can indicate N number of first address of this continuous print in an instruction, and be N number of discontinuous register address at signaling receiving end by N number of for this continuous print the first address one_to_one corresponding, thus indicate by an instruction read or write is carried out to the discontinuous register in N number of address.Therefore having come to carry out compared with read or write to the discontinuous register in N number of address with using many instructions in prior art, having adopted the above embodiment of the present invention to reduce communication delay, improving communication efficiency.
Based on identical design, what the embodiment of the present invention that what Fig. 6 was exemplary show provided is a kind ofly applied to the command processing method flow process adopting Modbus communication protocol to carry out the system communicated, this flow process can perform in instruction processing unit, and such as perform at frequency converter end, this flow process can comprise:
Step 601, receives instruction.Such as, the instruction that controller sends is received.Described instruction is used to indicate frequency converter and carries out particular procedure operation, and such as, described instruction includes but not limited to indicate frequency converter to read the data in register or the instruction to register write data.The send mode of described instruction and form etc. meet Modbus communication protocol.
Step 602, in order to obtain and N number of discontinuous register address N number of first address one to one, obtains start address and the register number of described first address.According to Modbus communication protocol, register address indicated in an instruction should be continuous, therefore can indicate continuous print register address with start address and register number, to represent that the register for this address carries out respective handling operation.
Step 603, determines N number of first address of continuous print according to described start address and register number, and obtains and N number of first address of described continuous print N number of register address one to one, performs described instruction according to described N number of register address; Wherein, described N number of register address is discontinuous address.
One preferably embodiment is before acquisition with N number of first address of described continuous print one to one N number of register address, judge to determine whether N number of first address of continuous print is in the first address set according to described start address and register number, if N number of first address of continuous print that described start address and register number are determined is in the first address set, then according to the corresponding relation between each the first address and each register address comprised in described first address set, be N number of register address by N number of for continuous print the first address one_to_one corresponding.
In embodiments of the present invention, for needing the demand of by an instruction, the discontinuous register in multiple address being carried out to process operation, preset special first address set, and the one section of continuous print address (N number of first address of continuous print described above) that discontinuous for multiple address register pair be should be in the first address set, and this corresponding relation is configured to command reception end, in such as frequency converter.Each the first address comprised in above-mentioned first address set and the corresponding relation of each register address, can be stored as corresponding table.Because N number of first address of above-mentioned continuous print is namely inner at the first address set, therefore first address N number of with continuous print N number of register address corresponding respectively can be obtained according to the corresponding relation preset.This correspondence table is configured to command reception end, such as frequency converter, and can be accessed by frequency converter.In such first address set, the number of address can be greater than N, and can select N as required.
At instruction transmitting terminal, such as controller, N number of first address of described continuous print can be indicated in instruction, be used for representing the discontinuous register in described N number of address.At command reception end, such as frequency converter, after receiving this instruction, according to the one-to-one relationship of N number of first address of continuous print and register address, N number of for continuous print the first address is corresponded to discontinuous N number of register address.
Another kind, preferably in implementation, at command reception end, such as frequency converter, after receiving this instruction, first judges whether this N number of first address of continuous print shown in instruction indication is in the first address set.If judge, this N number of first address of continuous print shown in instruction indication is in the first address set, then according to the corresponding relation of the first address and register address, N number of for continuous print the first address is corresponded to discontinuous N number of register address.If judge, this N number of first address of continuous print shown in instruction indication is not in the first address set, then process according to current Modbus communication protocol, such as, carries out process operation for the register indicated by N number of first address of continuous print.
Address in first address set is virtual register address, that is, the length of the address in the first address set is identical with the length of register address, but the span of address in the first address set is not within the register address span of frequency converter.Address in first address set also can be unappropriated register address, namely, the span of the address in the first address set within the register address span of frequency converter, but the register corresponding to address in the first address set not use by frequency converter.
Preferably, N number of first address of described continuous print of presetting and the corresponding relation of N number of register address, or the corresponding relation between each the first address and each register address comprised in described first address set, all can store in the mode of mapping table.This correspondence table is configured to command reception end, such as frequency converter, and can be accessed by the processor 404 of frequency converter.According to actual needs, allow to upgrade this correspondence table.Such as, when needing to carry out operational processes by an instruction to new parameter combinations, and the address storing the register of described new parameter combinations discontinuous time, the address of the register storing described new parameter combinations is corresponded to one section of continuation address in the first address set, and this corresponding relation is added in this correspondence table.
According to Modbus communication protocol, issue in the instruction of frequency converter and carry function code.If the function code of carrying in instruction is be used to indicate to read the function code of register, then frequency converter is after according to this instruction fetch to the data in corresponding registers, the data read is carried on response message, and sends this response message.This response message meets the regulation of Modbus communication protocol.Some register stores the information of monitored parameter, controller often needs to read different monitored parameter in register to confirm the operation conditions of frequency converter, such as U1 is status surveillance, U2 is that fault is followed the tracks of, U3 is failure logging, U4 monitors for safeguarding, when user needs the information reading monitored parameter, the function code being used to indicate and reading register is carried in instruction, and N number of register address that the N number of first address correspondence of continuous print obtains is the address of the N number of register for storing monitored parameter, now, user reads the information of monitored parameter from the N number of register storing monitored parameter.
If the function code of carrying in instruction is be used to indicate the function code to register write data, then the data that the needs carried in this instruction write are write corresponding register according to this instruction by frequency converter.
By describing above and can finding out, due to N number of first address of continuous print can be determined according to the start address in received instruction and register number, then obtain and N number of first address of continuous print N number of register address one to one, so, N number of discontinuous register address can be corresponded to N number of first address of continuous print, such instruction transmitting terminal can indicate N number of first address of this continuous print in an instruction, and be N number of discontinuous register address at signaling receiving end by N number of for this continuous print the first address one_to_one corresponding, thus indicate by an instruction read or write is carried out to the discontinuous register in N number of address.Therefore having come to carry out compared with read or write to the discontinuous register in N number of address with using many instructions in prior art, having adopted the above embodiment of the present invention to reduce communication delay, improving communication efficiency.
Based on identical design, what the embodiment of the present invention that what Fig. 7 was exemplary show provided is a kind ofly applied to the method flow adopting Modbus communication protocol to carry out the system communicated, and this flow process can perform in instruction processing unit, such as performs at controller end, as shown in Figure 7, this flow process can comprise:
Step 701, in order to obtain and N number of discontinuous register address N number of first address one to one, obtains start address and the register number of described first address; Wherein, the start address of the first address and register number can obtain from data request information, N number of first address of continuous print determined according to start address and register number and N number of register address one_to_one corresponding, N number of register address is discontinuous address.
For example, user ask start address in the register address at the parameter place read or write and register number by user interface input institute, and submission comprises the request message of this start address and register number.As previously mentioned, for needing the demand of by an instruction, the discontinuous register in multiple address being carried out to process operation, N number of first address of continuous print can be corresponded to by needing the address of being carried out the discontinuous register in multiple addresses of process operation by an instruction.Preferably, N number of first address of continuous print that described start address and register number are determined is in the first address set, the one_to_one corresponding between each the first address and each register address comprised in the first address set.N number of first address of continuous print is one section of continuous print address in the first address set, start address entrained in the request message that user submits to is the start address of N number of first address of this continuous print, and N number of first address of this continuous print may correspond to as N number of discontinuous register address.
Preferably, N number of first address of described continuous print of presetting and the corresponding relation of N number of register address, or the corresponding relation between each the first address and each register address comprised in described first address set, all can store in the mode of mapping table.
Described first address set presets, first address set is virtual register address, that is, the length of the first address set is identical with the length of register address, but the span of the first address set is not within the register address span of frequency converter.First address set also can be unappropriated register address, that is, the span of the first address set is within the register address span of frequency converter, but register corresponding to the first address set not use by frequency converter.
In embodiments of the present invention, for needing the demand of by an instruction, the discontinuous register in multiple address being carried out to process operation, preset special first address set, and the one section of continuous print address (N number of first address of continuous print described above) that discontinuous for multiple address register pair be should be in the first address set, and this corresponding relation is configured to command reception end, in such as frequency converter.Each the first address comprised in above-mentioned first address set and the corresponding relation of each register address, can be stored as corresponding table.Because N number of first address of above-mentioned continuous print is namely inner at the first address set, therefore first address N number of with continuous print N number of register address corresponding respectively can be obtained according to the corresponding relation preset.This correspondence table is configured to command reception end, such as frequency converter, and can be accessed by frequency converter.In such first address set, the number of address can be greater than N, and can select N as required.
Step 702, generates instruction, wherein, at least carries start address and the register number of the first address in instruction.The form of the instruction generated meets the regulation of Modbus communication protocol.
Step 703, sends instruction.
Based on the system architecture shown in Fig. 1, this instruction is sent to another instruction processing unit, as frequency converter.Frequency converter receives described in the process ditto after this instruction.
According to Modbus communication protocol, issue in the instruction of frequency converter and carry function code.If the function code of carrying in instruction is be used to indicate to read the function code of register, then frequency converter is after according to this instruction fetch to the data in corresponding registers, the data read is carried on response message, and sends this response message to controller.This response message meets the regulation of Modbus communication protocol.Some register stores the information of monitored parameter, controller often needs to read different monitored parameter in register to confirm the operation conditions of frequency converter, such as U1 is status surveillance, U2 is that fault is followed the tracks of, U3 is failure logging, U4 monitors for safeguarding, when user needs the information reading monitored parameter, the function code being used to indicate and reading register is carried in instruction, and N number of register address that the N number of first address correspondence of continuous print obtains is the address of the N number of register for storing monitored parameter, now, user reads the information of monitored parameter from the N number of register storing monitored parameter.
If the function code of carrying in instruction is be used to indicate the function code to register write data, then the data that the needs carried in this instruction write are write corresponding register according to this instruction by frequency converter.
By describing above and can finding out, due to N number of first address of continuous print can be determined according to the start address in received instruction and register number, then obtain and N number of first address of continuous print N number of register address one to one, so, N number of discontinuous register address can be corresponded to N number of first address of continuous print, such instruction transmitting terminal can indicate N number of first address of this continuous print in an instruction, and be N number of discontinuous register address at signaling receiving end by N number of for this continuous print the first address one_to_one corresponding, thus indicate by an instruction read or write is carried out to the discontinuous register in N number of address.Therefore having come to carry out compared with read or write to the discontinuous register in N number of address with using many instructions in prior art, having adopted the above embodiment of the present invention to reduce communication delay, improving communication efficiency.
Based on the system architecture described in Fig. 1, usually the various monitored parameters reading frequency converter are continually needed, such as status surveillance parameter, fault tracking parameter, safeguard monitored parameter etc., but likely address is discontinuous for the required monitored parameter read of user, for this situation, the embodiment of the present invention can be applied to improve reading efficiency.
Give one example, if user needs monitored parameter U1-02, U2-03, U1-12 of being read same frequency converter by controller, U1-02 represents output frequency parameter, U2-02 represents output current parameter, U1-12 represents frequency converter state parameter, and these three monitored parameters are stored in three discontinuous registers in address, and U1-02 is stored in the register that address is 0024H, U2-03 is stored in the register that address is 0026H, and U1-12 is stored in the register that address is 004BH.
In order to pass through an instruction fetch to U1-02, U2-03, U1-12, can arrange as follows in advance: a continuation address 8001H to 8090H is set as virtual address, i.e. aforesaid first address set.This address size is identical with the address size of actual register in frequency converter, and the address one_to_one corresponding of actual register in virtual register address in the first address set and frequency converter.The span of this address is not within the span of the register address of frequency converter.Preferably, also can suppose to store virtual parameter in the virtual register address in the first address set.Virtual register address one_to_one corresponding in virtual parameter and the first address set.
Need three monitored parameters read to be positioned at three registers, now in the first address set, take out 3 continuous print first addresses, such as the first address is 8001H, 8002H, 8003H.Actual register address is carried out corresponding with continuous print first address.0024H is corresponded to 8001H, 0026H is corresponded to 8002H, 004BH is corresponded to 8003H, generate correspondence table as described in Table 1 according to this corresponding relation, this correspondence table is configured in frequency converter.This correspondence table can be arranged voluntarily by user, or has configured in frequency converter when dispatching from the factory, and the correspondence table of this configuration is informed to user.
Table 1: address correspondence table
When user needs to read monitored parameter U1-02, U2-03, U1-12, according to the mapping table set, can read A3-01, A3-02, A3-03, the virtual address 8000H of A3-01, A3-02, A3-03,80001H, 8002H are submitted to controller by request message.
Controller generates the instruction for reading parameter according to this request message, and this instruction is sent to frequency converter.Suppose that the address of this register is 02H, then the form of this instruction can be as shown in table 2.
Table 2: the form reading the command information of parameter
Register address in command information in table 2 is the address of this register, function code 03H represents that the information stored in register is read in this instruction instruction, open numbering 8001H in this instruction is the start address of register, number 0003H in instruction is register number, namely represents continuous three registers from 8001H.
After frequency converter receives this instruction, be 8000H, 80001H, 8002H according to the address that the start address 8001H in this instruction and register number 0003H determines.And judge that this address is in the first virtual address set.Inquire about mapping table as shown in table 1 according to 8000H, 80001H, 8002H, obtain corresponding register address 0024H, 0026H, 004BH.Frequency converter reads data U1-02 in register that address is 0024H, 0026H, 004BH, U2-03, U1-12, and the data read is carried and send to controller with response message.The form of response message can be as shown in table 3.
The form of table 3 response message
Visible, the method that the application embodiment of the present invention provides, three discontinuous register addresss can be sent to frequency converter by means of only an instruction, as shown in Figure 8, this Time Controller sends the time span T10 that this instruction and frequency converter carry out responding and comprises: the first communication cycle T11.A complete communication cycle T11 comprises: controller transmitting time S11, frequency converter receive and the time S12 processed, response time S13, and the first minimum stand-by period S14 between S12 and S13.If use prior art, use two instructions are needed to be sent by above-mentioned three discontinuous register addresss, as shown in Figure 9, this Time Controller sends the time span T20 that these two instructions and frequency converter carry out responding and comprises: the first communication cycle T21, the second minimum stand-by period S25 between the first communication cycle T21 and second communication cycle T 22, second communication cycle T 22.
From above-mentioned example, the frequency converter that theres is provided of the application embodiment of the present invention only needs a communication cycle when sending three discontinuous addresses, and uses above-mentioned prior art to send three discontinuous addresses to need two communication cycles to add a second minimum stand-by period.Can find out, under this application scenarios, call duration time is saved about 1/2nd by the frequency converter that the embodiment of the present invention provides, and improves communication efficiency.
By describing above and can finding out, due to N number of first address of continuous print can be determined according to the start address in received instruction and register number, then obtain and N number of first address of continuous print N number of register address one to one, so, N number of discontinuous register address can be corresponded to N number of first address of continuous print, such instruction transmitting terminal can indicate N number of first address of this continuous print in an instruction, and be N number of discontinuous register address at signaling receiving end by N number of for this continuous print the first address one_to_one corresponding, thus indicate by an instruction read or write is carried out to the discontinuous register in N number of address.Therefore having come to carry out compared with read or write to the discontinuous register in N number of address with using many instructions in prior art, having adopted the above embodiment of the present invention to reduce communication delay, improving communication efficiency.
The embodiment of the present invention, based on the system architecture shown in Fig. 1, has been described in detail for frequency converter and controller, but command processing method provided by the invention is adapted to comprise in other instruction processing units of functional module shown in Fig. 4 or Fig. 5 equally.
Those skilled in the art should understand, embodiments of the invention can be provided as method or computer program.Therefore, the present invention can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.And the present invention can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disk memory, CD-ROM, optical memory etc.) of computer usable program code.
The present invention describes with reference to according to the process flow diagram of the method for the embodiment of the present invention, device (system) and computer program and/or block scheme.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block scheme and/or square frame and process flow diagram and/or block scheme and/or square frame.These computer program instructions can being provided to the processor of multi-purpose computer, special purpose computer, Embedded Processor or other programmable data treating apparatus to produce a machine, making the instruction performed by the processor of computing machine or other programmable data treating apparatus produce device for realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer-readable memory that works in a specific way of vectoring computer or other programmable data treating apparatus, the instruction making to be stored in this computer-readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be loaded on computing machine or other programmable data treating apparatus, make to perform sequence of operations step on the computer or other programmable apparatus to produce computer implemented process, thus the instruction performed on the computer or other programmable apparatus is provided for the step realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
Although describe the preferred embodiments of the present invention, those skilled in the art once obtain the basic creative concept of cicada, then can make other change and amendment to these embodiments.So claims are intended to be interpreted as comprising preferred embodiment and falling into all changes and the amendment of the scope of the invention.
Obviously, those skilled in the art can carry out various change and modification to the present invention and not depart from the spirit and scope of the present invention.Like this, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.

Claims (20)

1. a command processing method, is applied to and adopts Modbus communication protocol to carry out the system communicated, it is characterized in that, comprising:
Receive instruction;
Obtain the start address and register number of carrying in described instruction, described register number is N, N >=1;
Determine N number of first address of continuous print according to described start address and register number, and obtain and N number of first address of described continuous print N number of register address one to one, wherein, described N number of register address is discontinuous address;
Described instruction is performed according to described N number of register address.
2. the method for claim 1, is characterized in that, described acquisition and N number of first address of described continuous print N number of register address one to one, specifically comprise:
Judge whether N number of first address of described continuous print is in the first address set;
If N number of first address of described continuous print is in described first address set, then obtain and N number of first address of described continuous print N number of register address one to one according to the corresponding relation preset, described corresponding relation is: the one-to-one relationship between each the first address and each register address comprised in described first address set.
3. method as claimed in claim 2, it is characterized in that, described default corresponding relation stores in the mode of mapping table.
4. the method for claim 1, is characterized in that,
Carry in described instruction to be used to indicate and read the function code of register, describedly perform described instruction according to described N number of register address, specifically comprise:
The data read are carried on response message and send described response message by the register corresponding to reading according to described N number of register address;
Or, carry the function code be used to indicate to register write data in described instruction, describedly perform described instruction according to described N number of register address, specifically comprise:
According to described N number of register address, the data to be written of carrying in described instruction are write corresponding register.
5. method as claimed in claim 4, it is characterized in that, carry in described instruction and be used to indicate when reading the function code of register, the N number of register address obtained according to the N number of first address one_to_one corresponding of described continuous print is the address of the N number of register for storing monitored parameter.
6. a command processing method, is applied to and adopts Modbus communication protocol to carry out the system communicated, it is characterized in that, comprising:
In order to obtain and N number of discontinuous register address N number of first address one to one, obtain start address and the register number of described first address, N >=1;
Generate instruction, wherein, in described instruction, carry described start address and register number;
Send described instruction.
7. method as claimed in claim 6, it is characterized in that, N number of first address of continuous print that described start address and register number are determined is in the first address set, the one_to_one corresponding between each the first address and each register address comprised in described first address set.
8. method as claimed in claim 6, is characterized in that, carries the function code being used to indicate and reading register in described instruction, or, carry the function code be used to indicate to register write data in described instruction.
9. method as claimed in claim 6, it is characterized in that, when carrying the function code being used to indicate and reading register in described instruction, N number of register address that the N number of first address one_to_one corresponding of described continuous print obtains is the address of the N number of register for storing monitored parameter.
10. an instruction processing unit, is applied to and adopts Modbus communication protocol to carry out the system communicated, it is characterized in that, comprising:
Receiving element, for receiving instruction;
Acquiring unit, for obtaining the start address and register number of carrying in described instruction, described register number is N, N >=1;
Processing unit, for determining N number of first address of continuous print according to described start address and register number, and obtains and N number of first address of described continuous print N number of register address one to one, and performs described instruction according to described N number of register address; Wherein, described N number of register address is discontinuous address.
11. instruction processing units as claimed in claim 10, is characterized in that, described processing unit, also for:
Judge whether N number of first address of described continuous print is in the first default address set,
If N number of first address of described continuous print is in described first address set, then according to the corresponding relation preset, N number of for described continuous print the first address is corresponded to N number of register address, wherein, described corresponding relation is: the corresponding relation between each the first address and each register address comprised in described first address set.
12. instruction processing units as claimed in claim 11, it is characterized in that, described default corresponding relation stores in the mode of mapping table.
13. instruction processing units as claimed in claim 12, is characterized in that,
The function code being used to indicate and reading register is carried, described processing unit in described instruction, specifically for:
The data read are carried on response message and send described response message by the register corresponding to reading according to described N number of register address;
Or, carry the function code be used to indicate to register write data in described instruction, processing unit, specifically for:
According to described N number of register address, the data to be written of carrying in described instruction are write corresponding register.
14. instruction processing units as claimed in claim 13, it is characterized in that, carry in described instruction and be used to indicate when reading the function code of register, the N number of register address obtained according to the N number of first address one_to_one corresponding of described continuous print is the address of the N number of register for storing monitored parameter.
15. as arbitrary in claim 10 ~ 14 as described in instruction processing unit, it is characterized in that, described instruction processing unit is frequency converter.
16. 1 kinds of instruction processing units, are applied to and adopt Modbus communication protocol to carry out the system communicated, it is characterized in that, comprising:
Obtain unit, in order to obtain and N number of discontinuous register address N number of first address one to one, obtain start address and the register number of described first address, wherein: N >=1;
Processing unit, for generating instruction, wherein, carries described start address and register number in described instruction;
Transmitting element, for sending described instruction.
17. instruction processing units as claimed in claim 16, it is characterized in that, N number of first address of continuous print that described start address and register number are determined is in the first address set, the one_to_one corresponding between each the first address and each register address comprised in described first address set.
18. instruction processing units as claimed in claim 16, is characterized in that, carry the function code being used to indicate and reading register in described instruction, or, carry the function code be used to indicate to register write data in described instruction.
19. instruction processing units as claimed in claim 18, it is characterized in that, when carrying the function code being used to indicate and reading register in described instruction, N number of register address that the N number of first address one_to_one corresponding of described continuous print obtains is the address of the N number of register for storing monitored parameter.
20. as arbitrary in claim 16 ~ 19 as described in instruction processing unit, it is characterized in that, described instruction processing unit is the controller of frequency converter.
CN201410522774.0A 2014-09-30 2014-09-30 A kind of command processing method and device Active CN105527881B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410522774.0A CN105527881B (en) 2014-09-30 2014-09-30 A kind of command processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410522774.0A CN105527881B (en) 2014-09-30 2014-09-30 A kind of command processing method and device

Publications (2)

Publication Number Publication Date
CN105527881A true CN105527881A (en) 2016-04-27
CN105527881B CN105527881B (en) 2019-02-22

Family

ID=55770173

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410522774.0A Active CN105527881B (en) 2014-09-30 2014-09-30 A kind of command processing method and device

Country Status (1)

Country Link
CN (1) CN105527881B (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106444657A (en) * 2016-09-14 2017-02-22 长飞光纤光缆股份有限公司 Modbus main station command processing method and master station controller
CN108280030A (en) * 2018-01-12 2018-07-13 厦门科灿信息技术有限公司 A kind of distribution method of register address, system and relevant apparatus
CN108398930A (en) * 2018-04-28 2018-08-14 深圳市策维科技有限公司 A kind of central control system and method
CN110457232A (en) * 2019-07-31 2019-11-15 联想(北京)有限公司 Data processing method, calculates equipment and medium at device
CN110515886A (en) * 2019-09-05 2019-11-29 天通吉成机器技术有限公司 A kind of slave computer control method, system, storage medium and industrial personal computer
CN111478837A (en) * 2020-04-02 2020-07-31 广东美的暖通设备有限公司 Data communication method, air conditioner, air conditioning system and storage medium
CN112073280A (en) * 2020-09-07 2020-12-11 合肥阳光新能源科技有限公司 Communication method and device based on Modbus protocol and communication equipment
CN112256617A (en) * 2020-10-23 2021-01-22 福州富昌维控电子科技有限公司 Method and terminal for improving serial port communication efficiency of equipment
CN112422485A (en) * 2019-08-23 2021-02-26 北京东土科技股份有限公司 Communication method and device of transmission control protocol
CN112631658A (en) * 2021-01-13 2021-04-09 成都国科微电子有限公司 Instruction sending method, chip and electronic equipment
CN113709012A (en) * 2021-08-26 2021-11-26 远景能源有限公司 Extended communication method based on Modbus communication protocol
CN115883461A (en) * 2022-11-28 2023-03-31 深圳市汇川技术股份有限公司 Data transmitting method, data responding method, device and storage medium
WO2023077769A1 (en) * 2021-11-03 2023-05-11 海光信息技术股份有限公司 Data processing method, apparatus and device, and computer-readable storage medium
CN116107261A (en) * 2023-04-12 2023-05-12 天津市伟利达科技发展有限公司 Control method and system of frequency converter

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030095447A1 (en) * 2001-11-20 2003-05-22 Koninklijke Philips Electronics N.V. Shared memory controller for display processor
CN101021819A (en) * 2007-03-14 2007-08-22 北京中星微电子有限公司 Access control method for synchronous dynamic memory and synchronous dynamic memory controller
CN101739328A (en) * 2009-12-16 2010-06-16 台安科技(无锡)有限公司 Method for enhancing speed of PC in monitoring singlechip through ModBus protocol
CN101977167A (en) * 2010-10-25 2011-02-16 深圳市兆讯达科技实业有限公司 Gateway communication protocol conversion method for wireless sensor network access Modbus bus
US20130159447A1 (en) * 2011-12-14 2013-06-20 Moxa Inc. System, gateway, and method for automatic setting configuration by learning commands

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030095447A1 (en) * 2001-11-20 2003-05-22 Koninklijke Philips Electronics N.V. Shared memory controller for display processor
CN101021819A (en) * 2007-03-14 2007-08-22 北京中星微电子有限公司 Access control method for synchronous dynamic memory and synchronous dynamic memory controller
CN101739328A (en) * 2009-12-16 2010-06-16 台安科技(无锡)有限公司 Method for enhancing speed of PC in monitoring singlechip through ModBus protocol
CN101977167A (en) * 2010-10-25 2011-02-16 深圳市兆讯达科技实业有限公司 Gateway communication protocol conversion method for wireless sensor network access Modbus bus
US20130159447A1 (en) * 2011-12-14 2013-06-20 Moxa Inc. System, gateway, and method for automatic setting configuration by learning commands

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106444657B (en) * 2016-09-14 2019-11-22 长飞光纤光缆股份有限公司 A kind of Modbus main website command processing method and main station controller
CN106444657A (en) * 2016-09-14 2017-02-22 长飞光纤光缆股份有限公司 Modbus main station command processing method and master station controller
CN108280030A (en) * 2018-01-12 2018-07-13 厦门科灿信息技术有限公司 A kind of distribution method of register address, system and relevant apparatus
CN108280030B (en) * 2018-01-12 2020-11-10 厦门科灿信息技术有限公司 Register address allocation method, system and related device
CN108398930A (en) * 2018-04-28 2018-08-14 深圳市策维科技有限公司 A kind of central control system and method
CN110457232A (en) * 2019-07-31 2019-11-15 联想(北京)有限公司 Data processing method, calculates equipment and medium at device
CN112422485A (en) * 2019-08-23 2021-02-26 北京东土科技股份有限公司 Communication method and device of transmission control protocol
CN112422485B (en) * 2019-08-23 2023-05-26 北京东土科技股份有限公司 Communication method and device of transmission control protocol
CN110515886A (en) * 2019-09-05 2019-11-29 天通吉成机器技术有限公司 A kind of slave computer control method, system, storage medium and industrial personal computer
CN111478837A (en) * 2020-04-02 2020-07-31 广东美的暖通设备有限公司 Data communication method, air conditioner, air conditioning system and storage medium
CN112073280A (en) * 2020-09-07 2020-12-11 合肥阳光新能源科技有限公司 Communication method and device based on Modbus protocol and communication equipment
CN112256617A (en) * 2020-10-23 2021-01-22 福州富昌维控电子科技有限公司 Method and terminal for improving serial port communication efficiency of equipment
CN112256617B (en) * 2020-10-23 2021-04-20 福州富昌维控电子科技有限公司 Method and terminal for improving serial port communication efficiency of equipment
CN112631658A (en) * 2021-01-13 2021-04-09 成都国科微电子有限公司 Instruction sending method, chip and electronic equipment
CN112631658B (en) * 2021-01-13 2022-11-15 成都国科微电子有限公司 Instruction sending method, chip and electronic equipment
CN113709012A (en) * 2021-08-26 2021-11-26 远景能源有限公司 Extended communication method based on Modbus communication protocol
WO2023077769A1 (en) * 2021-11-03 2023-05-11 海光信息技术股份有限公司 Data processing method, apparatus and device, and computer-readable storage medium
CN115883461A (en) * 2022-11-28 2023-03-31 深圳市汇川技术股份有限公司 Data transmitting method, data responding method, device and storage medium
CN116107261A (en) * 2023-04-12 2023-05-12 天津市伟利达科技发展有限公司 Control method and system of frequency converter
CN116107261B (en) * 2023-04-12 2023-06-13 天津市伟利达科技发展有限公司 Control method and system of frequency converter

Also Published As

Publication number Publication date
CN105527881B (en) 2019-02-22

Similar Documents

Publication Publication Date Title
CN105527881A (en) Command processing method and device
CN107277029B (en) Remote procedure call method and device and computer equipment
US11144330B2 (en) Algorithm program loading method and related apparatus
US9043806B2 (en) Information processing device and task switching method
US20110107344A1 (en) Multi-core apparatus and load balancing method thereof
CN110716793B (en) Method, device, equipment and storage medium for executing distributed transaction
US20230205870A1 (en) Control instruction processing method, apparatus and device, and computer storage medium
US20140289365A1 (en) Server apparatus, information processing system, address management method of server apparatus
CN110995817B (en) Request callback method and device and client equipment
CN105373563B (en) Database switching method and device
JP2001067235A (en) Interruption controller and microcomputer
WO2016041453A1 (en) Remote resource access method and exchange device
CN108833532B (en) Service processing method, device and system based on Internet of things
US9584880B2 (en) Method for the efficient transmission of data
US9348667B2 (en) Apparatus for managing application program and method therefor
CN105471930A (en) Method, system and equipment for reading distributed data
CN112131146B (en) Method and device for acquiring equipment information, storage medium and electronic equipment
EP2609505A1 (en) Interrupt-based command processing
CN113362196B (en) Low-delay addressing method for pre-dispatching service of power grid monitoring system
CN113033791B (en) Computing device, integrated circuit device, board card and order preserving method for order preserving
CN113032299B (en) Bus system, integrated circuit device, board card and order preserving method for processing request
CN108304214B (en) Method and device for verifying integrity of immediate data
CN113032298B (en) Computing device, integrated circuit device, board card and order preserving method for order preserving
EP4207637A1 (en) Time synchronization method and apparatus, device, and storage medium
CN111079910B (en) Operation method, device and related product

Legal Events

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