An adaptive instruction configuration method for instrument and meter production line
Patent Information
- Application Number
- CN202610945644.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-29
- Publication Date
- 2026-10-30
AI Technical Summary
[0005]本申请的主要目的在于提供一种面向仪器仪表产线的自适应指令配置方法、装置、介质和设备,旨在解决现有技术中,仪器仪表产线测试系统在通信通道配置方面依赖人工绑定、在指令执行方面缺乏弹性处理机制的问题
[0017]本申请公开了一种面向仪器仪表产线的自适应指令配置方法,包括:构建并存储分层级的配置信息库,配置信息库包含多种仪器仪表各自对应的设备型号信息、各设备型号下的至少一个子系统信息、每个子系统信息所关联的测试指令集、以及与测试指令集关联的通道标签和等待策略;其中,通道标签为语义化标识符,用于抽象表示该子系统所需的物理通信通道类型;等待策略至少包含最大等待时间和超时动作类型;获取当前被测仪表的设备型号以及待测试的目标子系统;根据设备型号和目标子系统,从配置信息库中提取出对应的目标指令集、目标通道标签和目标等待策略;根据目标通道标签,在预设的动态映射表中查询并解析出对应的目标VISA资源地址;根据目标VISA资源地址,自动调用VISA库函数建立与被测仪表的VISA会话,并将该VISA会话与目标指令集中的所有指令进行绑定;按预设顺序依次执行目标指令集中的指令,针对每一条指令执行以下处理:通过已绑定的VISA会话发送当前指令;启动与当前指令对应的目标等待策略,监测VISA接收缓冲区状态;若在最大等待时间内接收到完整的响应数据,则对响应数据进行处理并继续执行下一条指令;若超过最大等待时间仍未接收到完整的响应数据,则执行超时动作类型所定义的操作。本申请具有以下技术效果:通信通道的自适应绑定:通过引入语义化的通道标签和动态映射表,将指令集与物理通信地址完全解耦。当硬件接口变更时,仅需修改映射表而无需触碰指令集本身,大幅降低了维护成本和人为出错风险。指令执行的弹性处理:通过为每条指令配置独立的等待策略,并在超时时支持自动跳转至下一条指令,避免了因个别指令通信异常导致整个测试流程阻塞卡死的问题,保障了产线的节拍可控性和无人值守能力。多级索引的柔性配置:通过“设备型号→子系统→指令集”的多级分层结构,实现了按最小测试单元自适应加载指令,比现有的一维查找表方案具有更高的配置灵活性和复用性。异常可追溯:每次超时跳转均生成带时间戳的通道异常记录,便于后续故障分析和持续优化。
Smart Images

Figure CN123010388A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automated testing and data processing technology, specifically to an adaptive instruction configuration method, testing system, and electronic equipment for instrument production lines. Background Technology
[0002] In the production process of instruments and meters, automated testing is a key link in ensuring product quality. Traditional production line testing systems typically hard-code test instructions, communication parameters, and decision logic into the test program. When the model of the instrument under test or the testing requirements change, test engineers need to manually modify the program code, reconfigure the communication parameters, and recompile and deploy, resulting in long changeover times, high labor costs, and susceptibility to test anomalies due to human error.
[0003] In existing technologies, some solutions attempt to manage test commands through configuration files. For example, a static configuration file stores the mapping between instrument models and command sets, and during testing, the corresponding command is looked up and sent based on the instrument model. However, this type of solution has at least the following shortcomings: The rigid binding of communication channels and commands: Existing solutions typically hardcode the communication address into the command configuration, or require manual specification of communication parameters for each test command. When the physical interface of the test instrument changes (e.g., from USB to Ethernet), the configuration of all related commands needs to be modified one by one, resulting in a large maintenance workload and a high risk of errors.
[0004] The instruction execution process lacks flexibility: existing solutions typically employ fixed waiting times or simple timeout error mechanisms when executing instructions. If the instrument fails to respond promptly due to unforeseen circumstances, it can lead to misjudgments of the current test item, or even block and freeze the entire testing process, severely impacting the controllability of the production line's cycle time and unattended operation capabilities. Therefore, there is an urgent need for a test configuration method and system that can achieve adaptive binding of communication channels and possess flexible instruction execution capabilities. Summary of the Invention
[0005] The main objective of this application is to provide an adaptive instruction configuration method, apparatus, medium, and equipment for instrumentation production lines, aiming to solve the problems in the prior art where instrumentation production line testing systems rely on manual binding for communication channel configuration and lack flexible processing mechanisms for instruction execution.
[0006] This application discloses an adaptive instruction configuration method, testing system, electronic device, and storage medium for instrumentation production lines, aiming to solve the technical problems in the prior art where instrumentation production line testing systems rely on manual binding in terms of communication channel configuration and lack flexible processing mechanisms in terms of instruction execution.
[0007] To achieve the above objectives, the first aspect of this application provides an adaptive instruction configuration method for instrumentation production lines, comprising the following steps: A hierarchical configuration information database is constructed and stored. The configuration information database includes equipment model information corresponding to various instruments and meters, information on at least one subsystem under each equipment model, test instruction sets associated with each subsystem, and channel labels and waiting policies associated with the test instruction sets. The channel labels are semantic identifiers used to abstractly represent the physical communication channel type required by the subsystem. The waiting policies include at least the maximum waiting time and timeout action type. Obtain the device model of the instrument under test and the target subsystem to be tested; Based on the device model and target subsystem, extract the corresponding target instruction set, target channel label, and target waiting strategy from the configuration information database; Based on the target channel label, the corresponding target VISA resource address is queried and parsed from the preset dynamic mapping table; Based on the target VISA resource address, automatically call the VISA library function to establish a VISA session with the instrument under test, and bind the VISA session with all instructions in the target instruction set; The instructions in the target instruction set are executed sequentially according to a preset order. For each instruction, the following processing is performed: the current instruction is sent through the bound VISA session; the target waiting policy corresponding to the current instruction is activated, and the VISA receive buffer status is monitored; if complete response data is received within the maximum waiting time, the response data is processed and the next instruction is executed; if complete response data is not received after the maximum waiting time, the operation defined by the timeout action type is executed.
[0008] Optionally, the timeout action type includes jumping to the next instruction; when the jump is executed, the waiting state of the current instruction is forcibly interrupted, the VISA library function is called to clear the VISA receive buffer, and the execution is automatically jumped to the next instruction in the target instruction set.
[0009] Optionally, when performing the jump, a channel exception record with a timestamp is also generated. The channel exception record includes the current instruction identifier, the target channel label, and the timeout reason, which is used for subsequent fault tracing and analysis.
[0010] Optionally, when the instructions in the target instruction set contain dynamic parameter placeholders, the dynamic parameter placeholders are filled in in conjunction with the current test environment variables to generate complete executable instructions before being sent through the VISA session.
[0011] Optionally, the dynamic mapping table is an editable configuration table. When the physical communication interface of the instrument under test changes, the communication channel adaptation is achieved by modifying the correspondence between the channel label and the VISA resource address in the dynamic mapping table, without modifying the test instruction set content in the configuration information base.
[0012] Optionally, the specific method for monitoring the VISA receive buffer status is as follows: the VISA library function is called at a preset polling interval to query the instrument status register, and when the operation completion flag is detected, the complete response data in the VISA receive buffer is read.
[0013] Optionally, the device model can be automatically obtained by scanning the barcode or RFID tag on the instrument under test, or automatically specified by the production order data issued by the manufacturing execution system.
[0014] Optionally, when any instruction times out and jumps, a summary test report is generated after all instructions in the target instruction set have been executed. The summary test report marks the instruction item that timed out and jumps and the corresponding channel information.
[0015] To achieve the above objectives, a second aspect of this application also provides an adaptive instruction configuration testing system for instrumentation production lines, comprising: The configuration information database module is used to store hierarchical configuration information, including the correspondence between device model, subsystem, test command set, channel label and waiting strategy; The dynamic mapping table module is used to store the mapping relationship between channel labels and VISA resource addresses; The test task acquisition module is used to acquire the device model of the instrument under test and the target subsystem to be tested; An adaptive matching module is used to extract target instruction sets, target channel tags, and target waiting strategies from the configuration information database based on the device model and target subsystem. The channel binding module is used to parse the target VISA resource address from the dynamic mapping table according to the target channel label, automatically call the VISA library function to establish a VISA session, and bind the VISA session to the target instruction set; The instruction execution and arbitration module is used to send instructions sequentially through the VISA session, monitor the VISA receive buffer status according to the waiting policy, and execute the operation defined by the timeout action type when a timeout occurs.
[0016] To achieve the above objectives, a third aspect of this application also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to execute the adaptive instruction configuration method for instrumentation production lines as provided above.
[0017] This application discloses an adaptive instruction configuration method for instrumentation production lines, comprising: constructing and storing a hierarchical configuration information database, wherein the configuration information database contains equipment model information corresponding to various instruments, at least one subsystem information under each equipment model, test instruction sets associated with each subsystem, and channel labels and waiting strategies associated with the test instruction sets; wherein, the channel label is a semantic identifier used to abstractly represent the physical communication channel type required by the subsystem; the waiting strategy includes at least the maximum waiting time and timeout action type; obtaining the equipment model of the instrument under test and the target subsystem to be tested; extracting the corresponding target instruction set, target channel label, and target waiting strategy from the configuration information database according to the equipment model and target subsystem; and according to the target channel label, extracting the target channel label, target channel label, and target waiting strategy from the configuration information database; and extracting the target channel label, target channel label, and target waiting strategy according to the target channel label. The system uses channel tags to query and parse the corresponding target VISA resource address from a preset dynamic mapping table. Based on the target VISA resource address, it automatically calls VISA library functions to establish a VISA session with the instrument under test and binds this VISA session to all instructions in the target instruction set. Instructions in the target instruction set are executed sequentially in a preset order, and for each instruction, the following processing is performed: the current instruction is sent through the bound VISA session; the target waiting strategy corresponding to the current instruction is activated, and the VISA receive buffer status is monitored; if complete response data is received within the maximum waiting time, the response data is processed and the next instruction is executed; if complete response data is not received after the maximum waiting time, the operation defined by the timeout action type is executed. This application has the following technical effects: Adaptive binding of communication channels: By introducing semantic channel tags and a dynamic mapping table, the instruction set and physical communication address are completely decoupled. When the hardware interface changes, only the mapping table needs to be modified without touching the instruction set itself, significantly reducing maintenance costs and the risk of human error. Flexible instruction execution: By configuring independent waiting strategies for each instruction and supporting automatic jump to the next instruction upon timeout, the problem of the entire testing process being blocked due to communication anomalies of individual instructions is avoided, ensuring the controllability of the production line's cycle time and unattended operation capabilities. Flexible configuration of multi-level indexes: Through a multi-level hierarchical structure of "device model → subsystem → instruction set," instructions are adaptively loaded according to the smallest test unit, offering higher configuration flexibility and reusability than existing one-dimensional lookup table solutions. Traceable anomalies: Each timeout jump generates a channel anomaly record with a timestamp, facilitating subsequent fault analysis and continuous optimization. Attached Figure Description
[0018] Figure 1 A flowchart illustrating an adaptive instruction configuration method for an instrumentation production line provided in this application embodiment; Figure 2 This application provides a schematic diagram of a hierarchical structure of a configuration information database. Figure 3 This is a schematic diagram of a sub-process for instruction execution and timeout arbitration provided in an embodiment of this application.
[0019] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0020] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0021] Explanation of key terms: Configuration Information Base: Used to store the equipment model information corresponding to various instruments and meters, information on at least one subsystem under each equipment model, the test instruction set associated with each subsystem, and a hierarchical data set of channel labels and waiting strategies associated with the test instruction set.
[0022] Channel label: A semantic identifier used to abstractly represent the type of physical communication channel required by the subsystem, and does not directly depend on a specific VISA address.
[0023] Waiting strategy: A set of strategies containing fields such as maximum waiting time, polling interval, and timeout action type, used to control the response monitoring and timeout handling logic during instruction execution.
[0024] Dynamic mapping table: An editable configuration table used to maintain the correspondence between channel labels and actual VISA resource addresses, which can be dynamically modified when the physical communication interface changes.
[0025] Target VISA resource address: The specific physical communication address used to establish a VISA session with the instrument under test, which is obtained by querying and resolving the target channel label in the dynamic mapping table.
[0026] VISA Session: A communication connection handle established by calling VISA library functions based on the target VISA resource address, used for sending commands and receiving responses with the instrument under test.
[0027] Timeout Action Type: Defines the action to be taken when a complete response is not received after the instruction has been executed for longer than the maximum waiting time, including jumping to the next instruction or terminating the test.
[0028] In the production process of instruments and meters, automated testing is a key link in ensuring product quality. Traditional production line testing systems typically hard-code test commands, communication parameters, and decision logic into the test program. When the model of the instrument under test or the test requirements change, test engineers need to manually modify the program code, reconfigure the communication parameters, and recompile and deploy, resulting in long changeover times, high labor costs, and a high risk of test anomalies due to human error. Existing technologies have attempted to manage test commands through configuration files. For example, a static configuration file stores the correspondence between instrument models and command sets, allowing the corresponding command to be found and sent during testing based on the instrument model. However, this type of solution has at least the following shortcomings: 1. Rigid binding of communication channels and commands: Existing solutions typically hard-write the communication address directly into the command configuration, or require manual specification of communication parameters for each test command. When the physical interface of the test instrument changes (e.g., from USB to Ethernet), the configuration of all related commands needs to be modified one by one, resulting in a large maintenance workload and a high risk of errors. 2. Lack of flexibility in command execution: Existing solutions typically use fixed waiting times or simple timeout error mechanisms when executing commands. If the instrument fails to respond in time due to unforeseen circumstances, it may result in misjudgment of the current test item, or even blockage and shutdown of the entire test process, seriously affecting the controllability of the production line's cycle time and its unattended operation capability.
[0029] refer to Figures 1-3 The first embodiment of this application provides an adaptive instruction configuration method for instrumentation production lines to solve the technical problems mentioned in the background art, such as the reliance on manual binding in communication channel configuration and the lack of flexible processing mechanisms in instruction execution in instrumentation production line testing systems. This method can be executed by a processor, which can be located in a terminal or a server. The execution process of the adaptive instruction configuration method for instrumentation production lines can be as follows: Step s101: Construct and store a hierarchical configuration information database. The configuration information database includes equipment model information corresponding to various instruments and meters, at least one subsystem information under each equipment model, test instruction set associated with each subsystem information, and channel labels and waiting strategies associated with the test instruction set. The channel label is a semantic identifier used to abstractly represent the physical communication channel type required by the subsystem. The waiting strategy includes at least the maximum waiting time and timeout action type.
[0030] In one embodiment of this application, the configuration information database is stored using a structured XML file. This XML file uses the device model as the root node as the first level and the subsystem name as the second level. Each subsystem node contains three parts of information: 1. Instruction Set: Stores complete SCPI or custom protocol instruction frames in list form. For instructions containing dynamic parameters (such as set values), placeholders are used, such as "CAL:VAL %f". 2. Channel Label: A semantic identifier of string type, such as "HART_MODEM_1", "DMM_CH2", or "DC_SOURCE_1". It abstractly represents the communication channel of the test instrument required by the subsystem, without directly depending on the specific VISA address. 3. Waiting Policy: Contains the following fields: maxWaitTime: Maximum waiting time in milliseconds; pollInterval: Polling interval in milliseconds; timeoutAction: Timeout action, with values of "SKIP" (jump to the next item) or "ABORT" (terminate the test).
[0031] Step s102: Obtain the device model of the instrument under test and the target subsystem to be tested.
[0032] In one embodiment of this application, the device model is automatically obtained by scanning the barcode or RFID tag on the instrument under test, or is automatically specified by the production order data issued by the manufacturing execution system.
[0033] For example, the production line PLC or host computer software triggers the test task. The test task acquisition module scans the QR code on the instrument under test, parses the equipment model "PT-200", and obtains the list of target subsystems to be executed in this test ["AnalogOutput", "HART_Comm"] from the MES system.
[0034] Step s103: Based on the device model and target subsystem, extract the corresponding target instruction set, target channel label and target waiting strategy from the configuration information database.
[0035] In one embodiment of this application, the adaptive matching module traverses the target subsystem list and extracts the corresponding target instruction set, target channel label and target waiting strategy from the configuration information database.
[0036] Furthermore, when the instructions in the target instruction set contain dynamic parameter placeholders, the dynamic parameter placeholders are filled in in conjunction with the current test environment variables to generate complete executable instructions before being sent through the VISA session.
[0037] Step s104: Based on the target channel label, query and parse the corresponding target VISA resource address in the preset dynamic mapping table.
[0038] In one embodiment of this application, the dynamic mapping table is stored in a local system database or an encrypted configuration file to maintain the correspondence between channel labels and actual VISA resource addresses. An example is shown in Table 1 below: Table 1 Dynamic Mapping Table
[0039] When a test engineer changes a multimeter from a GPIB interface to a LAN interface, they only need to modify the VISA resource address corresponding to DMM_CH2 in the table above to the new address; no changes are required to the configuration information database. <subsystem>definition.
[0040] Furthermore, the dynamic mapping table is an editable configuration table. When the physical communication interface of the instrument under test changes, the communication channel adaptation is achieved by modifying the correspondence between the channel label and the VISA resource address in the dynamic mapping table, without modifying the test instruction set content in the configuration information base.
[0041] For example, when a test engineer changes a multimeter from a GPIB interface to a LAN interface, they only need to modify the VISA resource address corresponding to DMM_CH2 in the table above to the new address, without changing any definitions in the configuration information base.
[0042] Step s105: Based on the target VISA resource address, automatically call the VISA library function to establish a VISA session with the instrument under test, and bind the VISA session with all instructions in the target instruction set.
[0043] In one embodiment of this application, the channel binding module traverses the target channel tags of each subsystem, parses the corresponding VISA resource address from the dynamic mapping table, and sequentially calls the viOpen() function to establish a VISA session handle. The instruction set of each subsystem is bound to its own dedicated session handle.
[0044] Step s106: Execute the instructions in the target instruction set in a preset order. For each instruction, perform the following processing: send the current instruction through the bound VISA session; activate the target waiting policy corresponding to the current instruction and monitor the VISA receive buffer status; if complete response data is received within the maximum waiting time, process the response data and continue executing the next instruction; if complete response data is not received after the maximum waiting time, execute the operation defined by the timeout action type.
[0045] In one embodiment of this application, the specific method for monitoring the status of the VISA receive buffer is as follows: the VISA library function is called at a preset polling interval to query the instrument status register, and when the operation completion flag is detected, the complete response data in the VISA receive buffer is read.
[0046] For example, consider the instruction execution process of the target subsystem "AnalogOutput". The channel binding module has established a VISA session handle hSession corresponding to DMM_CH2 for "AnalogOutput". The instruction execution and arbitration module retrieves the first instruction "OUTP ON" from the instruction set of this subsystem and sends it via viWrite(hSession, "OUTP ON\n"). The system reads the waiting policy corresponding to the current instruction: maxWaitTime=3000ms, pollInterval=10ms, timeoutAction=SKIP. The timer is started, and the system enters a loop monitoring state. The system calls viReadSTB(hSession) to query the status register at 10ms intervals. 120ms after sending, it detects that the instrument has returned the "operation completed" bit. Subsequently, viRead() is called to read the complete response data, parse it, and record the test results. The counter is reset, and the system proceeds to the processing of the next instruction.
[0047] Furthermore, the timeout action type includes jumping to the next instruction; when the jump is executed, the waiting state of the current instruction is forcibly interrupted, the VISA library function is called to clear the VISA receive buffer, and the execution is automatically jumped to the next instruction in the target instruction set to continue.
[0048] For example, after the system sends the command "MEAS:CURR?", the instrument fails to return any data within 3000ms due to an intermittent fault. When the timer exceeds the 3000ms threshold, the system performs the following timeout actions: calls viClear() to clear the VISA receive buffer; marks the current command as "timeout not executed"; and immediately jumps to the next command (if it exists) or terminates the test of the current subsystem without interrupting the entire test process.
[0049] Furthermore, when the jump is executed, a channel exception record with a timestamp is also generated. The channel exception record includes the current instruction identifier, the target channel label, and the timeout reason, which is used for subsequent fault tracing analysis.
[0050] For example, generate an exception record: {timestamp: "2026-05-11T14:32:15", channel:"DMM_CH2", command: "MEAS:CURR?", reason: "TIMEOUT", action: "SKIPPED"}. Mark the current instruction as "timeout not executed".
[0051] In another embodiment, the system calls viReadSTB(hSession) to query the status register at 10ms intervals. 120ms after transmission, it detects that the instrument has returned an "operation complete" bit. Subsequently, viRead() is called to read the complete response data, parse it, and record the test results. The counter is reset, and processing begins for the next instruction.
[0052] Furthermore, when any instruction times out and jumps, a summary test report is generated after all instructions in the target instruction set have been executed. The summary test report marks the instruction item that timed out and jumps and the corresponding channel information.
[0053] To address the aforementioned technical problems, the second embodiment of this application provides an adaptive instruction configuration testing system for instrumentation production lines, which solves the same technical problems as the method embodiment. The system may include the following modules: a configuration information database module, a dynamic mapping table module, a test task acquisition module, an adaptive matching module 1004, a channel binding module, and an instruction execution and arbitration module.
[0054] The configuration information database module stores hierarchical configuration information, including the correspondence between device models, subsystems, test instruction sets, channel labels, and waiting policies.
[0055] The dynamic mapping table module is used to store the mapping relationship between channel labels and VISA resource addresses.
[0056] The test task acquisition module is used to obtain the device model of the instrument under test and the target subsystem to be tested.
[0057] The adaptive matching module is used to extract the target instruction set, target channel label, and target waiting strategy from the configuration information database based on the device model and target subsystem.
[0058] The channel binding module is used to parse the target VISA resource address from the dynamic mapping table based on the target channel label, automatically call the VISA library function to establish a VISA session, and bind the VISA session to the target instruction set.
[0059] The instruction execution and arbitration module is used to send instructions sequentially through the VISA session, monitor the VISA receive buffer status according to the waiting policy, and execute the operation defined by the timeout action type when a timeout occurs.
[0060] It is understood that this embodiment is the system authority corresponding to the method authority, and therefore this embodiment has all the technical effects of the method embodiment, which will not be repeated here.
[0061] To address the aforementioned technical problems, a third embodiment of this application provides an electronic device to solve the same technical problems as the method embodiment. The electronic device may include: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the adaptive instruction configuration method for instrument production lines provided in the preceding embodiments.
[0062] It is understood that this embodiment is the device claim corresponding to the method claim, and therefore this embodiment has all the technical effects of the method claim, which will not be repeated here.
[0063] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.< / subsystem>
Claims
1. An adaptive instruction configuration method for instrumentation production lines, characterized in that, Includes the following steps: A hierarchical configuration information database is constructed and stored. The configuration information database includes equipment model information corresponding to various instruments and meters, information on at least one subsystem under each equipment model, test instruction sets associated with each subsystem, and channel labels and waiting policies associated with the test instruction sets. The channel labels are semantic identifiers used to abstractly represent the physical communication channel type required by the subsystem. The waiting policies include at least the maximum waiting time and timeout action type. Obtain the device model of the instrument under test and the target subsystem to be tested; Based on the device model and target subsystem, extract the corresponding target instruction set, target channel label, and target waiting strategy from the configuration information database; Based on the target channel label, the corresponding target VISA resource address is queried and parsed from the preset dynamic mapping table; Based on the target VISA resource address, automatically call the VISA library function to establish a VISA session with the instrument under test, and bind the VISA session with all instructions in the target instruction set; The instructions in the target instruction set are executed sequentially according to a preset order. For each instruction, the following processing is performed: the current instruction is sent through the bound VISA session; the target waiting policy corresponding to the current instruction is activated, and the VISA receive buffer status is monitored; if complete response data is received within the maximum waiting time, the response data is processed and the next instruction is executed; if complete response data is not received after the maximum waiting time, the operation defined by the timeout action type is executed.
2. The method according to claim 1, characterized in that, The timeout action types include jumping to the next instruction; when the jump is executed, the current instruction's waiting state is forcibly interrupted, the VISA library function is called to clear the VISA receive buffer, and the execution is automatically jumped to the next instruction in the target instruction set to continue.
3. The method according to claim 2, characterized in that, When the jump is executed, a channel exception record with a timestamp is also generated. The channel exception record includes the current instruction identifier, the target channel label, and the timeout reason, which is used for subsequent fault tracing and analysis.
4. The method according to claim 1, characterized in that, When the instructions in the target instruction set contain dynamic parameter placeholders, the dynamic parameter placeholders are filled in in conjunction with the current test environment variables to generate complete executable instructions, which are then sent through the VISA session.
5. The method according to claim 1, characterized in that, The dynamic mapping table is an editable configuration table. When the physical communication interface of the instrument under test changes, the communication channel is adapted by modifying the correspondence between the channel label and the VISA resource address in the dynamic mapping table, without modifying the test instruction set content in the configuration information base.
6. The method according to claim 1, characterized in that, The specific method for monitoring the VISA receive buffer status is as follows: the VISA library function is called at a preset polling interval to query the instrument status register. When the operation completion flag is detected, the complete response data in the VISA receive buffer is read.
7. The method according to claim 1, characterized in that, The device model is automatically obtained by scanning the barcode or RFID tag on the instrument under test, or is automatically specified by the production order data issued by the manufacturing execution system.
8. The method according to claim 1, characterized in that, When any instruction times out and jumps, a summary test report is generated after all instructions in the target instruction set have been executed. The summary test report marks the instruction item that timed out and jumps and the corresponding channel information.
9. An adaptive instruction configuration testing system for instrumentation production lines, characterized in that, include: The configuration information database module is used to store hierarchical configuration information, including the correspondence between device model, subsystem, test command set, channel label and waiting strategy; The dynamic mapping table module is used to store the mapping relationship between channel labels and VISA resource addresses; The test task acquisition module is used to acquire the device model of the instrument under test and the target subsystem to be tested; An adaptive matching module is used to extract target instruction sets, target channel tags, and target waiting strategies from the configuration information database based on the device model and target subsystem. The channel binding module is used to parse the target VISA resource address from the dynamic mapping table according to the target channel label, automatically call the VISA library function to establish a VISA session, and bind the VISA session to the target instruction set; The instruction execution and arbitration module is used to send instructions sequentially through the VISA session, monitor the VISA receive buffer status according to the waiting policy, and execute the operation defined by the timeout action type when a timeout occurs.
10. An electronic device, characterized in that, include: At least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the method as described in any one of claims 1-8.
