A position-limiting trigger log recording and viewing method, device, equipment and medium

CN116010369BActive Publication Date: 2026-08-11CHANGCHUN TESTING MASCH RES INST
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-06
Publication Date
2026-08-11

AI Technical Summary

Benefits of technology

[0032]由上可知,本申请首先对当前各传感器通道中的传感器数据进行采集,并通过预设日志记录程序将采集到的传感器数据记录至预设缓冲区;监测当前采集到的实时传感器数据是否满足预设触发条件;若满足所述预设触发条件,则进行限位触发,并判断所述预设缓冲区中记录的限位触发后记录的数据量是否达到预设数据量阈值;若达到所述预设数据量阈值,则将当前所述预设缓冲区在所述限位触发之前以及所述限位触发之后记录的传感器数据发送至上位机,以便在所述上位机上对所述限位触发之前以及所述限位触发之后记录的传感器数据进行显示。可见,本申请通过采用下位机与上位机协同方案,对限位触发事件监测、原始数据记录,同时采用限位触发后缓冲区计数方法,等分割限位触发之前与之后数据,这样一来,在试验机系统运行过程中发生限位触发事件后,系统可以根据用户自定义设置,将限位触发时刻前后一段时间段内数据记录下来,供事后查看,分析故障原因,进而帮助操作员调整试验参数,改进试验系统,使得试验在安全稳定的前提下运行。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116010369B_ABST
    Figure CN116010369B_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, device, and medium for recording and viewing limit switch trigger logs, relating to the fields of fatigue testing machines and motion control. The method includes: collecting sensor data from each sensor channel and recording the collected sensor data to a preset buffer; monitoring whether the collected real-time sensor data meets preset trigger conditions; if so, triggering a limit switch and determining whether the amount of data recorded after the limit switch trigger reaches a preset data volume threshold; if so, sending the sensor data recorded in the preset buffer before and after the limit switch trigger to a host computer for display on the host computer. This application records key data important to the limit switch trigger event by displaying the sensor data recorded before and after the limit switch trigger on a host computer, helping operators better identify the cause of the limit switch.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of fatigue testing machines and motion control, and particularly to a method, device, equipment, and medium for recording and viewing limit trigger logs. Background Technology

[0002] In industries such as machinery and materials, the fatigue life of mechanical components and materials is typically tested using a testing machine system. A fatigue testing machine is a machine used to determine the fatigue performance of metals and their alloys under tensile, compressive, or alternating tensile and compressive loads at room temperature. During fatigue testing, the material sample or mechanical component undergoes cyclic waveform motion on the fatigue testing machine. Common cyclic waveforms include sine waves, square waves, triangular waves, and sawtooth waves. Under normal conditions, the actual motion waveform of the mechanical component usually follows the cyclic waveform well within one cycle, meaning the error between the actual motion waveform and the cyclic waveform is within the allowable range. When the testing machine system malfunctions or an unexpected situation occurs, the motion of the mechanical component may deviate from the expected direction, with controlled quantities such as displacement or load exceeding the system's allowable limits. In this case, the testing machine will trigger a limit switch event. After the limit switch is triggered, in most cases, the testing machine will pause the test, cut off the power to the actuator, ensure that the test component is not damaged, and maximize the safety of system operation. After a limit switch trigger event occurs, in order to help test personnel analyze the cause of the limit switch and locate the fault point, certain key data after the limit switch occurred are usually recorded in the form of logs for the operator to view. This helps the operator locate the cause of the fault, and then adjust the test parameters, improve the test system, and ensure that the test runs under safe and stable conditions. Summary of the Invention

[0003] In view of this, the purpose of this invention is to provide a method, apparatus, device, and medium for recording and viewing limit switch trigger logs, which can display sensor data recorded before and after limit switch triggering on a host computer, record key data important to the limit switch triggering event, and help operators better find the cause of the limit switch. The specific solution is as follows:

[0004] Firstly, this application discloses a method for recording and viewing limit trigger logs, applied to a lower-level machine, including:

[0005] The sensor data in each sensor channel is collected, and the collected sensor data is recorded to a preset buffer through a preset log recording program;

[0006] Monitor whether the currently collected real-time sensor data meets the preset trigger conditions;

[0007] If the preset triggering condition is met, a limit trigger is performed, and it is determined whether the amount of data recorded after the limit trigger in the preset buffer reaches the preset data amount threshold.

[0008] If the preset data volume threshold is reached, the sensor data recorded in the current preset buffer before and after the limit trigger is sent to the host computer so that the sensor data recorded before and after the limit trigger can be displayed on the host computer.

[0009] Optionally, before collecting sensor data from each current sensor channel, the method further includes:

[0010] The acquisition control information sent by the host computer, obtained after manually setting the log recording configuration parameters, is used to trigger the step of acquiring sensor data in each current sensor channel based on the acquisition control information; the acquisition control information includes the number of sensor channels, sampling frequency, and sensor channel name during the log recording process.

[0011] Optionally, before recording the collected sensor data to the preset buffer using a preset log recording program, the method further includes:

[0012] The pointer value of the array corresponding to the sensor data is reset to zero, and the length of the preset buffer is set to the target length.

[0013] Optionally, the step of recording the collected sensor data to a preset buffer using a preset logging program includes:

[0014] The preset log recording program records the data collected from each of the sensor channels into the preset buffer, and updates the pointer value of the array corresponding to the sensor data recorded in the preset buffer in real time to obtain the updated pointer value of the array.

[0015] Determine whether the updated pointer value of the array is greater than the target length. If it is, reset the updated pointer value of the array to zero and jump to the step of monitoring whether the currently collected real-time sensor data meets the preset trigger conditions.

[0016] If the value of the current array pointer is not greater than the target length, then jump directly to the step of monitoring whether the currently collected real-time sensor data meets the preset trigger conditions.

[0017] Optionally, the monitoring of whether the currently collected real-time sensor data meets the preset trigger conditions includes:

[0018] The system monitors whether the real-time sensor data collected meets the limit trigger conditions preset by the user using the host computer.

[0019] Optionally, the step of triggering a limit switch if the preset triggering condition is met, and determining whether the amount of data recorded in the preset buffer after the limit switch triggering reaches a preset data amount threshold, includes:

[0020] If the real-time sensor data collected at present meets the preset triggering conditions, a counter for counting the amount of data recorded in the preset buffer after the limit trigger is started, and the amount of data recorded in the preset buffer after the limit trigger is determined based on the counting result of the counter to see if the amount of data recorded in the preset buffer after the limit trigger has reached the preset data amount threshold.

[0021] Optionally, sending the sensor data recorded in the current preset buffer before and after the limit trigger to the host computer, so as to display the sensor data recorded before and after the limit trigger on the host computer, includes:

[0022] The original binary sensor data recorded in the current preset buffer before and after the limit trigger is sent to the host computer, so that the host computer can convert the original binary sensor data into text format for saving, obtain the target log file, and then display the target log file in a preset format.

[0023] Secondly, this application discloses a limit trigger log recording and viewing device, applied to a lower-level machine, comprising:

[0024] The data logging module is used to collect sensor data from each sensor channel and record the collected sensor data to a preset buffer through a preset log recording program.

[0025] The data monitoring module is used to monitor whether the currently collected real-time sensor data meets the preset trigger conditions;

[0026] The data volume judgment module is used to trigger the limit switch if the preset triggering condition is met, and to determine whether the amount of data recorded after the limit switch triggering in the preset buffer reaches the preset data volume threshold.

[0027] The data transmission module is used to send the sensor data recorded in the current preset buffer before and after the limit trigger to the host computer if the preset data volume threshold is reached, so that the sensor data recorded before and after the limit trigger can be displayed on the host computer.

[0028] Thirdly, this application discloses an electronic device, including:

[0029] Memory, used to store computer programs;

[0030] A processor is used to execute the computer program to implement the aforementioned limit trigger log recording and viewing method.

[0031] Fourthly, this application discloses a computer-readable storage medium for storing a computer program, which, when executed by a processor, implements the aforementioned limit trigger log recording and viewing method.

[0032] As can be seen from the above, this application first collects sensor data from each sensor channel and records the collected sensor data to a preset buffer through a preset log recording program; monitors whether the currently collected real-time sensor data meets preset trigger conditions; if the preset trigger conditions are met, a limit trigger is performed, and it is determined whether the amount of data recorded in the preset buffer after the limit trigger reaches a preset data amount threshold; if the preset data amount threshold is reached, the sensor data recorded in the preset buffer before and after the limit trigger is sent to the host computer so that the sensor data recorded before and after the limit trigger can be displayed on the host computer. As can be seen, this application employs a lower-level computer and upper-level computer collaborative scheme to monitor limit trigger events and record raw data. At the same time, it uses a buffer counting method after limit triggering to divide the data before and after the limit trigger. In this way, after a limit trigger event occurs during the operation of the testing machine system, the system can record the data within a certain period before and after the limit trigger moment according to the user's custom settings, so as to review it afterward, analyze the cause of the fault, and help the operator adjust the test parameters and improve the test system, so that the test can run under the premise of safety and stability. Attached Figure Description

[0033] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0034] Figure 1 This application discloses a flowchart of a method for recording and viewing limit trigger logs.

[0035] Figure 2 This is a schematic diagram of a limit trigger log display disclosed in this application;

[0036] Figure 3This is a schematic diagram of a hardware architecture disclosed in this application;

[0037] Figure 4 This is a schematic diagram of a host computer program architecture disclosed in this application;

[0038] Figure 5 This application discloses a flowchart of a host computer polling operation.

[0039] Figure 6 This is a flowchart of a lower-level machine program disclosed in this application;

[0040] Figure 7 This is a schematic diagram of a limit trigger log recording result disclosed in this application;

[0041] Figure 8 This application discloses a flowchart of a specific method for recording and viewing limit trigger logs;

[0042] Figure 9 This is a schematic diagram of a limit trigger log recording and viewing device disclosed in this application;

[0043] Figure 10 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation

[0044] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0045] Existing log data collection methods typically only record the channel where a limit switch trigger event occurred, or the data for that channel after the limit switch trigger moment. This is far from sufficient information for operators to analyze and resolve problems. Key data, more importantly related to the cause of the limit switch trigger event, often appears before the limit switch is triggered.

[0046] See Figure 1 As shown, this embodiment of the invention discloses a method for recording and viewing limit trigger logs, applied to a lower-level machine, including:

[0047] Step S11: Collect sensor data from each sensor channel and record the collected sensor data to a preset buffer using a preset log recording program.

[0048] In this embodiment, before collecting sensor data from each current sensor channel, the method further includes: acquiring acquisition control information sent by the host computer after manually setting log recording configuration parameters, so as to trigger the step of collecting sensor data from each current sensor channel based on the acquisition control information; the acquisition control information includes the number of sensor channels, sampling frequency, and sensor channel name during the log recording process. That is, the user can customize the sensor channels that the system needs to record, can record 1 to 8 channels of data in parallel, and the user can specify the log recording sampling frequency, with a maximum sampling frequency of 25475.5Hz. It should be noted that the hardware part of this application consists of a lower-level controller and upper-level application software. The lower-level controller is responsible for monitoring limit trigger events and recording raw log data. The upper-level application software communicates with the lower-level controller via a USB bus, completes the configuration of log recording parameters, and automatically reads the raw log data after a limit trigger occurs, such as... Figure 2 The limit switch trigger log is displayed graphically. Its hardware architecture diagram is shown below. Figure 3 As shown, the controller's DSP chip is used for data acquisition, and the DSP timer interrupt frequency is 25475.5Hz. This frequency is the maximum sampling frequency for the controller's log recording.

[0049] In this embodiment, after the host computer application software log service module (host computer application software limit trigger log recording and display service logic) is loaded, since the log service module uses a separate message queue to control the program's execution flow, the messages in the message queue are divided into two categories: one is control commands given by the user, and the other is status specifications during program execution. Among these, the log service module defines seven control commands, namely:

[0050] Get:Config: Retrieves log recording configuration parameters; log recording configuration parameters include: number of log recording channels, sampling frequency, and name of log recording sensor channel.

[0051] Get:Status: Gets the logging running status; the logging running status includes: always-enabled flag, enabled flag, logging duration, log file save path, last log file save path, and configuration parameter error flag.

[0052] Set:Refs: Sets control references; The values ​​of controls used by the application software to display numerical values ​​or statuses can be directly modified by the logging business module, provided that the relevant control references are registered in the business module. The controls that need to be set include: log recording configuration parameter change flag, log recording running status change flag, recording in progress flag, and log recording completion flag.

[0053] Set:Config: Sets the logging configuration parameters; the logging configuration parameters include: number of logging channels, sampling frequency, and name of the logging sensor channel.

[0054] Set:Trip Logging Enabled: Sets the start and stop of logging; the data to be operated on by this command includes: always-enabled flag and enable flag.

[0055] Trigger – Set: Config: Sets the limit trigger conditions; the limit trigger conditions include: the channel name that triggers the limit, the trigger value, and the trigger condition (== / != / > / ≥ / < / ≤).

[0056] Trigger – Get:Config: Gets the limit trigger condition; the limit trigger condition includes: the channel name that triggers the limit, the trigger value, and the trigger condition (== / != / > / ≥ / < / ≤).

[0057] During operation, the log service module defines five running states:

[0058] Init: Initialize the log service module.

[0059] Idle: When the log service module is idle, a polling operation is performed.

[0060] Update FP: Updates the front panel display of the application software.

[0061] View Logged Data: The check-in log data viewing window loads the saved log file and displays the data curves.

[0062] Exit: Exit the log service module.

[0063] The log service module follows a message queue-driven architecture, and the program flowchart is as follows: Figure 4As shown. In a specific embodiment, after the host computer application software log service module is loaded, the Init status message is enqueued, and the program executes initialization operations. The initialization operations mainly include: setting the default save location of the log file, enqueuing the Set:Config message, enqueuing the Set:Trip Logging Enabled message, and enqueuing the Trigger-Set:Config message. After the above messages are enqueued, the following commands are executed in sequence: setting the log recording configuration parameter control command, setting the number of log recording channels to 0, the log recording sampling frequency to the default value of 1, and the log recording sensor channel name to empty; setting the log recording start / stop control command, setting the log recording to stop; setting the limit trigger condition control command, setting the limit trigger channel name to empty, the trigger value to the default value of 0, and the trigger condition to the default value ">". That is, the log recording configuration parameters are set manually. After the above control commands are executed, there are no state transition messages or control command messages in the message queue. At this time, the Idle status message is enqueued, and the program executes a polling operation. The flowchart of the polling operation is shown below. Figure 5As shown. During the polling operation, the user customized the log recording configuration. In this example, the user specified the number of channels to be recorded and the names of each sensor channel; specified the log recording sampling frequency; enabled log recording; specified the limit trigger condition. At this time, the corresponding control commands (Set:Config, Set:Trip Logging Enabled, Trigger-Set:Config) were queued and the following commands were executed in sequence: Execute the log recording configuration parameter control command, set the number of log recording channels to 4, set the log recording sampling frequency to 6368Hz, and set the log recording sensor channel names to Model Displacement[1] (1 channel displacement), ModelForce[1] (1 channel load), Model Displacement[2] (2 channel displacement), Model Force[2] (2 channel load); Execute the log recording start and stop control command, set the log recording function to be enabled; Execute the limit trigger condition control command, set the limit trigger channel name to Model Displacement[1] (1 channel displacement), set the trigger value to 50, and set the trigger condition to "≥", that is, when the displacement of 1 channel reaches or exceeds 50mm, the limit trigger event occurs. Existing log data acquisition methods are often designed for a specific application logic. The connection between the log data acquisition module and the log data is fixed after the design is completed; that is, the number of sensor channels recorded is fixed. Some designs only record specific channels, failing to support parallel recording of multi-channel data, and further lacking the flexibility to configure specific channels of interest to different users within the software. The method proposed in this application allows users to customize log recording configuration information, including specifying the log recording sampling frequency and the names of the sensor channels to be recorded in parallel, with a maximum of 8 channels of data recorded in parallel.

[0064] After the above control commands are executed, there are no state transition messages or control command messages in the message queue. At this time, the Idle state message is enqueued, and the program re-executes the polling operation. In this way, the lower-level controller can obtain the acquisition control information sent by the upper-level controller after manually setting the log recording configuration parameters, so as to trigger the step of acquiring sensor data from each current sensor channel based on the acquisition control information. Simultaneously, before recording the acquired sensor data to the preset buffer through the preset log recording program, the process includes: resetting the pointer value of the array corresponding to the sensor data to zero, and setting the length of the preset buffer to a target length. This target length is 65536. That is, before the controller program starts the trip log recording function each time, the initialization process needs to be performed as follows: resetting the limit trigger log completion flag to 0; resetting the array pointer to 0; and setting the buffer length to 65536.

[0065] Step S12: Monitor whether the currently collected real-time sensor data meets the preset trigger conditions.

[0066] In this embodiment, after the collected sensor data is recorded to a preset buffer through a preset log recording program, it is necessary to monitor whether the currently collected real-time sensor data meets preset trigger conditions. This is done by monitoring whether the currently collected real-time sensor data meets the limit trigger conditions preset by the user using the host computer. That is, whether a limit trigger event has occurred. In a specific embodiment, the user can set the trigger value to 50 and the trigger condition to "≥" via the host computer, and then monitor whether the currently collected real-time sensor data meets the condition of being greater than or equal to 50.

[0067] Step S13: If the preset triggering condition is met, then limit triggering is performed, and it is determined whether the amount of data recorded after limit triggering in the preset buffer reaches the preset data amount threshold.

[0068] In this embodiment, if the currently collected real-time sensor data meets the preset triggering conditions, such as Figure 6 As shown, a counter is started to count the amount of data recorded in the preset buffer after the limit switch is triggered. Based on the counter's count, it is determined whether the amount of data recorded in the preset buffer after the limit switch trigger has reached the preset data threshold. That is, the counter is incremented by 1 for each piece of data recorded, and then the counter's count is used to determine whether the amount of data recorded in the preset buffer after the limit switch trigger has reached half of the preset buffer target length, i.e., 32768 data points.

[0069] Step S14: If the preset data volume threshold is reached, the sensor data recorded in the current preset buffer before and after the limit trigger is sent to the host computer so that the sensor data recorded before and after the limit trigger can be displayed on the host computer.

[0070] In this embodiment, if the preset data volume threshold is reached, the completion flag is set to 1, and the interrupt ends. At this time, the underlying array, i.e., the preset buffer, stores 32,768 sensor data points before and after the limit trigger. The original binary sensor data recorded in the current preset buffer before and after the limit trigger is sent to the host computer, so that the host computer can convert the original binary sensor data into text format for saving, obtaining a target log file, and then displaying the target log file in a preset format.

[0071] It should be noted that during the polling operation of the host computer application software, since the user no longer modifies the log recording parameters, the log recording completion flag of the lower computer controller is polled by the program. When the limit trigger event occurs, the completion flag is kept at 0. In this state, no new messages are enqueued for the polling operation, and the program continues the polling operation until the limit trigger event occurs. When the host computer application software finds that the limit trigger completion flag is valid, it obtains the original data of the buffer from the bottom layer. In a specific embodiment, at a certain moment, the Model Displacement[1] channel sensor measures displacement data = 50.029mm. At this time, the trigger condition set by the user (≥50mm) is met, the limit trigger event occurs, and the controller program continuously increments the counter by 1. If the counter value = buffer length / 2, the completion flag is set to 1. During the polling process of the host computer, the completion flag bit is found to be 1, and then the following operations are performed: read the controller log recording buffer to obtain the original binary data; convert the read binary recording data into text format, write it to the log file according to the specified file path and save it; clear the controller completion flag bit to 0, that is, reset the next log recording condition; enqueue the View Logged Data state; after the above operations are completed, there is a status message View Logged Data in the message queue, and the program jumps to the View Logged Data state. This state will open the log data viewing window, load the saved log recording file, and display the log recording data in the form of a curve. In this example, when the Model Displacement[1] value is 50.276, the limit trigger condition is met. The log records show the running data of the specified sensor channel within 1.28s before and 1.28s after the limit trigger. The log recording results are as follows. Figure 7 As shown. In this way, log recording and viewing adopt a collaborative solution between the lower-level controller and the upper-level application software. Tasks with relatively simple functions but very high real-time requirements, such as limit switch trigger event monitoring and raw data recording, are executed in the lower-level controller. Tasks with more cumbersome operations and lower real-time requirements, such as parsing user settings, reading raw record data, and viewing data, are executed in the upper-level application software. This design is more reasonable. The controller's underlying business logic uses a buffer counting method after limit switch triggering, equally dividing the data before and after the limit switch trigger, which is a key point in the controller's business logic. The message queue-driven architecture of the upper-level application software ensures that the execution of various tasks does not conflict, thus avoiding race conditions when calling the same interface, reducing the system overhead of the log business module, and improving the system's execution efficiency. When a limit switch is triggered, the software can automatically acquire and display data from each channel, distinguishing them with different colors, and highlighting the trigger time and trigger channel, providing a better user experience.

[0072] As can be seen from the above, this application first collects sensor data from each sensor channel and records the collected sensor data to a preset buffer through a preset log recording program; monitors whether the currently collected real-time sensor data meets preset trigger conditions; if the preset trigger conditions are met, a limit trigger is performed, and it is determined whether the amount of data recorded in the preset buffer after the limit trigger reaches a preset data amount threshold; if the preset data amount threshold is reached, the sensor data recorded in the preset buffer before and after the limit trigger is sent to the host computer so that the sensor data recorded before and after the limit trigger can be displayed on the host computer. As can be seen, this application employs a lower-level computer and upper-level computer collaborative scheme to monitor limit trigger events and record raw data. At the same time, it uses a buffer counting method after limit triggering to divide the data before and after the limit trigger. In this way, after a limit trigger event occurs during the operation of the testing machine system, the system can record the data within a certain period before and after the limit trigger moment according to the user's custom settings, so as to review it afterward, analyze the cause of the fault, and help the operator adjust the test parameters and improve the test system, so that the test can run under the premise of safety and stability.

[0073] See Figure 8 As shown, this embodiment of the invention discloses a specific method for recording and viewing limit trigger logs, applied to a lower-level machine, including:

[0074] Step S21: Collect sensor data from each sensor channel.

[0075] Step S22: Record the data collected from each of the sensor channels into a preset buffer using a preset log recording program, and update the pointer value of the array corresponding to the sensor data recorded in the preset buffer in real time to obtain the updated pointer value of the array.

[0076] In this embodiment, as Figure 6 As shown, when the lower-level controller starts running the trip log recording program, it first checks whether the current limit switch trigger flag is 1. If it is, the interrupt ends; otherwise, it records the current value of the specified channel n at array p. Then, channel = channel + 1. If the current channel is not equal to the specified number of channels, it jumps to record the current value of the specified channel n at array p until the current channel equals the specified number of channels. This allows the data of each sensor channel to be recorded. Afterwards, the pointer value of the array corresponding to the sensor data recorded in the preset buffer is updated in real time to obtain the updated pointer value of the array.

[0077] Step S23: Determine whether the updated pointer value of the array is greater than the target length. If it is, reset the updated pointer value of the array to zero and jump to the step of monitoring whether the currently collected real-time sensor data meets the preset trigger conditions.

[0078] In this embodiment, the pointer value of the array is incremented by 1. Then, it is determined whether the updated pointer value of the array is greater than the target length. If it is, the pointer value of the updated array is reset to zero, and the process jumps to the step of monitoring whether the currently collected real-time sensor data meets the preset trigger conditions. In this way, the data stored in the buffer can be updated in real time, and the old data can be replaced with the new data in a timely manner.

[0079] Step S24: If the value of the current array pointer is not greater than the target length, then directly jump to the step of monitoring whether the currently collected real-time sensor data meets the preset trigger conditions.

[0080] In this embodiment, if the value of the current array pointer is not greater than the length of the preset buffer, the next step is to determine whether a limit trigger event has occurred. It is understood that the data stored in the current buffer is the data from the 32768 sensors prior to the trigger.

[0081] As can be seen from the above, after a limit switch trigger event occurs during the operation of the testing machine system, the system can record the channel of the limit switch trigger and the data after the trigger time according to the user-defined settings, and also record the data before the limit switch trigger time, which is convenient for the operator to analyze the cause of the problem and solve the problem.

[0082] See Figure 9 As shown, this application discloses a limit trigger log recording and viewing device, applied to a lower-level machine, comprising:

[0083] The data recording module 11 is used to collect sensor data from each sensor channel and record the collected sensor data to a preset buffer through a preset log recording program.

[0084] The data monitoring module 12 is used to monitor whether the currently collected real-time sensor data meets the preset trigger conditions;

[0085] The data volume judgment module 13 is used to trigger the limit switch if the preset trigger condition is met, and to determine whether the amount of data recorded after the limit switch trigger in the preset buffer reaches the preset data volume threshold.

[0086] The data sending module 14 is used to send the sensor data recorded in the current preset buffer before and after the limit trigger to the host computer if the preset data volume threshold is reached, so that the sensor data recorded before and after the limit trigger can be displayed on the host computer.

[0087] As can be seen from the above, this application first collects sensor data from each sensor channel and records the collected sensor data to a preset buffer through a preset log recording program; monitors whether the currently collected real-time sensor data meets preset trigger conditions; if the preset trigger conditions are met, a limit trigger is performed, and it is determined whether the amount of data recorded in the preset buffer after the limit trigger reaches a preset data amount threshold; if the preset data amount threshold is reached, the sensor data recorded in the preset buffer before and after the limit trigger is sent to the host computer so that the sensor data recorded before and after the limit trigger can be displayed on the host computer. As can be seen, this application employs a lower-level computer and upper-level computer collaborative scheme to monitor limit trigger events and record raw data. At the same time, it uses a buffer counting method after limit triggering to divide the data before and after the limit trigger. In this way, after a limit trigger event occurs during the operation of the testing machine system, the system can record the data within a certain period before and after the limit trigger moment according to the user's custom settings, so as to review it afterward, analyze the cause of the fault, and help the operator adjust the test parameters and improve the test system, so that the test can run under the premise of safety and stability.

[0088] In some specific embodiments, the data recording module 11 may include:

[0089] The pointer value update unit is used to record the data of each sensor channel collected by the preset log recording program into the preset buffer, and to update the pointer value of the array corresponding to the sensor data recorded in the preset buffer in real time, so as to obtain the updated pointer value of the array.

[0090] The first jump unit is used to determine whether the pointer value of the updated array is greater than the target length. If it is greater, the pointer value of the updated array is reset to zero, and the jump is made to the step of monitoring whether the real-time sensor data currently collected meets the preset trigger conditions.

[0091] The second jump unit is used to directly jump to the step of monitoring whether the currently collected real-time sensor data meets the preset trigger conditions if the value of the current array pointer is not greater than the target length.

[0092] In some specific embodiments, the data recording module 11 may further include:

[0093] The control information acquisition unit is used to acquire the acquisition control information sent by the host computer after the log recording configuration parameters are manually set, so as to trigger the step of acquiring sensor data in each current sensor channel based on the acquisition control information; the acquisition control information includes the number of sensor channels, sampling frequency and sensor channel name during the log recording process.

[0094] The length setting unit is used to reset the pointer value of the array corresponding to the sensor data to zero and set the length of the preset buffer to the target length.

[0095] In some specific embodiments, the data monitoring module 12 may include:

[0096] The data monitoring module is used to monitor whether the real-time sensor data currently collected meets the limit trigger conditions preset by the user using the host computer.

[0097] In some specific embodiments, the data volume determination module 13 may include:

[0098] The data volume judgment unit is used to start a counter for counting the amount of data recorded in the preset buffer after the limit trigger if the currently collected real-time sensor data meets the preset trigger conditions, and to determine whether the amount of data recorded in the preset buffer after the limit trigger reaches the preset data volume threshold based on the counting result of the counter.

[0099] In some specific embodiments, the data sending module 14 may include:

[0100] The data sending unit is used to send the raw binary sensor data recorded in the current preset buffer before and after the limit trigger to the host computer, so that the host computer can convert the raw binary sensor data into text format for saving, obtain a target log file, and then display the target log file in a preset format.

[0101] Furthermore, embodiments of this application also disclose an electronic device, Figure 10 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.

[0102] Figure 10This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the limit trigger log recording and viewing method disclosed in any of the foregoing embodiments. Alternatively, the electronic device 20 in this embodiment may specifically be a computer.

[0103] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0104] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0105] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the limit trigger log recording and viewing method disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program capable of performing other specific tasks.

[0106] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned limit trigger log recording and viewing method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.

[0107] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0108] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0109] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0110] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0111] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for recording and viewing limit trigger logs, characterized in that, Applied to a lower-level machine, which works in conjunction with a higher-level machine, including: Sensor data from each sensor channel is collected, and the collected sensor data is recorded to a preset buffer using a preset log recording program; the length of the preset buffer is the target length. Monitor whether the real-time sensor data collected meets the limit trigger conditions preset by the user using the host computer; If the limit trigger condition is met, a limit trigger is performed, and a counter for counting the amount of data after the trigger is started. After the limit trigger, subsequent sensor data is recorded in the preset buffer, and the counter counts the amount of data recorded after the trigger. Based on the counter's count result, it is determined whether the amount of data recorded in the preset buffer after the limit trigger reaches a preset data amount threshold. The preset data amount threshold is half the target length of the preset buffer. If the preset data volume threshold is reached, the sensor data recorded in the current preset buffer before and after the limit trigger is sent to the host computer so that the sensor data recorded before and after the limit trigger can be displayed on the host computer. Before collecting sensor data from each current sensor channel, the process also includes: The system acquires acquisition control information sent by the host computer after manually setting the log recording configuration parameters, so as to trigger the step of acquiring sensor data in each current sensor channel based on the acquisition control information; the acquisition control information includes the number of sensor channels, sampling frequency, and sensor channel name during the log recording process; If the limit trigger condition is met, a limit trigger is performed, and it is determined whether the amount of data recorded in the preset buffer after the limit trigger reaches a preset data amount threshold, including: If the real-time sensor data collected at present meets the limit trigger condition, a counter for counting the amount of data recorded in the preset buffer after the limit trigger is started, and the amount of data recorded in the preset buffer after the limit trigger is determined based on the counting result of the counter to see if the amount of data recorded in the preset buffer after the limit trigger has reached the preset data amount threshold. Before recording the collected sensor data to the preset buffer through the preset log recording program, the method further includes: Reset the pointer value of the array corresponding to the sensor data to zero, and set the length of the preset buffer to the target length; The step of recording the collected sensor data into a preset buffer through a preset log recording program includes: The preset log recording program records the data collected from each of the sensor channels into the preset buffer, and updates the pointer value of the array corresponding to the sensor data recorded in the preset buffer in real time to obtain the updated pointer value of the array. Determine whether the updated pointer value of the array is greater than the target length. If it is, reset the updated pointer value of the array to zero and jump to the step of monitoring whether the currently collected real-time sensor data meets the limit trigger condition. If the current array pointer value is not greater than the target length, then jump directly to the step of monitoring whether the currently collected real-time sensor data meets the limit trigger condition.

2. The method for recording and viewing limit trigger logs according to claim 1, characterized in that, The step of sending the sensor data recorded in the current preset buffer before and after the limit trigger to the host computer, so as to display the sensor data recorded before and after the limit trigger on the host computer, includes: The original binary sensor data recorded in the current preset buffer before and after the limit trigger is sent to the host computer, so that the host computer can convert the original binary sensor data into text format for saving, obtain the target log file, and then display the target log file in a preset format.

3. A limit trigger log recording and viewing device, characterized in that, Applied to a lower-level machine, which works in conjunction with a higher-level machine, including: The data logging module is used to collect sensor data from each sensor channel and record the collected sensor data to a preset buffer through a preset log recording program; the length of the preset buffer is set to a target length. The data monitoring module is used to monitor whether the real-time sensor data collected meets the limit trigger conditions preset by the user using the host computer. The data volume judgment module is used to trigger a limit switch if the limit switch triggering condition is met, and to start a counter for counting the amount of data after the trigger. After the limit switch is triggered, subsequent sensor data is recorded in the preset buffer, and the counter counts the amount of data recorded after the trigger. Based on the counter's count result, it is determined whether the amount of data recorded in the preset buffer after the limit switch trigger has reached a preset data volume threshold. The preset data volume threshold is half the target length of the preset buffer. The data transmission module is used to send the sensor data recorded in the current preset buffer before and after the limit trigger to the host computer if the preset data volume threshold is reached, so that the sensor data recorded before and after the limit trigger can be displayed on the host computer. The device is also used to acquire acquisition control information sent by the host computer after manually setting the log recording configuration parameters, so as to trigger the step of acquiring sensor data in each current sensor channel based on the acquisition control information; the acquisition control information includes the number of sensor channels, sampling frequency and sensor channel name during the log recording process; The data volume judgment module is used to start a counter for counting the amount of data recorded in the preset buffer after the limit trigger if the currently collected real-time sensor data meets the limit trigger condition, and to determine whether the amount of data recorded in the preset buffer after the limit trigger reaches the preset data volume threshold based on the counting result of the counter. The device is also used to reset the pointer value of the array corresponding to the sensor data to zero, and set the length of the preset buffer to the target length; The data recording module is used to record the data collected from each of the sensor channels into the preset buffer through the preset log recording program, and to update the pointer value of the array corresponding to the sensor data recorded in the preset buffer in real time to obtain the updated pointer value of the array; to determine whether the updated pointer value of the array is greater than the target length; if it is greater, the updated pointer value of the array is reset to zero, and the process jumps to the step of monitoring whether the currently collected real-time sensor data meets the limit trigger condition; if the current array pointer value is not greater than the target length, the process jumps directly to the step of monitoring whether the currently collected real-time sensor data meets the limit trigger condition.

4. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the limit trigger log recording and viewing method as described in claim 1 or 2.

5. A computer-readable storage medium, characterized in that, Used to store computer programs, which, when executed by a processor, implement the limit trigger log recording and viewing method as described in claim 1 or 2.

Citation Information

Patent Citations

  • Distributed safety protection system aiming at super-power water-cooled magnets

    CN106919165A

  • Data processing method and device

    CN111860251A