CN111752210B - Automatic address negotiation system and method for PLC (programmable logic controller) expansion module - Google Patents

Automatic address negotiation system and method for PLC (programmable logic controller) expansion module Download PDF

Info

Publication number
CN111752210B
CN111752210B CN202010645620.6A CN202010645620A CN111752210B CN 111752210 B CN111752210 B CN 111752210B CN 202010645620 A CN202010645620 A CN 202010645620A CN 111752210 B CN111752210 B CN 111752210B
Authority
CN
China
Prior art keywords
address
expansion
module
plc
interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010645620.6A
Other languages
Chinese (zh)
Other versions
CN111752210A (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.)
Nanjing Dongwei Electronic Technology Co ltd
Original Assignee
Nanjing Dongwei Electronic Technology 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 Nanjing Dongwei Electronic Technology Co ltd filed Critical Nanjing Dongwei Electronic Technology Co ltd
Priority to CN202010645620.6A priority Critical patent/CN111752210B/en
Publication of CN111752210A publication Critical patent/CN111752210A/en
Application granted granted Critical
Publication of CN111752210B publication Critical patent/CN111752210B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
    • G05B19/054Input/output
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/10Plc systems
    • G05B2219/11Plc I-O input output
    • G05B2219/1109Expansion, extension of I-O
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Abstract

The invention discloses an automatic negotiation system for the address of a PLC (programmable logic controller) expansion module, which comprises the PLC and a plurality of expansion modules, wherein a bus interface is arranged on the PLC, each expansion module is provided with a bus interface and two RS232 interfaces, the two RS232 interfaces are respectively provided with a transmitting interface and a receiving interface, the expansion modules are sequentially connected, the receiving interface of a first expansion module in the expansion modules is left, the transmitting interface of the last expansion module is left, the transmitting interfaces of the other expansion modules are connected with the receiving interface of the next expansion module, the PLC and the expansion modules are connected in cascade through expansion buses to form a bus topology structure, and a nonvolatile memory is arranged on the expansion modules and is used for storing module addresses; the invention provides a PLC expansion module address auto-negotiation system and a method, which enable modules on the same bus to automatically allocate addresses according to sequence without manual intervention, and are convenient, quick and not easy to make mistakes.

Description

Automatic address negotiation system and method for PLC (programmable logic controller) expansion module
Technical Field
The invention relates to the technical field of PLC expansion, in particular to an automatic address negotiation system and method for a PLC expansion module.
Background
Typically, a PLC will have a main unit, power module, CPU, I/O module all integrated together. In some cases, since the number of points required by the control object is relatively large, the number of I/O points of the main unit is insufficient, and an expansion module needs to be added, or certain control modules (a communication module, an analog module, etc.) are required in some fields, but these modules are not integrated on the main unit, so that these expansion modules need to be added to meet the control requirement of the system.
Because of the lack of an interface, PLCs often require the use of expansion modules, which typically communicate with the PLC via a bus, each expansion module must have an address or ID that is unique from the other modules.
There are two types of address setting modes of the expansion module commonly used at present:
1. the expansion module is provided with a dial switch, the numerical value of the dial switch is the module address, and if the address of the module needs to be changed, the dial switch is changed. If the number of modules on a bus is large, two or more module addresses may be identical due to human error, so that communication errors are caused, and further more human check is needed.
2. The expansion module is connected with a computer, and the module address is set by using related computer software and stored in the module. Similar to the mode 1, the mode also has manual errors, so that each module address on one bus cannot be guaranteed to be unique, and computer cooperation is required for changing the module address, so that the mode is inconvenient.
Disclosure of Invention
Based on the technical problems in the background technology, the invention provides a PLC expansion module address auto-negotiation system and a method.
The invention provides a PLC expansion module address auto-negotiation system, which comprises a PLC and a plurality of expansion modules, wherein the PLC is provided with a bus interface, each expansion module is provided with a bus interface and two RS232 interfaces, the two RS232 interfaces are respectively provided with a transmitting interface and a receiving interface, the expansion modules are sequentially connected, the receiving interface of the first expansion module in the expansion modules is left, the transmitting interface of the last expansion module is left, the transmitting interfaces of the other expansion modules are connected with the receiving interface of the next expansion module, the PLC and the expansion modules are connected in cascade through expansion buses to form a bus topology structure, and the expansion modules are provided with nonvolatile memories (such as EEPROMs) for storing module addresses.
Preferably, the expansion bus is a CAN bus.
Preferably, the number of the expansion modules is between one and one hundred.
Preferably, the expansion module is respectively provided with an RS232 transmitting interface and an RS232 receiving interface.
A method for automatically negotiating the address of a PLC expansion module, wherein a transmission interface of the expansion module periodically transmits own address codes, and a receiving interface can receive the address codes transmitted by other modules connected with the transmission interface, the method comprises the following steps:
s1: starting a negotiation flow, resetting a local address to 1, wherein the local address is denoted by a;
s2: entering a judging box, identifying whether address information is received or not, and entering a next operation step after the address information is identified;
s3: after the judgment box recognizes that the information is received, the received address is denoted by b, and then the local address is set as: a=b+1, and then judging whether to end the distribution flow;
s4: when the end of the distribution flow is identified, saving a to a memory and setting the memory as a local address, and ending the negotiation flow;
s5: and S2, whether address information is received or not is identified, if not, whether the distribution flow is ended is judged in a judging box directly, and if not, the local address is sent to a judging box of the step S2 to judge, and the cyclic reciprocating operation is carried out.
Preferably, after the auto-negotiation process starts in S1, the module resets its own address code to 1.
Preferably, in the step S4, when the end of the allocation procedure is identified, the allocated address is saved to the memory, and after the next start-up, the expansion module takes the address in the memory as a default address.
Preferably, the expansion module reads address data in the memory after each power-up, and if no auto-negotiation instruction sent by the PLC is received, the address data is used for bus communication.
Preferably, the address code of the module in S1 is set to be the received address code plus one.
The invention provides that two RS232 interfaces are added in each expansion module, one is used for receiving and the other is used for transmitting, the left side of the expansion module in the figure 1 is used for receiving and the right side is used for transmitting, a transmitting port can transmit the address code of the expansion module in the process of automatic negotiation, and a receiving port can receive the module address code connected with the expansion module.
When the device is used, according to the expected ordering, the receiving port of the first module is left blank, the receiving port of the second module is connected with the receiving port of the first module, the sending port of each module is connected with the receiving port of the next module in sequence, and the sending port of the last module is left blank.
After the hardware connection is completed and the normal starting is completed, a broadcast instruction (the broadcast instruction does not need a module address) is sent to each expansion module by a communication bus, and the instruction content is an automatic negotiation starting address.
The program flow of negotiating addresses for each module is shown in fig. 2:
after the negotiation is started, the module resets the own address a to 1, and continuously checks whether the address code of the adjacent module is received, if not, the module is the first one, no other modules are connected with the receiving port, if the address b sent by the other modules is received, the own address a is set to b+1, and in the negotiation process, the module needs to periodically send the own address, so that the modules connected with the back of the module can calculate the corresponding addresses.
The whole negotiation process is automatically carried out, the address allocation of more than 100 modules can be completed within 1 second after the circulation is carried out every 5ms in the negotiation process, the PLC can send the command for ending the automatic negotiation after delay for 2 seconds after sending the command for starting the negotiation, the module stores the local address for subsequent use after receiving the command for ending the negotiation, and the next startup is not needed to be negotiated again.
The invention provides a PLC expansion module address auto-negotiation system and a method, which enable modules on the same bus to automatically allocate addresses according to sequence without manual intervention, and are convenient, quick and not easy to make mistakes.
Drawings
FIG. 1 is a block diagram of an address auto-negotiation system of a PLC expansion module according to the present invention;
fig. 2 is a block diagram of a method for automatically negotiating an address of a PLC extension module according to the present invention.
Detailed Description
The invention is further illustrated below in connection with specific embodiments.
Examples
The embodiment provides a PLC expansion module address auto-negotiation system, including PLC and a plurality of expansion module, be provided with the bus interface on the PLC, every expansion module has bus interface and two RS232 interfaces, and two RS232 interfaces are provided with send interface and receiving interface respectively, and a plurality of expansion module is connected in proper order, and first expansion module receiving interface in a plurality of expansion modules leaves the space, and last expansion module send interface leaves the space, and other expansion module send interface all is connected with next module receiving interface, PLC and a plurality of expansion module pass through expansion bus concatenation and form bus topology structure, be provided with nonvolatile memory (like EEPROM) on the expansion module, nonvolatile memory is used for storing the module address.
In this embodiment, the expansion bus is a CAN bus.
In this embodiment, the number of the expansion modules is between one and one hundred.
In this embodiment, the expansion module is provided with an RS232 transmission interface and an RS232 reception interface, respectively.
A method for automatically negotiating the address of a PLC expansion module, wherein a transmission interface of the expansion module periodically transmits own address codes, and a receiving interface can receive the address codes transmitted by other modules connected with the transmission interface, the method comprises the following steps:
s1: starting a negotiation flow, resetting a local address to 1, wherein the local address is denoted by a;
s2: entering a judging box, identifying whether address information is received or not, and entering a next operation step after the address information is identified;
s3: after the judgment box recognizes that the information is received, the received address is denoted by b, and then the local address is set as: a=b+1, and then judging whether to end the distribution flow;
s4: when the end of the distribution flow is identified, saving a to a memory and setting the memory as a local address, and ending the negotiation flow;
s5: and S2, whether address information is received or not is identified, if not, whether the distribution flow is ended is judged in a judging box directly, and if not, the local address is sent to a judging box of the step S2 to judge, and the cyclic reciprocating operation is carried out.
In this embodiment, after the auto-negotiation process starts in S1, the module resets its own address code to 1.
In this embodiment, when the end of the allocation procedure is identified in S4, the allocated address is saved to the memory, and after the next start-up, the expansion module takes the address in the memory as the default address.
In this embodiment, the expansion module reads the address data in the memory after each power-up, and if the auto-negotiation instruction sent by the PLC is not received, the address data is used for bus communication.
In this embodiment, the address code of the module in S1 is set to be the received address code plus one.
As shown in fig. 1, in a conventional case, the PLC and the expansion modules are originally connected only by using a communication bus, and the PLC communicates with the corresponding expansion module according to an address code, which requires that the addresses of the expansion modules be set in advance.
The invention provides that two RS232 interfaces are added in each expansion module, one is used for receiving and the other is used for transmitting, the left side of the expansion module in the figure 1 is used for receiving and the right side is used for transmitting, a transmitting port can transmit the address code of the expansion module in the process of automatic negotiation, and a receiving port can receive the module address code connected with the expansion module.
When the device is used, according to the expected ordering, the receiving port of the first module is left blank, the receiving port of the second module is connected with the receiving port of the first module, the sending port of each module is connected with the receiving port of the next module in sequence, and the sending port of the last module is left blank.
After the hardware connection is completed and the normal starting is completed, a broadcast instruction (the broadcast instruction does not need a module address) is sent to each expansion module by a communication bus, and the instruction content is an automatic negotiation starting address.
The program flow of negotiating addresses for each module is shown in fig. 2:
after the negotiation is started, the module resets the own address a to 1, and continuously checks whether the address code of the adjacent module is received, if not, the module is the first one, no other modules are connected with the receiving port, if the address b sent by the other modules is received, the own address a is set to b+1, and in the negotiation process, the module needs to periodically send the own address, so that the modules connected with the back of the module can calculate the corresponding addresses.
The whole negotiation process is automatically carried out, the address allocation of more than 100 modules can be completed within 1 second after the circulation is carried out every 5ms in the negotiation process, the PLC can send the command for ending the automatic negotiation after delay for 2 seconds after sending the command for starting the negotiation, the module stores the local address for subsequent use after receiving the command for ending the negotiation, and the next startup is not needed to be negotiated again.
The foregoing is only a preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art, who is within the scope of the present invention, should make equivalent substitutions or modifications according to the technical scheme of the present invention and the inventive concept thereof, and should be covered by the scope of the present invention.

Claims (1)

1. The PLC expansion module address auto-negotiation system comprises a PLC and a plurality of expansion modules, and is characterized in that the PLC is provided with a bus interface, each expansion module is provided with a bus interface and two RS232 interfaces, the two RS232 interfaces are respectively provided with a transmitting interface and a receiving interface, the expansion modules are sequentially connected, a first expansion module receiving interface in the expansion modules is left, a last expansion module transmitting interface is left, other expansion module transmitting interfaces are connected with a next module receiving interface, the PLC and the expansion modules are connected in series through expansion buses to form a bus topology structure, and the expansion modules are provided with nonvolatile memories which are used for storing module addresses;
the expansion bus is a CAN bus;
the number of the expansion modules is between one and one hundred;
the expansion module is respectively provided with an RS232 sending interface and an RS232 receiving interface;
the expansion module transmitting interface periodically transmits own address codes, and the receiving interface can receive the address codes transmitted by other modules connected with the expansion module transmitting interface, and the method comprises the following steps:
s1: starting a negotiation flow, resetting a local address to 1, wherein the local address is denoted by a;
s2: entering a judging box, identifying whether address information is received or not, and entering a next operation step after the address information is identified;
s3: after the judgment box recognizes that the information is received, the received address is denoted by b, and then the local address is set as: a=b+1, and then judging whether to end the distribution flow;
s4: when the end of the distribution flow is identified, saving a to a memory and setting the memory as a local address, and ending the negotiation flow;
s5: in S2, whether address information is received is identified, if not, whether the distribution flow is ended is judged in a judging box, and if not, the local address is sent to a judging box in the step S2 to judge, and the cyclic reciprocating operation is carried out;
after the automatic negotiation process is started in the step S1, the module resets the address code of the module to 1;
in the step S4, when the allocation flow is identified to be ended, the allocated address is saved to the memory, and after the next starting, the expansion module takes the address in the memory as a default address;
the expansion module reads address data in a memory after being electrified every time, and if an automatic negotiation instruction sent by the PLC is not received, the address data is used for bus communication;
the address code of the module in the S1 is set to be the received address code plus one.
CN202010645620.6A 2020-07-07 2020-07-07 Automatic address negotiation system and method for PLC (programmable logic controller) expansion module Active CN111752210B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010645620.6A CN111752210B (en) 2020-07-07 2020-07-07 Automatic address negotiation system and method for PLC (programmable logic controller) expansion module

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010645620.6A CN111752210B (en) 2020-07-07 2020-07-07 Automatic address negotiation system and method for PLC (programmable logic controller) expansion module

Publications (2)

Publication Number Publication Date
CN111752210A CN111752210A (en) 2020-10-09
CN111752210B true CN111752210B (en) 2024-03-12

Family

ID=72679873

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010645620.6A Active CN111752210B (en) 2020-07-07 2020-07-07 Automatic address negotiation system and method for PLC (programmable logic controller) expansion module

Country Status (1)

Country Link
CN (1) CN111752210B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1719363A (en) * 2005-07-27 2006-01-11 艾默生网络能源有限公司 Hard ware extension method of programmable logic controller
KR20070102836A (en) * 2006-04-17 2007-10-22 엘에스산전 주식회사 Device and method for the communication of expansion modules
CN101145046A (en) * 2007-08-24 2008-03-19 上海正航电子科技有限公司 Programmable logic controller and expansion module interface
CN101523312A (en) * 2006-08-08 2009-09-02 西门子能量及自动化公司 Devices, systems, and methods for assigning a plc module address
CN101592934A (en) * 2009-06-30 2009-12-02 上海电器科学研究所(集团)有限公司 The communication means of programmable logic controller (PLC) and expansion module
CN203630575U (en) * 2013-12-24 2014-06-04 南京科远自动化集团股份有限公司 Communication structure between controller and expansion modules
CN110688336A (en) * 2019-09-26 2020-01-14 成都尖锋云智技术有限公司 Bus address automatic configuration method and system for implementing same

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1719363A (en) * 2005-07-27 2006-01-11 艾默生网络能源有限公司 Hard ware extension method of programmable logic controller
KR20070102836A (en) * 2006-04-17 2007-10-22 엘에스산전 주식회사 Device and method for the communication of expansion modules
CN101523312A (en) * 2006-08-08 2009-09-02 西门子能量及自动化公司 Devices, systems, and methods for assigning a plc module address
CN101145046A (en) * 2007-08-24 2008-03-19 上海正航电子科技有限公司 Programmable logic controller and expansion module interface
CN101592934A (en) * 2009-06-30 2009-12-02 上海电器科学研究所(集团)有限公司 The communication means of programmable logic controller (PLC) and expansion module
CN203630575U (en) * 2013-12-24 2014-06-04 南京科远自动化集团股份有限公司 Communication structure between controller and expansion modules
CN110688336A (en) * 2019-09-26 2020-01-14 成都尖锋云智技术有限公司 Bus address automatic configuration method and system for implementing same

Also Published As

Publication number Publication date
CN111752210A (en) 2020-10-09

Similar Documents

Publication Publication Date Title
CN100524119C (en) Programmable logic controller and expansion module interface
US9229440B2 (en) Method for the configuration of a control device
KR940002324B1 (en) Programmable controller
US7912558B2 (en) PLC for distributed control and distributed control system
US20110238188A1 (en) Engineering tool
EP0660243A1 (en) Address range extension for a modular computer
EP1701271A1 (en) Electronic apparatus system with master node and slave node
CN101132328A (en) Real-time industry Ethernet EtherCAT communication controller
CN106131240A (en) A kind of CAN address distribution method based on daisy chaining and communication system
EP1646186A2 (en) Address allocation system
US8458388B2 (en) Method for data communication between a programmable controller and a data processing device and interface driver program and interface hereto
JP2015176191A (en) controller
CN101681154A (en) Tool identification using Profinet
CN111752210B (en) Automatic address negotiation system and method for PLC (programmable logic controller) expansion module
US10659536B2 (en) Method of controlling inverters
JP3343036B2 (en) Programmable controller network system
CN114077562A (en) Protocol processing IP core of 1553B bus controller
CN102474195A (en) Inverter system and inverter
CN117614940B (en) Method and system for automatic configuration of serial communication equipment address
JP4320622B2 (en) node
CN117544598B (en) I2C bus address automatic allocation method
RU2743247C1 (en) Method of programmable logic controller operation
JP2550076B2 (en) Multiple system controller
CN208224772U (en) A kind of industrial device for embedded control based on CANopen bus
JP2003335470A (en) Elevator control transmitting system

Legal Events

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