CN117149683B - Adapter for industrial field - Google Patents

Adapter for industrial field Download PDF

Info

Publication number
CN117149683B
CN117149683B CN202311404842.9A CN202311404842A CN117149683B CN 117149683 B CN117149683 B CN 117149683B CN 202311404842 A CN202311404842 A CN 202311404842A CN 117149683 B CN117149683 B CN 117149683B
Authority
CN
China
Prior art keywords
adapter
module
communication
master station
task
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
CN202311404842.9A
Other languages
Chinese (zh)
Other versions
CN117149683A (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 Dekeweier Automation Co ltd
Original Assignee
Nanjing Dekeweier Automation 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 Dekeweier Automation Co ltd filed Critical Nanjing Dekeweier Automation Co ltd
Priority to CN202311404842.9A priority Critical patent/CN117149683B/en
Publication of CN117149683A publication Critical patent/CN117149683A/en
Application granted granted Critical
Publication of CN117149683B publication Critical patent/CN117149683B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40006Architecture of a communication node
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/004Error avoidance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3041Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is an input/output interface
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3055Monitoring arrangements for monitoring the status of the computing system or of the computing system component, e.g. monitoring if the computing system is on, off, available, not available
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4004Coupling between buses
    • G06F13/4027Coupling between buses using bus bridges
    • G06F13/404Coupling between buses using bus bridges with address mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN
    • 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]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Mathematical Physics (AREA)
  • Computer Security & Cryptography (AREA)
  • Communication Control (AREA)
  • Programmable Controllers (AREA)

Abstract

The invention discloses an adapter for an industrial field, which belongs to the technical field of industrial control, wherein the adapter is connected with a CAN master station, one or more IO modules are mounted on the adapter, the adapter is connected with an engineer station, and configuration software is deployed on the engineer station; during operation, the adapter creates a plurality of tasks with different priorities, wherein the tasks with different priorities comprise: IO communication task, master station communication task, USB communication task, data storage task; the IO communication task is used for processing data interaction service between the adapter and the IO module; the master station communication task is used for processing data interaction service between the adapter and the CAN master station; the USB communication task is used for processing firmware upgrading and configuration service of the configuration software to the adapter; the data storage task is used for processing the storage service of the IO module configuration parameters. The problem of IO module debugging and maintenance trouble has been solved to this application.

Description

Adapter for industrial field
Technical Field
The invention relates to the technical field of industrial control, in particular to an adapter for an industrial field.
Background
In control systems of industrial sites, a modular controller is more and more popular, but the number of IO modules of the modular controller is usually smaller, so that the industrial sites often adopt a bus protocol to enable a CAN master station to plug in a plurality of IO modules so as to adapt to actual demands.
However, for the integrated controller, when the CAN master station is hung with a plurality of IO modules, on one hand, as each IO module has respective communication address, communication baud rate, configuration parameters and the like, the IO modules need to be set one by one in the debugging process, and the debugging is more troublesome; on the other hand, when the IO module is overhauled or the IO modules with different models are replaced, the corresponding connecting wires are required to be removed, the communication address, the communication baud rate, the configuration parameters and the like of the IO module are required to be reconfigured, and the maintenance process is also troublesome.
Disclosure of Invention
In order to solve the problem that debugging and maintenance of a plurality of IO modules are troublesome, the application provides an adapter for an industrial field.
The application provides an adapter for industrial field, adopts following technical scheme: the adapter is connected with the CAN master station and is provided with one or more IO modules;
during operation, the adapter creates a plurality of tasks with different priorities, wherein the tasks with different priorities comprise: IO communication tasks and master station communication tasks;
the IO communication task is used for processing data interaction service between the adapter and the IO module;
and the master station communication task is used for processing data interaction service between the adapter and the CAN master station.
By adopting the technical scheme, the adapter is adopted as an intermediate medium, so that the adapter is respectively communicated with the IO module and the CAN master station and realizes data interaction, the adapter CAN collect and arrange information of the IO module into an internal cache, and then output the information of the IO module to the CAN master station to realize indirect access of the CAN master station to the IO module; the adapter integrates the IO modules to realize unified configuration and management of the IO modules, so that the IO modules are more convenient to debug, and when the IO modules with different models are overhauled or replaced, the adapter CAN automatically identify and communicate with the IO modules only by replacing the corresponding IO modules, communication addresses, communication baud rates and configuration parameters do not need to be reconfigured at a CAN master station end, the overhauling is more convenient, and the IO modules are easier to maintain.
In a specific embodiment, the adapter further comprises an initialization process; the initialization process comprises peripheral initialization, application initialization and master station communication task initialization;
the peripheral initialization is used for initializing the bottom-layer configuration of the adapter; the application initialization is used for configuring communication parameters and configuration parameters of the IO module; the master station communication task initialization is used for distributing PDO addresses to each IO module in the adapter; the communication parameters include a communication address and a baud rate.
By adopting the technical scheme, the adapter sets the communication addresses, baud rates and configuration parameters of all IO modules through the initialization process, the IO modules do not need to be set one by one, the debugging and maintenance are more convenient, the PDO addresses are distributed to the IO modules through internal storage of the adapter, and the information of the IO modules is convenient to record and store.
In a specific embodiment, the application initialization process specifically includes:
the adapter scans the mounted IO modules to acquire the number of the mounted IO modules;
the adapter sends an ID allocation request command to each IO module, and when the adapter receives an ID allocation response sent by each IO module, the adapter determines that the ID allocation to the IO module is successful and marks the ID information of each IO module;
the adapter is communicated with each IO module to load and obtain basic information of each IO module;
the adapter configures communication parameters and configuration parameters of each IO module based on basic information, ID information and a pre-stored module database of each IO module.
By adopting the technical scheme, the adapter realizes the configuration of the communication parameters and the configuration parameters of the IO module by scanning the IO module, distributing the ID to each IO module and loading the basic information of the IO module.
In a specific embodiment, the process of initializing the communication task of the master station specifically includes:
the adapter determines the type of each IO module based on the basic information of the IO module;
and the adapter allocates PDO addresses to the IO modules according to the types of the IO modules and marks PDO mapping parameters corresponding to the IO modules.
By adopting the technical scheme, the adapter is convenient for recording and storing the information of the IO module to the corresponding position by distributing the PDO address to the IO module and corresponding marking.
In a specific embodiment, the process of the IO communication task specifically includes:
the adapter scans the IO module and judges the communication state between the adapter and the IO module based on the data frame sent by the IO module to the adapter;
the adapter obtains the operation information of the IO module by analyzing the received data frame based on the communication state between the adapter and the IO module.
By adopting the technical scheme, the adapter judges the communication state of the adapter through the data frames sent by the IO module, and obtains the operation information of the IO module by analyzing the data frames when the communication state is normal, so that the adapter and the IO module can perform data transmission under the condition of normal communication, and the quality of the data transmission is improved.
In a specific embodiment, the flow of the master station communication task specifically includes:
the adapter checks the system communication state; the system communication state comprises a communication state between the adapter and the CAN master station and a communication state between the adapter and the IO module;
the adapter updates output process data and input process data based on the system communication state, IO module operation information and a control instruction of the CAN master station; the input process data characterizes IO module operation information sent by the adapter to the CAN master station; and the output process data represents a control instruction of the CAN master station sent to the IO module by the adapter.
Through adopting above-mentioned technical scheme, the adapter is through the communication state of inspection entire system, and when the communication state of entire system all is normal, then the adapter transmits the operation information of IO module to the CAN master station, realizes the mastering of the industrial field condition of CAN master station, and the adapter still transmits the control command of CAN master station to the IO module, realizes the control of CAN master station to the industrial field condition.
In a specific embodiment, the plurality of different priority tasks further includes a condition diagnosis task; the state diagnosis task is used for processing diagnosis services of the operation indicator lamp, the fault indicator lamp and the system indicator lamp.
By adopting the technical scheme, the adapter displays the running condition of the system in real time through the indicator lamp.
In a specific embodiment, the adapter is connected to an engineer station, the engineer station being deployed with configuration software; the tasks with different priorities further comprise USB communication tasks, wherein the USB communication tasks are used for processing firmware upgrading and configuration services of the configuration software to the adapter; the flow of the USB communication task specifically comprises the following steps:
the adapter analyzes and executes corresponding firmware upgrading operation on the firmware upgrading command based on the firmware upgrading command sent by the configuration software, and realizes the firmware upgrading of the adapter;
the adapter analyzes and executes corresponding configuration operation on the configuration command based on the configuration command sent by the configuration software, so as to realize configuration of the adapter.
By adopting the technical scheme, the adapter is connected with the engineer station, and the firmware upgrading and configuration of the adapter are realized through the configuration software of the engineer station, so that the performance and the function of the adapter are improved.
In a specific embodiment, the plurality of different priority tasks further includes a data storage task; the data storage task is used for processing a storage service of the IO module configuration parameters;
the flow of the data storage task specifically comprises the following steps:
the adapter receives a save instruction sent by the configuration software and/or the CAN master station;
and the adapter detects whether the configuration parameters of the IO module change according to the storage instruction, and if so, the adapter updates the configuration parameters of the IO module in an internal IO data storage area.
By adopting the technical scheme, the adapter detects the configuration parameters of the IO module according to the save command sent by the configuration software or according to the save command sent by the CAN master station or according to the save command sent by the configuration software and the CAN master station at the same time, and stores the configuration parameters of the IO module in real time when the configuration parameters of the IO module change.
In a specific embodiment, the priority of the IO communication task > the priority of the Master station communication task > the priority of the USB communication task > the priority of the status diagnostic task > the priority of the data storage task.
In summary, the technical scheme of the application at least comprises the following beneficial technical effects:
1. the adapter is used as an intermediate medium, so that the adapter is respectively communicated with the IO module and the CAN master station and realizes data interaction, the adapter CAN collect and arrange information of the IO module into an internal cache, and then output the information of the IO module to the CAN master station to realize indirect access of the CAN master station to the IO module; the adapter integrates the IO modules to realize unified configuration and management of the IO modules, so that the IO modules are more convenient to debug, and when the IO modules with different types are overhauled or replaced, the adapter CAN automatically identify and communicate with the IO modules only by replacing the corresponding IO modules, and the communication address, the communication baud rate and the configuration parameters are not required to be reconfigured at the CAN master station end, so that the overhauling is more convenient, and the IO modules are easier to maintain;
2. the adapter is used for checking the communication state of the whole system, when the communication state of the whole system is normal, the adapter transmits the operation information of the IO module to the CAN master station to realize the mastering of the industrial field condition by the CAN master station, and the adapter also transmits the control instruction of the CAN master station to the IO module to realize the control of the industrial field condition by the CAN master station;
3. the adapter is connected with the engineer station, and firmware upgrading and configuration of the adapter are realized through configuration software of the engineer station, so that the performance and functions of the adapter are improved.
Drawings
FIG. 1 is a schematic diagram of connection relationships between an adapter and a CAN master station, an IO module and configuration software, respectively, in an embodiment of the application;
fig. 2 is a schematic diagram of data interaction between tasks in an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The application discloses an adapter for an industrial field, referring to fig. 1, the adapter is connected with a CAN master station, specifically, the adapter is connected with the CAN master station through a CAN controller; the adapter is provided with one or more IO modules, and can perform data interaction with each IO module through an RS485 bus; specifically, the adapter may mount a plurality of different types of IO modules at the same time, where the different types of IO modules include: a digital quantity input type, i.e., DI type; analog input type, i.e., AI type; a digital quantity output type, namely a DO type; analog output type, i.e., AO type.
The adapter is connected with the CAN master station through the CAN bus, performs data interaction between the adapter and the CAN master station through a CANopen protocol, transmits data to the CAN master station through a transmission queue, and receives data and commands transmitted by the CAN master station through a receiving queue; specifically, the adapter transmits PDO data to the CAN master station through the transmission queue, and the adapter receives the PDO data transmitted by the CAN master station through the receiving queue, wherein the PDO represents a process data object.
During operation, the adapter creates a plurality of tasks with different priorities, wherein the tasks with different priorities comprise: IO communication tasks and master station communication tasks;
specifically, the IO communication task is used for processing a data interaction service between the adapter and the IO module;
and the master station communication task is used for processing data interaction service between the adapter and the CAN master station.
Therefore, the adapter is adopted as an intermediate medium, so that the adapter is respectively communicated with the IO module and the CAN master station and realizes data interaction, the adapter CAN collect and arrange information of the IO module into an internal cache, and then output the information of the IO module to the CAN master station to realize indirect access of the CAN master station to the IO module; the adapter integrates the IO modules to realize unified configuration and management of the IO modules, so that the IO modules are more convenient to debug, and when the IO modules with different models are overhauled or replaced, the adapter CAN automatically identify and communicate with the IO modules only by replacing the corresponding IO modules, communication addresses, communication baud rates and configuration parameters do not need to be reconfigured at a CAN master station end, the overhauling is more convenient, and the IO modules are easier to maintain.
Furthermore, the adapter adopts a card type structure, so that occupied space can be greatly reduced. Because in the traditional mode of directly adopting the CAN master station to plug in the IO module, one IO device needs to be externally connected with a power line and a public signal line, the power lines and the signal lines needed by a plurality of IO devices are multiplied, and the wiring is complicated; and in this application carry out the connection of power and signal through the backplate between adapter and the IO module, the adapter only needs two sets of power, a communication line for the wiring is also more convenient.
Further, the adapter also comprises an initialization process, wherein the initialization process comprises peripheral initialization, application initialization and master station communication task initialization; the peripheral initialization is used for initializing the bottom layer configuration of the adapter, and the application initialization is used for configuring the communication parameters and the configuration parameters of the IO module; wherein, the communication parameters comprise communication addresses and baud rates, and the configuration parameters comprise filtering grades of filtering time; the master communication task initialization is used to assign PDO addresses (PDOs, process data objects) to the IO modules within the adapter. In particular, the adapter may perform an initialization process prior to performing a plurality of tasks of different priorities.
Therefore, the adapter sets the communication addresses, baud rates and configuration parameters of all the IO modules through the initialization process, the IO modules do not need to be set one by one, debugging and maintenance are more convenient, and the PDO addresses are distributed to the IO modules through internal storage of the adapter, so that information of the IO modules can be recorded and stored conveniently.
In order to ensure that the adapter operates first, after the adapter is powered on, the initialization process is executed after waiting for a first preset time; preferably, the first preset time is 3s.
The peripheral initialization process specifically includes: the adapter initializes its own underlying configuration.
The application initialization process specifically comprises the following steps:
the adapter scans the mounted IO modules to acquire the number of the mounted IO modules;
the adapter sends an ID allocation request command to each IO module, and when the adapter receives an ID allocation response sent by each IO module, the adapter determines that the ID allocation to the IO module is successful and marks the ID information of each IO module; specifically, the ID allocation response characterizes each IO module to execute a corresponding response action based on the ID allocation request command;
the adapter is communicated with each IO module to load and obtain basic information of each IO module;
the adapter configures communication parameters and configuration parameters of each IO module based on basic information, ID information and a pre-stored module database of each IO module.
The basic information of the IO module comprises a model, a type, a version number and an input/output byte number; the configuration parameters of the IO module comprise filtering time and filtering grade. When the adapter configures the configuration parameters of each IO module, the size and the address of the configuration parameters are configured at the same time.
The method comprises the steps that a module database stored in the adapter in advance comprises a plurality of reference IO modules with different types and reference configuration parameters corresponding to the reference IO modules, the adapter obtains basic information of the IO modules through scanning, and the reference IO modules consistent with the basic information of the IO modules are selected from the module database and marked as first IO modules; the adapter updates the configuration parameters of the IO module based on the reference configuration parameters of the first IO module, and realizes the configuration of the configuration parameters of the IO module. In addition, the adapter can also configure configuration parameters of the IO module according to manual operation, so that the filtering time and the filtering grade of the IO module are more suitable for actual situations in the field, and the performance of the IO module is improved through manual operation.
Particularly, when the adapter scans the mounted IO modules, if the adapter judges that the number of the mounted IO modules exceeds a preset mounting number threshold, the adapter judges that the scanning fails and generates a reminder that the corresponding IO modules are excessively mounted; the adapter receives the ID allocation response sent by each IO module, if the ID allocation response sent by the IO module to the adapter is overtime, the adapter judges that the ID allocation of the IO module fails, and generates a corresponding prompt of the overtime ID allocation response.
Therefore, the adapter realizes the configuration of the communication parameters and the configuration parameters of the IO module by scanning the IO module, distributing ID to each IO module and loading the basic information of the IO module.
The process of initializing the communication task of the master station specifically comprises the following steps:
the adapter determines the type of each IO module based on the basic information of the IO module;
the adapter allocates PDO addresses to the IO modules according to the types of the IO modules, and marks PDO mapping parameters corresponding to the IO modules; specifically, the adapter marks the PDO mapping parameters corresponding to each IO module in an object dictionary format.
The types of the IO module comprise a digital quantity input type, an analog quantity input type, a digital quantity output type and an analog quantity output type. In order to improve the data processing efficiency of the adapter, when the adapter allocates PDO addresses to the IO modules, the adapter firstly gathers type information of all the IO modules, and then allocates the PDO addresses to the digital input type IO modules, the digital output type IO modules, the analog input type IO modules and the analog output type IO modules in sequence, wherein the PDO addresses allocated to the different types of IO modules are different. Illustratively, for an IO module of the numeric input type, the assigned dictionary address is 0x6000; aiming at the IO module of the digital quantity output type, the assigned dictionary address is 0x6200; aiming at the IO module of the analog input type, the assigned dictionary address is 0x6401; for the IO module of the analog output type, the assigned dictionary address is 0x6411.
Therefore, the adapter is convenient to record and store the information of the IO module to the corresponding position by distributing the PDO address to the IO module and corresponding marks.
Further, the adapter may perform system clock initialization before creating the task, and perform corresponding task scheduling after the task is created.
Further, the IO communication task is configured to process a data interaction service between the adapter and the IO module, and further is configured to process an inspection service of the adapter on an online status of the IO module, where a flow of the IO communication task specifically includes:
the adapter scans the IO module and judges the communication state between the adapter and the IO module based on the data frame sent by the IO module to the adapter; specifically, if a data frame sent to the adapter by the IO module is empty, the adapter determines that the IO module is disconnected, namely the communication state between the adapter and the IO module is abnormal; if the data frame sent by the IO module to the adapter is not empty, the adapter determines that the IO module is online, namely the communication state between the adapter and the IO module is normal;
the adapter obtains the operation information of the IO module by analyzing the received data frame based on the communication state between the adapter and the IO module, so as to realize the data interaction between the adapter and the IO module; the operation information of the IO module characterizes information in the operation process of the IO module, for example, the digital input type IO module, the operation information comprises input high-low level signals of the IO module, the analog input type IO module, and the operation information comprises input analog signals of the IO module.
Therefore, the adapter judges the communication state of the adapter and the IO module through the data frames sent by the IO module, and obtains the operation information of the IO module through analyzing the data frames when the communication state is normal, so that the adapter and the IO module can perform data transmission under the condition of normal communication, and the quality of the data transmission is improved.
In particular, before analyzing the received data frame to obtain the operation information of the IO module, the adapter can update the communication state between the adapter and the IO module by analyzing the received data frame, so as to realize the inspection of the on-line state of the IO module by the adapter; specifically, if the adapter obtains the data frame format or the content error sent by the IO module through analysis, the adapter judges that the communication state between the adapter and the IO module is abnormal, and sets the state of the IO module as disconnection; if the adapter obtains that the data frame format and the content sent by the IO module are correct through analysis, the adapter judges that the communication state between the adapter and the IO module is normal, and the state of the IO module is set to be online.
Further, the adapter also determines whether the IO module has alarm information or not by analyzing the data frame sent by the IO module, and updates the alarm condition of the IO module; specifically, if the IO module has alarm information, the adapter acquires the alarm information and generates a corresponding alarm reminder; if the IO module does not have the alarm information, and the adapter judges that the alarm information of the IO module marked internally is not cleared, the adapter clears the alarm information.
Further, when the adapter scans the IO modules, if the data frames received by the adapter are all empty within a second preset time, the adapter determines that the IO modules are scanned, and calculates the time for scanning all the IO modules; preferably, the second preset time is 2ms.
Further, the master station communication task is used for processing data interaction service between the adapter and the CAN master station and also used for processing checking service of the communication state of the system; the flow of the communication task of the master station specifically comprises the following steps:
the adapter checks the system communication state; the system communication state comprises a communication state between the adapter and the CAN master station and a communication state between the adapter and the IO module; specifically, when the adapter transmits data to the CAN master station, the adapter firstly transmits the data to the CAN controller through the CAN transmission queue, and then the CAN controller converts the received data and transmits the converted data to the CAN master station through the CAN bus; the adapter CAN judge the communication state between the adapter and the CAN master station by checking the running state of the CAN transmission queue when checking the communication state between the adapter and the CAN master station;
the adapter updates output process data and input process data based on the system communication state, the IO module operation information and the control instruction of the CAN master station; the input process data characterizes IO module operation information sent by the adapter to the CAN master station; the output process data represents a control instruction of the CAN master station sent by the adapter to the IO module; specifically, the control instruction of the CAN master station CAN determine the operation condition of the industrial field based on the operation information of the IO module for the CAN master station, generate a corresponding control instruction based on the operation condition of the industrial field, and also CAN control the control instruction sent by the CAN master station by manual operation.
Therefore, the adapter is used for checking the communication state of the whole system, when the communication state of the whole system is normal, the adapter transmits the operation information of the IO module to the CAN master station, so that the CAN master station CAN master the industrial field condition, and the adapter also transmits the control instruction of the CAN master station to the IO module, so that the CAN master station CAN control the industrial field condition. The adapter performs data transmission under the condition of ensuring that the adapter is normal in communication with the CAN master station and the IO module, and the quality of data transmission is further improved.
Further, the adapter stores the acquired IO module operation information into an internal IO data buffer area, and updates data in the IO data buffer area in real time based on the IO module operation information;
specifically, when the adapter updates the input process data, screening is performed firstly based on the IO module operation information, if the IO module operation information is unchanged compared with corresponding data in the IO data buffer zone, the adapter does not update the input process data, and before the input process data is sent, redundant information transmission is avoided by optimizing the data, so that the service lives of the CAN master station and the adapter are prolonged.
Further, the adapter is connected with an engineer station, and the engineer station is deployed with configuration software; the tasks with different priorities created by the adapter further comprise USB communication tasks, wherein the USB communication tasks are used for processing firmware upgrading and configuration services of the configuration software to the adapter; the flow of the USB communication task specifically comprises the following steps:
the adapter analyzes and executes corresponding firmware upgrading operation on the firmware upgrading command based on the firmware upgrading command sent by the configuration software, and realizes the firmware upgrading of the adapter;
the adapter analyzes and executes corresponding configuration operation on the configuration command based on the configuration command sent by the configuration software, so as to realize configuration of the adapter.
Therefore, by connecting the adapter with the engineer station, the firmware upgrade and configuration of the adapter are realized through the configuration software of the engineer station, and the performance and the function of the adapter are improved.
Specifically, the adapter may communicate with the engineer station in a USB communication manner, and the adapter is configured to implement self firmware upgrade and configuration according to a firmware upgrade command and a configuration command sent by configuration software in the engineer station, where the USB communication manner uses an HID protocol, the firmware upgrade command sent by the configuration software may use a custom communication protocol, the configuration command sent by the configuration software may use a Modbus protocol, and a person skilled in the art may set the protocol used by the person himself.
Illustratively, the configuration commands may include one or more of register_TABLE_1, register_TABLE_2, register_TABLE_3, register_TABLE_4, register_TABLE_5, register_TABLE_6, register_TABLE_7, register_TABLE_8, register_TABLE_9, register_TABLE_10, and when the parsed configuration command is register_TABLE_1, MAC address command processing is performed; when the analyzed configuration command is REGISTER_TABLE_2, executing the SN serial number command processing; executing the adapter information command processing when the analyzed configuration command is REGISTER_TABLE_3; when the analyzed configuration command is REGISTER_TABLE_4, executing IO module information command processing; when the analyzed configuration command is REGISTER_TABLE_5, executing IO module configuration information command processing; when the analyzed configuration command is REGISTER_TABLE_6, executing the input process data command processing; when the analyzed configuration command is REGISTER_TABLE_7, executing the command processing of the output process data; when the resolved configuration command is REGISTER_TABLE_8, executing the download configuration completion command processing; when the analyzed configuration command is REGISTER_TABLE_9, executing the communication configuration command processing of the master station; when the analyzed configuration command is REGISTER_TABLE_10, executing the general configuration information command processing of the master station; and executing corresponding configuration operation according to the analyzed configuration command.
Further, the process of executing the corresponding configuration operation by the adapter specifically includes: the adapter analyzes the configuration command and synchronizes coupler information data, module configuration information, process data and configuration data in sequence according to the analysis result;
after the configuration operation is completed, the adapter saves the configuration result based on the save instruction sent by the configuration software.
For example, the firmware upgrade command may include one or more of lap_cmd_info, lap_cmd_set, lap_cmd_idle, lap_cmd_start, lap_cmd_spin_get, lap_cmd_spin_addr, lap_cmd_spin_data, lap_cmd_addr, lap_cmd_data, lap_cmd_fish, lap_cmd_crc, lap_cmd_spin_crc, lap_cmd_jmp, lap_cmd_get; executing the LAP_CMD_INFO command processing when the analyzed firmware upgrading command is LAP_CMD_INFO; when the analyzed firmware upgrade command is LAP_CMD_SET, executing LAP_CMD_SET command processing; executing the LAP_CMD_IDLE command processing when the analyzed firmware upgrade command is LAP_CMD_IDLE; when the parsed firmware upgrade command is lap_cmd_start, the lap_cmd_start command processing … … is performed in the same manner as the parsing and the execution of other firmware upgrade commands, and will not be described in detail herein.
Further, the plurality of different priority tasks created by the adapter further includes a status diagnostic task; the state diagnosis task is used for processing diagnosis services of the operation indicator lamp, the fault indicator lamp and the system indicator lamp; the state diagnosis tasks comprise an operation indicator lamp diagnosis task, a fault indicator lamp diagnosis task and a system indicator lamp task;
the operation indicator lamp diagnosis task is used for processing diagnosis service of the operation indicator lamp when the adapter is in a first operation state, wherein the first operation state comprises one or more of an operation state, a stop state, a pre-operation state, a connection state of the adapter and an engineer station and a firmware upgrading state;
the fault indicator lamp diagnosis task is used for processing the diagnosis service of the fault indicator lamp when the adapter is in a second operation state, wherein the second operation state comprises one or more of an operation normal state, an off-line state, a configuration parameter invalid state, a forced mode, an abnormal warning state and a daemon node lost state; when the adapter is in the forced mode, the output state of the IO module can be set manually through the adapter; the loss state of the daemon node indicates that the adapter does not receive heartbeat data of the CAN master station within a set time.
The system indicator lamp diagnosis task is used for processing the diagnosis service of the system indicator lamp when the adapter is in a third operation condition, wherein the third operation condition comprises one or more of an IO module ID diagnosis condition, an IO module station number allocation condition, an IO module parameter allocation condition and a backboard bus condition. The configuration status of the IO module parameter comprises the communication parameters of the IO module and the configuration status of the configuration parameters.
Referring to table 1, the colors of several running indicator lamps, fault indicator lamps and system indicator lamps and the corresponding display conditions in different running conditions are illustrated, meanwhile, table 1 also shows the settings of the system power indicator lamps, the IO power indicator lamps and the communication interface indicator lamps, the on-off display of the indicator lamps can facilitate the user to observe the running states of the adapter and the system, and for the specific conditions of the display conditions of the indicator lamps, the person skilled in the art can set up by himself, which is not limited in this application.
Table 1 section indicator light status description
Further, the plurality of tasks of different priorities created by the adapter further includes a data storage task; the data storage task is used for processing a storage service of IO module configuration parameters, and the flow of the data storage task specifically comprises the following steps:
the adapter receives a save instruction sent by the configuration software and/or the CAN master station;
the adapter detects whether the configuration parameters of the IO module change according to the storage instruction, and if so, the adapter updates the configuration parameters of the IO module in an internal IO data storage area; further, the adapter also detects whether the operation information of the IO module changes according to the storage instruction, and if so, the adapter updates the operation information of the IO module in an internal IO data storage area; the IO data storage area is an area for storing IO module configuration parameters inside the adapter, and the IO data storage area is also an area for storing IO module operation information inside the adapter.
The data storage task is further used for processing an inspection service of the USB connection state, and the flow of the data storage task specifically further comprises: the adapter checks and updates the connection state between itself and the engineer station, specifically, if the adapter determines that the connection state between itself and the engineer station is changed, the adapter updates the connection state between itself and the engineer station, that is, updates the USB connection state.
Therefore, the adapter detects the configuration parameters of the IO module according to the save command sent by the configuration software or according to the save command sent by the CAN master station or according to the save command sent by the configuration software and the CAN master station at the same time, and stores the configuration parameters of the IO module in real time when the configuration parameters of the IO module change.
Further, referring to fig. 2, a schematic diagram of data interaction between tasks is shown, and the priority relationship between the tasks may be set as follows: the priority of the IO communication task is greater than the priority of the master station communication task, the priority of the USB communication task is greater than the priority of the state diagnosis task, and the priority of the data storage task is greater than the priority of the state diagnosis task.
The foregoing are all preferred embodiments of the present application, and are not intended to limit the scope of the present application in any way, therefore: all equivalent changes in structure, shape and principle of this application should be covered in the protection scope of this application.

Claims (9)

1. An adapter for an industrial field is characterized in that the adapter is connected with a CAN master station, and one or more IO modules are mounted on the adapter;
during operation, the adapter creates a plurality of tasks with different priorities, wherein the tasks with different priorities comprise: IO communication tasks and master station communication tasks;
the IO communication task is used for processing data interaction service between the adapter and the IO module;
the master station communication task is used for processing data interaction service between the adapter and the CAN master station;
the IO communication task flow specifically comprises the following steps:
the adapter scans the IO module and judges the communication state between the adapter and the IO module based on the data frame sent by the IO module to the adapter;
the adapter obtains the operation information of the IO module by analyzing the received data frame based on the communication state between the adapter and the IO module.
2. An adapter for an industrial site according to claim 1, wherein: the adapter further includes an initialization process; the initialization process comprises peripheral initialization, application initialization and master station communication task initialization;
the peripheral initialization is used for initializing the bottom-layer configuration of the adapter; the application initialization is used for configuring communication parameters and configuration parameters of the IO module; the master station communication task initialization is used for distributing PDO addresses to each IO module in the adapter; the communication parameters include a communication address and a baud rate.
3. An adapter for an industrial site according to claim 2, wherein: the application initialization process specifically comprises the following steps:
the adapter scans the mounted IO modules to acquire the number of the mounted IO modules;
the adapter sends an ID allocation request command to each IO module, and when the adapter receives an ID allocation response sent by each IO module, the adapter determines that the ID allocation to the IO module is successful and marks the ID information of each IO module;
the adapter is communicated with each IO module to load and obtain basic information of each IO module;
the adapter configures communication parameters and configuration parameters of each IO module based on basic information, ID information and a pre-stored module database of each IO module.
4. An adapter for an industrial site according to claim 3, wherein: the primary station communication task initializing process specifically comprises the following steps:
the adapter determines the type of each IO module based on the basic information of the IO module;
and the adapter allocates PDO addresses to the IO modules according to the types of the IO modules and marks PDO mapping parameters corresponding to the IO modules.
5. The adapter for an industrial field according to claim 1, wherein the flow of master station communication tasks, in particular, comprises:
the adapter checks the system communication state; the system communication state comprises a communication state between the adapter and the CAN master station and a communication state between the adapter and the IO module;
the adapter updates output process data and input process data based on the system communication state, IO module operation information and a control instruction of the CAN master station; the input process data characterizes IO module operation information sent by the adapter to the CAN master station; and the output process data represents a control instruction of the CAN master station sent to the IO module by the adapter.
6. An adapter for an industrial site according to claim 1, wherein: the plurality of tasks of different priorities further includes a status diagnostic task; the state diagnosis task is used for processing diagnosis services of the operation indicator lamp, the fault indicator lamp and the system indicator lamp.
7. The adapter for an industrial field of claim 1, wherein the adapter connects to an engineer station, the engineer station being deployed with configuration software; the tasks with different priorities further comprise USB communication tasks, wherein the USB communication tasks are used for processing firmware upgrading and configuration services of the configuration software to the adapter; the flow of the USB communication task specifically comprises the following steps:
the adapter analyzes and executes corresponding firmware upgrading operation on the firmware upgrading command based on the firmware upgrading command sent by the configuration software, and realizes the firmware upgrading of the adapter;
the adapter analyzes and executes corresponding configuration operation on the configuration command based on the configuration command sent by the configuration software, so as to realize configuration of the adapter.
8. The adapter for an industrial site of claim 7, wherein: the plurality of tasks with different priorities further comprise a data storage task; the data storage task is used for processing a storage service of the IO module configuration parameters;
the flow of the data storage task specifically comprises the following steps:
the adapter receives a save instruction sent by the configuration software and/or the CAN master station;
and the adapter detects whether the configuration parameters of the IO module change according to the storage instruction, and if so, the adapter updates the configuration parameters of the IO module in an internal IO data storage area.
9. The adapter for an industrial site of claim 8, wherein: the priority of the IO communication task is greater than the priority of the master station communication task, the priority of the USB communication task is greater than the priority of the state diagnosis task, and the priority of the data storage task is greater than the priority of the state diagnosis task.
CN202311404842.9A 2023-10-27 2023-10-27 Adapter for industrial field Active CN117149683B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311404842.9A CN117149683B (en) 2023-10-27 2023-10-27 Adapter for industrial field

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311404842.9A CN117149683B (en) 2023-10-27 2023-10-27 Adapter for industrial field

Publications (2)

Publication Number Publication Date
CN117149683A CN117149683A (en) 2023-12-01
CN117149683B true CN117149683B (en) 2024-02-06

Family

ID=88910412

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311404842.9A Active CN117149683B (en) 2023-10-27 2023-10-27 Adapter for industrial field

Country Status (1)

Country Link
CN (1) CN117149683B (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08214002A (en) * 1994-08-22 1996-08-20 Fujitsu Ltd Connectionless communication system, its test method and intra-station control system
JPH10336077A (en) * 1997-05-30 1998-12-18 Canon Inc Radio communication system
CN1791103A (en) * 2005-10-20 2006-06-21 上海电器科学研究所(集团)有限公司 Field bus communication adapter with configurable characteristic
CN1885674A (en) * 2006-06-01 2006-12-27 上海电器科学研究所(集团)有限公司 Intelligent network low-voltage distribution and control system using bus technique
CN2874933Y (en) * 2005-10-20 2007-02-28 上海电器科学研究所(集团)有限公司 In-site bus equipment communication adaptor with configurable property
CN201095619Y (en) * 2007-09-24 2008-08-06 南京邦耀科技发展有限公司 Full-automatic glass cutting units controlling device based on CAN bus wire technique
CN101442460A (en) * 2008-12-26 2009-05-27 厦门大学 Industry Ethernet adapter
CN105656592A (en) * 2015-12-31 2016-06-08 深圳市汇川技术股份有限公司 Ethercat communication system master station and communication method
CN109725617A (en) * 2018-12-29 2019-05-07 杭州和利时自动化有限公司 A kind of construction method of industrial configuration platform, building system and relevant apparatus
CN111221660A (en) * 2018-11-26 2020-06-02 中兴通讯股份有限公司 Method, apparatus and storage medium for I2C device management in a stacked system
CN114338274A (en) * 2021-12-30 2022-04-12 上海交通大学 Heterogeneous industrial field bus fusion method and system
CN115714797A (en) * 2022-08-26 2023-02-24 上海昭歌信息技术有限公司 Control method of remote IO system of Internet of things
CN116132268A (en) * 2021-11-10 2023-05-16 株洲变流技术国家工程研究中心有限公司 Control method and system for managing multiple nodes based on CANopen master station

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE19934514C5 (en) * 1999-07-22 2013-03-14 Pilz Gmbh & Co. Kg Method for configuring a bus device connected to a fieldbus
US10084869B2 (en) * 2013-10-04 2018-09-25 Verto Analytics Oy Metering user behaviour and engagement with user interface in terminal devices

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08214002A (en) * 1994-08-22 1996-08-20 Fujitsu Ltd Connectionless communication system, its test method and intra-station control system
JPH10336077A (en) * 1997-05-30 1998-12-18 Canon Inc Radio communication system
CN1791103A (en) * 2005-10-20 2006-06-21 上海电器科学研究所(集团)有限公司 Field bus communication adapter with configurable characteristic
CN2874933Y (en) * 2005-10-20 2007-02-28 上海电器科学研究所(集团)有限公司 In-site bus equipment communication adaptor with configurable property
CN1885674A (en) * 2006-06-01 2006-12-27 上海电器科学研究所(集团)有限公司 Intelligent network low-voltage distribution and control system using bus technique
CN201095619Y (en) * 2007-09-24 2008-08-06 南京邦耀科技发展有限公司 Full-automatic glass cutting units controlling device based on CAN bus wire technique
CN101442460A (en) * 2008-12-26 2009-05-27 厦门大学 Industry Ethernet adapter
CN105656592A (en) * 2015-12-31 2016-06-08 深圳市汇川技术股份有限公司 Ethercat communication system master station and communication method
CN111221660A (en) * 2018-11-26 2020-06-02 中兴通讯股份有限公司 Method, apparatus and storage medium for I2C device management in a stacked system
CN109725617A (en) * 2018-12-29 2019-05-07 杭州和利时自动化有限公司 A kind of construction method of industrial configuration platform, building system and relevant apparatus
CN116132268A (en) * 2021-11-10 2023-05-16 株洲变流技术国家工程研究中心有限公司 Control method and system for managing multiple nodes based on CANopen master station
CN114338274A (en) * 2021-12-30 2022-04-12 上海交通大学 Heterogeneous industrial field bus fusion method and system
CN115714797A (en) * 2022-08-26 2023-02-24 上海昭歌信息技术有限公司 Control method of remote IO system of Internet of things

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"基于CANopen协议的分布式控制系统II/O从站设计";孙树文等;《计算机测量与控制》;第15卷(第12期);1705-1707 *

Also Published As

Publication number Publication date
CN117149683A (en) 2023-12-01

Similar Documents

Publication Publication Date Title
US6581101B2 (en) Apparatus for generating and transferring managed device description file
US5740368A (en) Method and apparatus for providing information on a managed peripheral device to plural agents
CN108123842B (en) Adaptive system and method capable of accessing multiple manufacturer devices based on KNX protocol
JP2002268707A (en) Controller and tool, and system constituted of the same
CN2851205Y (en) Elevator monitoring terminal based on embedded processor
CN201345041Y (en) Field data acquisition terminal capable of upgrading programs remotely
CN112216082B (en) Remote electric energy terminal operation and maintenance management system based on Internet of things communication protocol
CN111427602B (en) Method for upgrading firmware on line of intelligent platform management controller of VPX case
US20020141348A1 (en) Remote diagnostic tool for a media delivery network
CN117149683B (en) Adapter for industrial field
CN109542481A (en) A kind of multi-mode Multifunctional tester automatically configures device and method
CN113377701B (en) Serial port control system based on complex programmable logic device CPLD and communication method thereof
CN105137881B (en) Locomotive intelligent display system and method
CN114185824A (en) Modbus response processing method and host device
CN116300780B (en) Component configuration method, device, electronic equipment and storage medium
CN113886317B (en) Method and device for BMC to adapt to multi-platform CPU and storage medium
CN111385300A (en) Method and system for self-adapting of multiple communication protocols of energy storage system
CN216751778U (en) Clock synchronization system
CN214586871U (en) Communication adapter device
CN114859769A (en) Electronic product batch test method based on RTOS
CN113722211A (en) BMC (baseboard management controller) debugging method, device and system and embedded equipment
CN1283029A (en) Remote system diagnosis method
CN113063471A (en) NB-IoT intelligent gas meter based on OpenCPU technology
CN220474118U (en) Data transmission device of gas alarm and gas safety monitoring system
CN114338358B (en) Data interaction method, device, storage medium and PLC

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