Track controller control method, track controller and storage medium
Through the communication between the EtherCAT master station and the track controller, configuration instructions and functional parameters are used to adjust the logic block enable status, which solves the problem of frequent track controller software upgrades and improves the convenience and production efficiency of track control.
Patent Information
- Application Number
- CN202211464207.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-22
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2042-11-22
AI Technical Summary
In automated production, the software program of the production track needs to be frequently upgraded to adapt to the needs of different products, making the control process cumbersome and inconvenient.
Through the communication between the EtherCAT master station and the track controller, configuration instructions and functional parameters are used to determine and modify the enable status of the logic blocks, thereby achieving flexible configuration and control of the track and reducing the frequency of software upgrades.
It achieves the convenience and flexibility of track control, reduces the need for frequent upgrades of track controller programs, and improves production efficiency.
Smart Images

Figure CN115729150B
Abstract
Description
Technical Field
[0001] The present application relates to but is not limited to the field of track control technology, and in particular to a control method of a track controller, a track controller and a storage medium. Background Art
[0002] In automated production, production tracks can usually be used to produce a variety of products. However, the production processes of different products are different, and the structures of the production tracks are different. For example, for the same single track, some products only require a single track for transmission, while other products also require a single track for positioning, etc., which leads to different steps in the production track. Therefore, in the related technology, different software programs are usually loaded for tracks that perform track operations on different products. However, in actual applications, there are changes in production lines or different requirements for tracks for the production of the same product, so the software program of the track controller needs to be upgraded, which makes the control of the track very troublesome. Summary of the invention
[0003] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes a control method of a track controller, a track controller and a storage medium, which can improve the convenience of track control.
[0004] In a first aspect, an embodiment of the present application provides a control method of a track controller, wherein the track controller is communicatively connected to an Ethernet control automation technology EtherCAT master station, and the track controller is used to control a track;
[0005] The method comprises:
[0006] Obtaining a configuration instruction sent by the EtherCAT master station; the configuration instruction includes a track mode and a function parameter;
[0007] According to the track mode, determine a logic block set corresponding to the track operation process; the logic block set includes a first logic block, a second logic block, ... an Nth logic block arranged in sequence, N is an integer greater than 0, the first logic block, the second logic block, ... an Nth logic block respectively correspond to a first track operation, a second track operation, ... an nth track operation, n is an integer greater than 0, and N=n;
[0008] When the functional parameter includes at least one of the first enable state parameter, the second enable state parameter, ... the Nth enable state parameter, modifying the enable state of the corresponding logic block among the first logic block, the second logic block, ... the Nth logic block according to the at least one enable state parameter;
[0009] In response to the operation command sent by the EtherCAT master station, track control is performed according to the enable state of the first logic block, the enable state of the second logic block, ... the enable state of the Nth logic block in the logic block set.
[0010] In a second aspect, an embodiment of the present application provides a track controller, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the control method of the track controller as described in any one of the first aspects is implemented.
[0011] In a third aspect, an embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to implement a control method for a track controller as described in at least any one of the first aspects.
[0012] The above-mentioned embodiments of the present application have at least the following beneficial effects: after obtaining the configuration instruction sent by the EtherCAT master station, according to the track mode in the configuration instruction, determine the logic block set corresponding to the track operation process; when the function parameter includes at least one of the first enable state parameter, the second enable state parameter...the Nth enable state parameter, modify the enable state of the corresponding logic block in the first logic block, the second logic block...the Nth logic block according to at least one enable state parameter; respond to the operation instruction sent by the EtherCAT master station, and control the track according to the enable state of the first logic block, the enable state of the second logic block...the enable state of the Nth logic block in the logic block set in turn. Since the enable state of the corresponding logic block in the logic block set can be modified by the function parameter, the same set of software programs can be loaded for all tracks. When the product's demand for the track changes, only the function parameter sent by the EtherCAT master station needs to be adjusted to complete the configuration change of the track, and there is no need to upgrade the program of the track controller every time the track demand changes. Therefore, compared with the related art, the number of track upgrades is reduced, and the control of the track is more convenient.
[0013] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The present application is further described below with reference to the accompanying drawings and embodiments, wherein:
[0015] Figure 1 This is a schematic diagram of the connection between the EtherCAT master station and the track controller in some embodiments of the present application;
[0016] Figure 2A schematic flow chart of a control method of a track controller according to some embodiments of the present application;
[0017] Figure 3 A schematic flow chart of a control method of a track controller according to some other embodiments of the present application;
[0018] Figure 4 A schematic diagram of an upgrade process in a control method of a track controller in some other embodiments of the present application;
[0019] Figure 5 A schematic diagram of a log processing flow in a control method of a track controller in some other embodiments of the present application;
[0020] Figure 6 This is a hardware diagram of a track controller according to some embodiments of the present application. DETAILED DESCRIPTION
[0021] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.
[0022] In the description of the present application, it should be understood that descriptions involving orientation, such as up, down, front, back, left, right, etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.
[0023] In the description of this application, "several" means more than one, "more" means more than two, "greater than", "less than", "exceed", etc. are understood to exclude the number itself, and "above", "below", "within", etc. are understood to include the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0024] In the description of this application, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in this application based on the specific content of the technical solution.
[0025] In the description of the present application, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0026] In automated production, different software programs are usually loaded for tracks that operate tracks for different products. However, in actual applications, there are situations where production lines are changed or the production of the same product has different requirements for tracks. Every time the production line is changed, the software program of the track controller needs to be upgraded. For tracks that communicate with the EtherCAT protocol, the upgrade loading process is relatively long, and the track needs to be re-tested after the upgrade is completed, so the control of the track is very troublesome. Based on this, the present application proposes a control method for a track controller, a track controller, and a computer-readable storage medium, which can improve the convenience of track control.
[0027] Reference Figure 1 , Figure 1 The figure is a connection diagram of the track controller 110 and the Ethernet for Control Automation Technology (EtherCAT) master station 100. The track controller 110 is an EtherCAT slave station. The track controller 110 is connected to the EtherCAT master station 100 through a bus, and the track controller 110 is used to control the track. It should be noted that EtherCAT is an open architecture, Ethernet-based fieldbus system. EtherCAT is a deterministic industrial Ethernet. EtherCAT uses a full-duplex Ethernet physical layer, and the slave station may have two or more ports. If the device does not detect other devices downstream, the controller of the slave station will automatically close the corresponding port and return the Ethernet frame. Due to the above characteristics, EtherCAT supports almost all network topologies, including bus, tree or star, and the bus topology commonly used in fieldbus can also be used in Ethernet.
[0028] Reference Figure 2 , the present application embodiment provides a control method of a track controller 110, comprising the following steps:
[0029] Step S210, obtaining a configuration instruction sent by the EtherCAT master station; the configuration instruction includes a track mode and function parameters;
[0030] Step S220, determining a logic block set corresponding to the track operation process according to the track mode; the logic block set includes a first logic block, a second logic block, ... an Nth logic block arranged in sequence, N is an integer greater than 0, the first logic block, the second logic block, ... an Nth logic block respectively correspond to a first track operation, a second track operation, ... an nth track operation, n is an integer greater than 0, and N=n;
[0031] Step S230, when the function parameter includes at least one of a first enable state parameter, a second enable state parameter, ... an Nth enable state parameter, modifying the enable state of a corresponding logic block among the first logic block, the second logic block, ... the Nth logic block according to the at least one enable state parameter;
[0032] It should be noted that, in step S220, the 1st track operation, the 2nd track operation...the nth track operation may correspond to the same track operation or to different track operations, that is, any track operation among the 1st track operation, the 2nd track operation...the nth track operation is not limited to which specific track it corresponds to, and is subject to actual track control needs.
[0033] Step S240, responding to the operation command sent by the EtherCAT master station, to perform track control in sequence according to the enable state of the first logic block, the enable state of the second logic block, ... the enable state of the Nth logic block in the logic block set.
[0034] Exemplarily, after obtaining the configuration instruction sent by the EtherCAT master station 100, determine the logic block set corresponding to the track operation process according to the track mode in the configuration instruction; when the function parameter includes at least one enable state parameter among the first enable state parameter, the second enable state parameter...the Nth enable state parameter, modify the enable state of the corresponding logic block among the first logic block, the second logic block...the Nth logic block according to the at least one enable state parameter; respond to the operation instruction sent by the EtherCAT master station 100, and perform track control according to the enable state of the first logic block, the enable state of the second logic block...the Nth logic block in the logic block set in sequence. Since the enabling state of the corresponding logic block in the logic block set can be modified through the function parameters, the same set of software programs can be loaded on all tracks. When the product's demand for the track changes, it is only necessary to adjust the function parameters sent by the EtherCAT master station 100 to complete the configuration change of the track. There is no need to upgrade the program of the track controller every time the track demand changes. Therefore, compared with the related technology, the number of track upgrades is reduced, and the control of the track is more convenient.
[0035] It can be understood that the above steps S210 to S240 include N logical blocks arranged in order in the logical block set, each logical block corresponds to a track operation, and when the function parameter includes the first enable state parameter, the enable state of the corresponding logical block in the logical block set is modified according to the first enable state parameter; responding to the operation instruction sent by the EtherCAT master station, the track is controlled in turn according to the enable state of each logical block in the logical block set, which can reduce the number of track upgrades and make track control more convenient. For the logical block set, for example, if N is equal to 4, the logical block set includes the first logical block, the second logical block, the third logical block and the fourth logical block, which correspond to the first track operation, the second track operation, the third track operation and the fourth track operation, respectively. When the function parameters include the first enable state parameter, the second enable state parameter, the third enable state parameter, and the fourth enable state parameter, the enable state of the corresponding first logic block, the enable state of the second logic block, the enable state of the third logic block, and the enable state of the fourth logic block in the logic block set are modified according to the first enable state parameter, the second enable state parameter, the third enable state parameter, and the fourth enable state parameter; then the track controller 110 responds to the operation instruction sent by the EtherCAT master station to perform track control according to the enable state of the first logic block, the enable state of the second logic block, the enable state of the third logic block, and the enable state of the fourth logic block in the logic block set in sequence, and the specific track control is to execute or not execute the corresponding first track operation, second track operation, third track operation, and fourth track operation.
[0036] It is worth noting that in the embodiment of the present application, the execution process of the track in the production process is decomposed into multiple track operations, each track mode corresponds to a logic block set, each logic block set includes multiple logic blocks arranged in sequence; each logic block corresponds to a track operation, for example, the track operation corresponding to the logic block can be the rotation of the motor. The track operation corresponding to the logic block can also be an enablement selection of the track function, for example, the track operation can be whether to support the docking station function, and when the function parameter includes the first enablement state parameter, the enablement state of the docking station function is modified to enable or disable according to the first enablement state parameter.
[0037] It is worth noting that the track controller 110 and the EtherCAT master station 100 use the Service Data Objects (SDO) communication method, so the track controller 110 and the EtherCAT master station 100 can establish an SDO object dictionary for data exchange. When performing data exchange, the main index, sub-index and data value are obtained by parsing the SDO index, where the main index corresponds to the function block number of the track control, the sub-index corresponds to the sub-function number of each function block in the track control, and the data value represents the specific configuration corresponding to the sub-function. For example, the track controller 110 sets the address of the main index to 0x2000 corresponding to the configuration instruction sent by the EtherCAT master station 100. For example, assuming the index 0x2000:02, 0x2000 represents the configuration instruction, and 02 represents the configured track mode. For another example, in the configuration instruction, the index corresponding to the docking station function is 0x2000:08:1, then the track controller 110 can obtain the function parameter corresponding to the docking station function through the index 0x2000:08:1 as the first enable state parameter, and the value is 1, at this time, the docking station function needs to be enabled; when the index corresponding to the docking station function in the configuration instruction is 0x2000:08:0, the function parameter corresponds to the first enable state parameter, and its value is 0, at this time, the docking station function is disabled. It should be noted that SDO is a specification for using a unified data programming model between different data sources, providing robust support for general application models, making it easier for applications, tools, frameworks, etc. to add, delete, query, modify, constrain, and modify data.
[0038] It is understandable that the track mode is divided by the driving parameters of the track. In some embodiments, the track mode includes two or more of a single-track standard track mode, a double-track standard track mode, a docking station mode, a flip station mode, and a single track plus a return plate mode. In some embodiments, for example, the driving parameters can be parameters of the hardware used on the track, such as the number and model of motors that provide the power for the track transmission. Those skilled in the art can divide the track mode based on the driving parameters of the track according to actual conditions.
[0039] It is understandable that the function parameters may also include the operation parameters of the logic block, and the logic block is configured according to the operation parameters after obtaining the configuration instruction sent by the EtherCAT master station 100. For example, when the track operation corresponding to the logic block is the rotation of the motor, the motor is configured according to the operation parameters, and the operation parameters may be parameters such as the speed, direction, and rotation time of the motor.
[0040] In some embodiments, the control method of the track controller 110 further includes the following steps:
[0041] When the function parameter includes a condition parameter, the condition parameter is associated with at least one of the corresponding first logic block, second logic block, ... Nth logic block in the logic block set.
[0042] By associating the conditional parameters with the corresponding logic blocks in the logic block set, in the process of performing track control according to the enabling status of each logic block in the logic block set, the execution of each logic block not only needs to follow the order in the logic block set, but also needs to be executed according to the corresponding conditional parameters. For example, assume that N is equal to 3, the logic block set includes the first logic block, the second logic block, and the third logic block, the conditional parameters include a first delay time and a second delay time, the first delay time indicates that after the first logic block is executed, the second logic block is executed after waiting for the first delay time, therefore, the first delay time is associated with the first logic block and the second logic block, the second delay time indicates that after the second logic block is executed, the third logic block is executed after waiting for the second delay time, therefore, the second delay time needs to be associated with the second logic block and the third logic block, then in the process of step S240, the track control is first performed according to the enable state of the first logic block, after the execution of the first logic block is completed, the first delay time is waited, and then the track control is started according to the enable state of the second logic block, after the execution of the second logic block is completed, the second delay time is waited, and then the track control is started according to the enable state of the third logic block.
[0043] In some embodiments, the logic blocks in the logic block set corresponding to the single-track standard track mode are arranged in order: docking station function, multi-station mode, board inlet transfer mode selection, docking station function, track vacuum suction, turntable activation, and board outlet transfer mode selection. The function parameters include conditional parameters and a first enabling state parameter. The first enabling state parameter corresponds to each logic block one by one, and the enabling state of the corresponding logic block is modified by the first enabling state parameter; the conditional parameters are associated with the logic block track vacuum suction, and the conditional parameters include a third delay time and an air pressure threshold. Specifically, in response to the operating instruction sent by the EtherCAT master station 100, the track control is first performed according to the enabling state of the docking station function, and then according to the enabling state of the multi-station mode. Track control, then track control is performed according to the enabled state selected by the board entry transfer mode, and then track control is performed again according to the enabled state of the docking station function, and then track control is performed according to the enabled state of track vacuum suction. After the track vacuum suction starts to execute the third delay time, the current air pressure value in the track equipment corresponding to the track vacuum suction is obtained to determine whether the current air pressure value is greater than the air pressure threshold. If the current air pressure value is less than the air pressure threshold, the track vacuum suction is repeated until the current air pressure value is greater than the air pressure threshold; when the current air pressure value is greater than the air pressure threshold, track control is performed according to the enabled state enabled by the turntable, and then track control is performed according to the enabled state selected by the board exit transfer mode. At this point, the track control process of the single-track standard track mode is completed.
[0044] It is understandable that, referring to Figure 3 , step S240 may include the following steps:
[0045] Step S310, according to the running instruction, determining the first enabled logic block in the logic block set as the first execution logic block;
[0046] After executing the first execution logic block, performing conditional parameter judgment processing on the first execution logic block to determine the second execution logic block;
[0047] Step S330 , repeating the condition parameter determination process according to the enable state of the second execution logic block and re-determining the second execution logic block according to the condition parameter determination process result until the second execution logic block does not exist in the logic block set.
[0048] The condition parameter determination process includes the following steps:
[0049] Step S321, when there is a condition corresponding to the first execution logic block in the condition parameter, a conditional operation corresponding to the condition is performed and a second execution logic block is determined according to the result of the conditional operation, wherein the conditional operation includes one of a logic block jump and a logic block execution wait;
[0050] Step S322: when there is no condition corresponding to the first execution logic block in the condition parameter, the next enabled logic block of the current first execution logic block is determined as the second execution logic block.
[0051] For example, the logic blocks included in the logic block set corresponding to a track mode are: vacuum suction loading function, angle adjustment function, processing function, and unloading function; wherein, the vacuum suction loading function has conditional parameters, and the conditional parameters are the preset angle of the material. According to the running instruction, the vacuum suction loading function is determined to be the first execution logic block, and the enabling state of the first execution logic block is enabled. By executing the vacuum suction loading function, the material is sucked, and then it is determined whether the current angle of the material meets the preset angle of the material. When the current angle of the material meets the preset angle of the material, the execution logic block jumps, skips the angle adjustment function, and uses the processing function as the second execution logic block. After the processing process is completed, since the processing function does not have conditional parameters, and the next enabled logic block of the processing function is the unloading function, the second execution logic block is re-determined as the unloading function. After the unloading function is executed, since the unloading function does not have conditional parameters, the second execution logic block no longer exists in the logic block set, and the track control corresponding to the track mode is completed once.
[0052] It is understandable that the control method of the embodiment of the present application further includes the following steps:
[0053] When the function parameter includes an externally associated logic block enable state parameter, an external logic block corresponding to the externally associated logic block enable state parameter is associated with the logic block set, and the external logic block is a logic block that does not belong to the logic block set.
[0054] It should be noted that the first enable state parameter is used to modify the enable state of the corresponding logic block in the logic block set; and the externally associated logic block enable state parameter is used to modify the enable state of the corresponding external logic block. The external logic block is a logic block that does not belong to the logic block set. The track operation corresponding to the external logic block is different from the track operation in the track mode. For example, the external logic block can be set to the functional operation of the external device connected to the track to ensure that the logic block set corresponding to the track mode is a standard general process.
[0055] In some embodiments, the track mode only includes the step flow that is common to this type of track. When there are differentiated functions for this type of track, other logic blocks will be set up separately. The embodiment of the present application can modify the execution steps of the track mode by associating the external logic block corresponding to the enable state parameter of the externally associated logic block with the logic block set. For example, other track operations can be added on the basis of the original execution steps of the track mode to form the needs of different tracks. In this way, the development of the process is simpler and can adapt to more tracks.
[0056] It is understandable that the control method of the track controller 110 of the embodiment of the present application further includes at least one of the following steps:
[0057] Sending track status information to the EtherCAT master station 100;
[0058] or,
[0059] The debugging instruction sent by the EtherCAT master station 100 is obtained, debugging is performed according to the debugging instruction to obtain debugging information, and the debugging information is sent to the EtherCAT master station 100.
[0060] In some embodiments, when the track is controlled by the logic block, the track state information is obtained, and then the track state information is sent to the EtherCAT master station 100, so that the EtherCAT master station 100 can monitor the operation of the track. In other embodiments, the debugging instructions sent by the EtherCAT master station 100 are obtained, and the debugging information is obtained by debugging each logic block according to the debugging instructions, and the debugging information is sent to the EtherCAT master station 100 to determine that each logic block can control the track normally.
[0061] It should be noted that the running instructions, debugging instructions, status information and configuration instructions correspond to a functional block respectively, and all use the same format for sending instructions, such as using SDO indexes, setting the main index, sub-index and data value respectively, to implement the functions of different functional blocks respectively.
[0062] It is understandable that, referring to Figure 4 The control method of the track controller 110 of the embodiment of the present application further includes the following steps:
[0063] Step S410, acquiring multiple upgrade data packets sequentially sent by the EtherCAT master station, each upgrade data packet including a first data length of the upgrade data packet and current progress information corresponding to the upgrade data packet;
[0064] Step S420, detecting the continuity of multiple upgrade data packets according to the current progress information corresponding to each upgrade data packet;
[0065] Step S430, when it is detected that the multiple upgrade data packets are continuous, detecting the second data length of each upgrade data packet;
[0066] Step S440, performing a comparison test based on the first data length and the second data length of each upgrade data packet;
[0067] Step S450 , when it is detected that the first data length and the second data length of each upgrade data packet are equal, performing an upgrade operation according to the multiple upgrade data packets.
[0068] The EtherCAT master station 100 receives the upgrade request instruction sent by the track controller 110, and then sends multiple upgrade data packets to the track controller 110 in sequence, each of which includes the first data length of the upgrade data packet and the current progress information corresponding to the upgrade data packet, so that the track controller 110 determines the integrity of the multiple upgrade data packets according to the first data length and the current progress information to determine whether to perform the upgrade operation. When the track controller 110 determines that the multiple upgrade data packets are incomplete, the upgrade operation is not performed, so as to avoid the track controller 110 being upgraded according to the incomplete upgrade data packet and being unable to start after the upgrade.
[0069] It is worth noting that the current progress information may be the sequence number corresponding to the upgrade data packet. For example, the number of upgrade data packets is 3, and the EtherCAT master station 100 sends 3 upgrade data packets to the track controller 110 in sequence. The current progress information corresponding to the first upgrade data packet is sequence number 1, the current progress information corresponding to the second upgrade data packet is sequence number 2, and the current progress information corresponding to the third upgrade data packet is sequence number 3. After receiving the 3 upgrade data packets, the track controller 110 obtains the corresponding sequence number from each upgrade data packet, and determines whether the received upgrade data packets are continuous according to the sequence number. When the sequence numbers of the received 3 upgrade data packets are not continuous, it means that the file is incomplete, and the upgrade data packet is missing during the data transmission process, and the application of the track controller 110 is not upgraded. In addition, after receiving multiple upgrade data packets, the track controller 110 performs data length detection on each upgrade data packet to obtain the corresponding second data length, and performs comparison detection based on the first data length and the second data length of each upgrade data packet. When it is detected that the first data length and the second data length in any upgrade data packet are not equal, it means that the file is incomplete, the upgrade data packet loses data or an error occurs during the data transmission process, and the application of the track controller 110 is not upgraded.
[0070] It is worth noting that the track controller 110 upgrade refers to the application program of the track controller 110 being upgraded, for example, the application program stored in the flash chip is upgraded. When it is determined that the multiple upgrade data packets are complete, the multiple upgrade data packets are written into the flash chip for upgrading.
[0071] Reference Figure 5 The control method of the track controller 110 of the embodiment of the present application further includes the following steps:
[0072] Step S510, obtaining a log message; wherein the log message is used to record operation information corresponding to the first logic block, the second logic block, ... the Nth logic block;
[0073] Step S520, writing the log message into the buffer area;
[0074] Step S530, periodically detecting the state of the storage unit;
[0075] Step S540: When the storage unit is in an idle state, write the log message of the cache area into the storage unit.
[0076] First, obtain the log message, which is used to record the operation information corresponding to the 1st logic block, the 2nd logic block, ... the Nth logic block, write the log message into the cache area, and detect the state of the storage unit; when it is detected that the storage unit is in an idle state, write all the log messages in the cache area into the storage unit. In the log processing method of the embodiment of the present application, the log message is written into the storage unit only when the storage unit is in an idle state, and all the log messages in the cache are written into the storage unit, which can reduce the operation delay of writing the log message into the storage unit and ensure the real-time performance of the system.
[0077] The track controller 110 is provided with a cache area and a storage unit, and the cache area may be a volatile memory. It should be noted that the full name of the volatile memory RAM is random access memory, which is equivalent to the mobile storage on the PC and is used to store and save data. RAM is usually used as a temporary storage medium for the operating system or other running programs. When it is detected that the storage unit is in an idle state, all log messages in the cache area are written to the storage unit. The storage unit is in an idle state when the system does not obtain data from the storage unit at this time, and the system does not store data in the storage unit at this time, that is, the storage unit does not interact with the system at this time, for example, no log message is written to the storage unit at this time, and the system does not query the log message from the storage unit. In one embodiment, the storage unit may be a flash memory chip, and whenever data is written to the flash memory chip, there is generally a physical delay of the order of 10 to 100 ms, then the storage unit is in an idle state may mean that the storage unit is not in the physical delay period. It should be noted that the above-mentioned storage unit is a flash memory chip, which is only an example and cannot be understood as a limitation of the present application.
[0078] An embodiment of the present application further proposes a track controller, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the control method of the track controller of the first aspect is implemented when the processor executes the computer program.
[0079] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0080] Combine the following Figure 6 The hardware structure of the track controller is described in detail. The track controller includes: a processor 610 , a memory 620 , an input / output interface 630 , a communication interface 640 and a bus 650 .
[0081] The processor 610 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0082] The memory 620 can be implemented in the form of ROM (Read Only Memory), static storage device, dynamic storage device or RAM (Random Access Memory). The memory 620 can store operating systems and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 620, and the processor 610 calls and executes the control method of the embodiments of this application;
[0083] Input / output interface 630, used to implement information input and output;
[0084] The communication interface 640 is used to realize the communication interaction between the present device and other devices, and the communication can be realized by wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.); and the bus 650 is used to transmit information between the various components of the device (such as the processor 610, the memory 620, the input / output interface 630 and the communication interface 640);
[0085] The processor 610 , the memory 620 , the input / output interface 630 , and the communication interface 640 are connected to each other in communication within the device via the bus 650 .
[0086] It can be understood that the present application also provides a computer-readable storage medium storing computer-executable instructions, and the computer-executable instructions are used to implement the control method of the track controller of the first aspect.
[0087] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0088] The embodiments of the present application are described in detail above in conjunction with the accompanying drawings, but the present application is not limited to the above embodiments. Various changes can be made within the knowledge of ordinary technicians in the relevant technical field without departing from the purpose of the present application. In addition, the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
Claims
1. A control method of a track controller, characterized in that: The track controller is connected to the Ethernet control automation technology EtherCAT master station for communication, and the track controller is used to control the track; The method comprises: Obtaining a configuration instruction sent by the EtherCAT master station; the configuration instruction includes a track mode and a function parameter; According to the track mode, determine a logic block set corresponding to the track operation process; the logic block set includes a first logic block, a second logic block, ... an Nth logic block arranged in sequence, N is an integer greater than 0, the first logic block, the second logic block, ... an Nth logic block respectively correspond to a first track operation, a second track operation, ... an nth track operation, n is an integer greater than 0, and N=n; When the functional parameter includes at least one of the first enable state parameter, the second enable state parameter, ... the Nth enable state parameter, modifying the enable state of the corresponding logic block among the first logic block, the second logic block, ... the Nth logic block according to the enable state parameter; In response to the operation command sent by the EtherCAT master station, track control is performed according to the enable state of the first logic block, the enable state of the second logic block, ... the enable state of the Nth logic block in the logic block set.
2. The control method of the track controller according to claim 1, characterized in that: The track modes include two or more of a single-track standard track mode, a double-track standard track mode, a docking station mode, a flip station mode, and a single-track plus return plate mode.
3. The control method of the track controller according to claim 1, characterized in that: The method further comprises: When the function parameter includes a condition parameter, the condition parameter is associated with at least one of the corresponding first logic block, second logic block, ... Nth logic block in the logic block set.
4. The control method of the track controller according to claim 3, characterized in that: The responding to the operation instruction sent by the EtherCAT master station, and performing track control in sequence according to the enabling state of the first logic block, the enabling state of the second logic block, ... the enabling state of the Nth logic block in the logic block set, includes: According to the running instruction, determining a first enabled logic block in the logic block set as a first execution logic block; After executing the first execution logic block, performing conditional parameter judgment processing on the first execution logic block to determine a second execution logic block; According to the enabling state of the second execution logic block, repeatedly performing the condition parameter determination process and re-determining the second execution logic block according to the condition parameter determination process result until the second execution logic block does not exist in the logic block set; The condition parameter determination process includes: When the condition parameter contains a condition corresponding to the first execution logic block, executing a condition operation corresponding to the condition and determining a second execution logic block according to a result of the condition operation, wherein the condition operation includes one of a logic block jump and a logic block execution wait; When the condition corresponding to the first execution logic block does not exist in the condition parameter, a logic block enabled next to the current first execution logic block is determined as a second execution logic block.
5. The control method of the track controller according to claim 1, characterized in that: The method further comprises: When the function parameter includes an externally associated logic block enable state parameter, an external logic block corresponding to the externally associated logic block enable state parameter is associated with the logic block set, and the external logic block is a logic block that does not belong to the logic block set.
6. The control method of the track controller according to claim 1, characterized in that: The method further comprises at least one of the following steps: Sending track status information to the EtherCAT master; or, Acquire a debugging instruction sent by the EtherCAT master station, perform debugging according to the debugging instruction to obtain debugging information, and send the debugging information to the EtherCAT master station.
7. The control method of the track controller according to claim 1, characterized in that: The method further comprises: Acquire multiple upgrade data packets sent in sequence by the EtherCAT master station, each of the upgrade data packets including a first data length of the upgrade data packet and current progress information corresponding to the upgrade data packet; Detecting the continuity of a plurality of the upgrade data packets according to the current progress information corresponding to each of the upgrade data packets; When it is detected that the plurality of upgrade data packets are continuous, detecting the second data length of each of the upgrade data packets; Performing a comparison test based on the first data length and the second data length of each of the upgrade data packets; When it is detected that the first data length and the second data length of each of the upgrade data packets are equal, an upgrade operation is performed according to the multiple upgrade data packets.
8. The control method of the track controller according to claim 1, characterized in that: The method further comprises: Obtaining a log message; wherein the log message is used to record operation information corresponding to the first logic block, the second logic block, ... the Nth logic block; Writing the log message into the buffer area; Periodically detect the state of the storage unit; When the storage unit is in an idle state, the log message of the cache area is written into the storage unit.
9. A track controller, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the control method of the track controller as described in any one of claims 1 to 8 when executing the computer program.
10. A computer-readable storage medium, characterized in that: Computer executable instructions are stored, and the computer executable instructions are used to implement the control method of the track controller as described in at least any one of claims 1 to 8.
