Control Method and System for Multi-Microwave Source Board
Through the underlying library, the device handle and board number of multi-microwave source boards can be managed, and the control and switching of multiple microwave source boards can be achieved, which solves the problem that users cannot specify the microwave source of slots to operate, and improves the stability and controllability of equipment operation.
Patent Information
- Application Number
- CN202111347900.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-15
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2041-11-15
AI Technical Summary
In the scenario of multi-microwave board, the user cannot specify the microwave source of the corresponding slot to operate, resulting in disordered equipment operation status.
The underlying library realizes control of multi-microwave source boards, including opening the corresponding microwave source boards based on the specified slot number issued by the upper software, creating board numbers, initializing the device, and managing the device handles through the hash table to realize the switching and setting of boards.
It realizes normal control and switching of multiple microwave source boards, solves the problem of disordered equipment operation status, and improves the flexibility and controllability of the system.
Smart Images

Figure CN114185526B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of microwave source board control, and specifically to a control method and system for multiple microwave source boards. Background Art
[0002] A microwave source refers to a device that generates microwave energy. Different application scenarios require microwave energy with different frequencies and different powers. There are continuous wave sources and pulsed modulated wave sources; magnetrons or microwave transistors are used to generate microwave oscillations. The requirements for microwave sources are the stability of output power and frequency.
[0003] Generally, after a user installs a microwave source device driver on Windows, uses the LOmoduleDll.dll dynamic link library provided by the microwave source manufacturer, calls the PXI_FindDev() interface to search for the microwave source device, and executes LOModule_Init() to initialize the device, and finally uses the interfaces LOModule_SetFreq() and LOModule_SetPower() to set the parameters of the microwave source power and frequency. However, when there are multiple microwave source boards in the chassis, the user cannot specify the microwave source in the corresponding slot for operation at the application layer, resulting in a disordered operating state of the device.
[0004] How to control multiple microwave source boards is a technical problem that needs to be solved. Summary of the Invention
[0005] The technical task of the present invention is to provide a control method and system for multiple microwave source boards to solve the technical problem of how to control multiple microwave source boards in view of the above deficiencies.
[0006] In a first aspect, the control method for multiple microwave source boards of the present invention includes the following steps:
[0007] Based on the specified slot number issued by the upper-layer software, open the corresponding microwave source board through the underlying library, and create a board card number based on the device identifier of the microwave source board, and the board card number is used as the identifier of the microwave source board;
[0008] Based on the specified slot number issued by the upper-layer software, search for the microwave source board corresponding to the specified slot number in the chassis as the target board through the underlying library, and return the device information of the chassis, where the device information includes the number of devices and the device address;
[0009] Call the device initialization interface of the target board through the underlying library, and perform device initialization on the target board through the device initialization interface, including parameter initialization of the resource address, device handle, and error information of the target board. The resource address is the device file path of the microwave source board, the device handle is the device operation parameter, and the error information is used to report errors and display errors;
[0010] Create a hash item for the target board through the underlying library. The key value of the hash item is the board card number of the target board, and the value of the hash item is the device handle of the target board. Insert the hash item into the hash table configured in the underlying library, and return the board card number of the target board to the upper-layer software;
[0011] Based on the specified slot number issued by the upper-layer software, find the corresponding hash item through the underlying library and obtain the corresponding device handle. Perform device setting operations on the microwave source board corresponding to the specified slot number based on the device handle.
[0012] Preferably, the upper-layer software issues the specified slot number and obtains the board card number of the corresponding microwave source board through the web interface.
[0013] Preferably, an upper-layer interface is configured in the underlying library. Call the upper-layer interface to open the microwave source board corresponding to the specified slot number, and create a board card number based on the device identifier of the microwave source board;
[0014] The upper-layer interface is configured with an open_resource() function, and the parameter slot is the slot number corresponding to the microwave source board.
[0015] Preferably, an initialization interface is configured in the underlying library, and the device initialization interface is called through the initialization interface;
[0016] The device initialization interface is the LOModule_Init interface configured with the LOModule_Init function, which is configured by the manufacturer of the microwave source board itself;
[0017] The initialization interface includes the initDev interface of the python driver and the DLL_PXI_initDev interface of the C library. The underlying library calls the initDev interface of the python driver and calls the DLL_PXI_initDev interface of the C library, and calls the LOModule_Init through the DLL_PXI_initDev interface;
[0018] In the LOModule_Init function, the parameter DataFilePath is the resource address, the parameter index is the board number of the target board, the parameter LoHandle is the device handle, and the parameter g_strErrMsg is the error message.
[0019] Preferably, the underlying library uses the open-source uthash C code and malloc to dynamically create hash table entries, and inserts the hash table entries into the hash table by calling the interface HASH_ADD_INT().
[0020] Preferably, based on the specified slot number issued by the upper-layer software, the corresponding hash item is found through the underlying library, and the corresponding device handle is obtained. Based on the device handle, device setting operations are performed on the microwave source board corresponding to the specified slot number, including the following steps:
[0021] Convert the slot number to the key value of the corresponding microwave source board through the underlying library;
[0022] Find the hash item corresponding to the key value in the hash table through the HASH_FIND_INT interface of the underlying library, and obtain the corresponding device handle from the hash item;
[0023] Set the output frequency through the underlying library by calling the LOModule_SetFreq interface. The LOModule_SetFreq interface is configured with the LOModule_SetFreq function. In the LOModule_SetFreq function, the parameter LoHandle is the device handle, the parameter dFreqMHz is the expected set frequency value, and the parameter g_strErrMsg is the error message; and / or, set the output power through the underlying library by calling the LOModule_SetPower interface. The LOModule_SetPower interface is configured with the LOModule_SetPower function. In the LOModule_SetPower function, the parameter LoHandle is the device handle, the parameter dPower is the expected set power value, and the parameter g_strErrMsg is the error message.
[0024] Preferably, based on the board numbers of each microwave source board, different hash table entries are returned through the HASH_FIND_INT() interface of the underlying library to switch different microwave source boards for device setting operations.
[0025] Preferably, before initializing the target board through the device initialization interface, the target board is matched based on the device address through the check_device_exist interface of the underlying library. The check_device_exist interface is configured with the check_device_exist() function to determine whether the device address of the target board returned by the chassis information is consistent with the device address stored locally.
[0026] In a second aspect, the control system of the multi-microwave source board of the present invention controls the multi-microwave source board through the control method of the multi-microwave source board according to any one of the first aspects. The control system includes:
[0027] An upper-layer software for issuing slot numbers;
[0028] A lower-layer library configured with a device identification module, a device search module, a device matching module, a device initialization module, a device warehousing module, a device operation module, and a board card switching module.
[0029] The device identification module is used to open the corresponding microwave source board based on the specified slot number issued by the upper-layer software, and create a board card number based on the device identification of the microwave source board. The board card number is used as the identifier of the microwave source board.
[0030] The device search module is used to search for the microwave source board corresponding to the specified slot number from the chassis based on the specified slot number issued by the upper-layer software, and return the device information of the chassis. The microwave source board corresponding to the specified slot number is used as the target board. The device information includes the number of devices and the device address.
[0031] The device matching module is used to match the target board based on the device address, and determine whether the device address of the target board obtained from the returned device information is consistent with the device address stored locally.
[0032] The device initialization module is used to call the device initialization interface of the target board itself, and initialize the target board through the device initialization interface, including parameter initialization of the resource address, device handle, and error information of the target board. The resource address is the device file path of the microwave source board, the device handle is the device operation parameter, and the error information is used to report errors and view error information.
[0033] The device insertion module is used to create a hash entry for the target board. The key value of the hash entry is the board card number of the target board, and the value of the hash entry is the device handle of the target board. The hash entry is inserted into the hash table configured in the underlying library, and the board card number of the target board is returned to the upper-layer software.
[0034] The device operation module is used to find the corresponding hash item through the underlying library based on the specified slot number issued by the upper-layer software, obtain the corresponding device handle, and perform device setting operations on the microwave source board corresponding to the specified slot number based on the device handle. The device setting operations include output frequency setting and output power setting;
[0035] The board card switching module is used to return different hash table items based on the board card number to switch different microwave source boards for device setting operations.
[0036] Preferably, the upper-layer software interacts externally through a web interface to issue the specified slot number and obtain the corresponding board card number;
[0037] The device operation module is used to perform setting operations on the microwave source board through the following steps:
[0038] Convert the slot number into the key value of the corresponding microwave source board;
[0039] Find the hash item corresponding to the key value in the hash table through the HASH_FIND_INT interface of the underlying library, and obtain the corresponding device handle from the hash item;
[0040] Call the LOModule_SetFreq interface of the underlying library to perform output frequency setting. The LOModule_SetFreq interface is configured with the LOModule_SetFreq function. In the LOModule_SetFreq function, the parameter LoHandle is the device handle, the parameter dFreqMHz is the expected set frequency value, and the parameter g_strErrMsg is the error message; and / or, call the LOModule_SetPower interface of the underlying library to perform output power setting. The LOModule_SetPower interface is configured with the LOModule_SetPower function. In the LOModule_SetPower function, the parameter LoHandle is the device handle, the parameter dPower is the expected set power value, and the parameter g_strErrMsg is the error message.
[0041] The control method and system for multiple microwave source boards of the present invention have the following advantages:
[0042] 1. Identify the corresponding microwave source board according to the specified slot number, create a board card number, initialize the device of the microwave source board, initialize the device handle of the microwave source board, create a corresponding hash item based on the board card number and the device handle, and insert the hash item into the hash table. When an operation needs to be performed on the microwave source board in the specified slot, find the corresponding device handle from the hash table through the board card number, so as to perform a setting operation on the microwave source board, realizing the normal control of multiple boards inserted on the chassis;
[0043] 2. Through the HASH_FIND_INT() interface of the underlying library, return different hash table items based on the board card number to realize the switching operation between different microwave source boards, and realize the switching operation of different microwave source boards. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0045] The present invention will be further described below with reference to the drawings.
[0046] Figure 1 It is a flowchart of the control method for multiple microwave source boards in Embodiment 1. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0047] The present invention will be further described below with reference to the drawings and specific embodiments, so that those skilled in the art can better understand the present invention and be able to implement it. However, the embodiments cited do not limit the present invention. Without conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.
[0048] The embodiment of the present invention provides a control method and system for multiple microwave source boards, which is used to solve the technical problem of how to control multiple microwave source boards.
[0049] Embodiment 1:
[0050] The control method for multiple microwave source boards of the present invention includes the following steps:
[0051] S100. Based on the specified slot number issued by the upper-layer software, open the corresponding microwave source board through the underlying library, and create a board card number based on the device identifier of the microwave source board. The board card number serves as the identifier of the microwave source board;
[0052] S200. Based on the specified slot number sent by the upper-layer software, search for the microwave source board corresponding to the specified slot number from the chassis through the underlying library, and return the device information of the chassis. The microwave source board corresponding to the specified slot number is used as the target board. The device information includes the number of devices and the device address;
[0053] S300. Call the device initialization interface of the target board itself through the underlying library, and perform device initialization on the target board through the device initialization interface, including parameter initialization of the resource address, device handle, and error information of the target board. The resource address is the device file path of the microwave source board, the device handle is the device operation parameter, and the error information is used for reporting errors and viewing error information;
[0054] S400. Create a hash item for the target board through the underlying library. The key value of the hash item is the board card number of the target board, and the value of the hash item is the device handle of the target board. Insert the hash item into the hash table configured in the underlying library, and return the board card number of the target board to the upper-layer software;
[0055] S500. Based on the specified slot number sent by the upper-layer software, search for the corresponding hash item through the underlying library, and obtain the corresponding device handle. Perform setting operations on the microwave source board corresponding to the specified slot number based on the device handle.
[0056] In this embodiment, the upper-layer software sends the specified slot number through the web interface and obtains the board card number of the corresponding microwave source board. The upper-layer software is Anaconda. In step S100, it is necessary to install the upper-layer software Anaconda, create a working environment, execute the command conda activate awg, and then jupyter notebook can open the application interface of the upper-layer Web.
[0057] The upper-layer interface is configured in the underlying library. The upper-layer interface is the upper-layer interface configured with the open_resource() function. The parameter slot in this function is the slot number corresponding to the microwave source board. Open the microwave source board corresponding to the specified slot number through the upper-layer interface. The microwave source board is used as the target board, and return the device identifier module_id of the target board. Create a corresponding board card number module_id based on the device identifier module_id.
[0058] Step S200 performs device search and returns the device information of the chassis. Specifically, the PXI_FindDev interface configured with the PXI_FindDev() function in the underlying library is used to search for the device (microwave source board). In the PXI_FindDev() function, the parameter LoIndex is an array of device numbers. Here, LoIndex[0] is 1, which is the device address on slot 1, and LoIndex[1] is 2, which is the device address on slot 2. The parameter dev_num is the number of devices, and the parameter g_strErrMsg is the error message.
[0059] The code for finding the device is as follows:
[0060] static int find_dev(void)
[0061] {
[0062] int dev_num = 0;
[0063] char list
[32] = "", tmp
[32] = "";
[0064] / / Find the device
[0065] ret = PXI_FindDev(LoIndex, &dev_num, g_strErrMsg);
[0066] DBG("ret = %d,g_strErrMsg :%s\n", ret, g_strErrMsg);
[0067] return dev_num;
[0068] }
[0069] Step S300 initializes the target board. Specifically, it calls the initDev interface of the Python driver through the underlying library and calls the DLL_PXI_initDev interface of the C library to perform the device initialization operation. During the initialization operation, the DLL_PXI_initDev interface calls the LOModule_Init interface configured with the LOModule_Init function to initialize the device. In the LOModule_Init function, the parameter DataFilePath is the resource address (the data file path bound to the device number. Taking device 1 as an example, it is PowCalData\1\LoCalData_14dB.txt at this time), the parameter index is the device number of the device to be initialized, the parameter LoHandle is the device control handle, and all subsequent operations on the device need to use this parameter. The parameter g_strErrMsg is the error message.
[0070] Step S400 inserts the target microwave source. Specifically, it uses the open-source uthash C code to dynamically create a hash table entry map_item using malloc, and sets the key of map_item to the board number module_id and the value of map_item to the device handle LoHandle of the board. Then, it uses the HASH_ADD_INT() interface configured with the HASH_ADD_INT() function to insert the newly created hash table entry map_item into map_table to complete the insertion of the microwave source device, and returns the device identifier module_id to the upper layer. map_table is configured in the underlying library.
[0071] The code for initializing the device and storing the device handle is as follows:
[0072] EXT_API int DLL_PXI_initDev(int nslot)
[0073] {
[0074] char dev_str[2]
[64] = { "\\PowCalData\\1\\LoCalData_14dB.txt","\\PowCalData\\2\\LoCalData_14dB.txt"};
[0075] if (index == 1 || index == 2)
[0076] {
[0077] strcat_s(CurrentDir, sizeof(CurrentDir),dev_str[index - 1]);
[0078] }
[0079] ret = LOModule_Init(DataFilePath, index,&LoHandle[path_index], g_strErrMsg);
[0080] module_id = ++map_count;
[0081] map_item->module_id = module_id;
[0082] map_item->fd = LoHandle[path_index];
[0083] HASH_ADD_INT(map_table, module_id, map_item);
[0084] }
[0085] Step S500 performs device setup operations. When the user needs to operate on a microwave source with a specified slot number, for example, to set the output frequency of the microwave source, only the corresponding slot number needs to be specified. The underlying library will first receive the slot number parameter passed in by the upper-layer software, convert this slot number into a key value corresponding to the board, use the HASH_FIND_INT interface to find the hash table entry map_item corresponding to this key value in the hash table map_table, and then the device handle LoHandle of this slot can be obtained; call the configured interface when the user needs to operate on a microwave source with a specified slot number. For example, to set the output frequency of the microwave source, only the corresponding slot number needs to be specified. The underlying code will first receive the slot number parameter passed in by the upper layer, convert this slot number into a key value corresponding to the board, use the HASH_FIND_INT interface to find the hash table entry map_item corresponding to this key value in the hash table map_table, and then the device handle LoHandle of this slot can be obtained; call the interface LOModule_SetFreq to set the output frequency. The parameter LoHandle is the device handle just obtained, the parameter dFreqMHz is the expected frequency size to be set, and the parameter g_strErrMsg is the error message function. Call the LOModule_SetFreq interface to set the output frequency. In the LOModule_SetFreq function, the parameter LoHandle is the device handle just obtained, the parameter dFreqMHz is the expected frequency size to be set, and the parameter g_strErrMsg is the error message.
[0086] The code for setting the output frequency is as follows:
[0087] EXT_API bool DLL_PXI_setFreq(int module_id, double dFreqMHz)
[0088] {
[0089] HASH_FIND_INT(map_table, &module_id, map_item);
[0090] / / Set the frequency, MHz
[0091] if (LOModule_SetFreq(map_item->fd, dFreqMHz, g_strErrMsg) < 0) {
[0092] ERR("%s\n", g_strErrMsg);
[0093] return false;
[0094] } else {
[0095] ERR("module_id %d not found.\n", module_id);
[0096] return false;
[0097] }
[0098] return true;
[0099] }
[0100] This step also involves output power setting. When it is necessary to set the output frequency of the microwave source, only the corresponding slot number needs to be specified, and the LOModule_SetPower interface configured with the LOModule_SetPower function is called for output power setting. In the LOModule_SetPower function, the parameter LoHandle is the device handle just obtained, the parameter dPower is the desired set power value, and the parameter g_strErrMsg is the error message.
[0101] The code for setting the output power is as follows:
[0102] EXT_API bool DLL_PXI_setPower(int module_id, float dPower)
[0103] {
[0104] module_id_file_descriptor_map_table *map_item;
[0105] HASH_FIND_INT(map_table,&module_id, map_item);
[0106] if (LOModule_SetPower(map_item->fd, dPower, g_strErrMsg)<0) {
[0107] ERR("%s\n", g_strErrMsg);
[0108] return false;
[0109] } else {
[0110] ERR("module_id %d not found.\n", module_id);
[0111] return false;
[0112] }
[0113] return true;
[0114] }
[0115] When switching the microwave sources of different slots, the underlying library calls the HASH_FIND_INT() interface and can return different hash table entries map_item through the board number module_id. When performing frequency or power setting operations on the microwave source again, the device handle has been successfully updated to the microwave source board to be controlled as expected, and thus the control of multiple microwave source boards can be successfully achieved.
[0116] As an improvement of this embodiment, before initializing the identification of the target board, the underlying library calls the check_device_exist() interface to detect whether the device address obtained in step S200 matches the content of the local device file; if the match is successful, the LOModule_Init interface is called for device initialization.
[0117] Embodiment 2:
[0118] The control system of the multi-microwave source board of the present invention controls the multi-microwave source board through the control method of the multi-microwave source board disclosed in Embodiment 1. The control system includes an upper-layer software and an underlying library. The upper-layer software is used to issue slot numbers, and the underlying library is configured with a device identification module, a device search module, a device matching module, a device initialization module, a device warehousing module, a device operation module, and a board switching module.
[0119] In this embodiment, the upper-layer software issues slot numbers through a web interface. Specifically, the upper-layer software is Anaconda. In step S100, it is necessary to install the upper-layer software Anaconda, create a working environment, execute the command conda activate awg, and then jupyter notebook can open the application interface of the upper-layer Web.
[0120] The device identification module is used to open the corresponding microwave source board based on the specified slot number issued by the upper-layer software, and create a board card number based on the device identification of the microwave source board. The board card number is used as the identification of the microwave source board. In this embodiment, the device identification module is configured with an upper-layer interface, which is an upper-layer interface configured with the open_resource() function. The parameter slot in this function is the slot number corresponding to the microwave source board. The microwave source board corresponding to the specified slot number is opened through the upper-layer interface. This microwave source board is used as the target board, and the device identification module_id of the target board is returned. A corresponding board card number module_id is created based on this device identification module_id.
[0121] The device search module is used to search for the microwave source board corresponding to the specified slot number from the chassis based on the specified slot number issued by the upper-layer software, and return the device information of the chassis. The microwave source board corresponding to the specified slot number is used as the target board. The device information includes the number of devices and the device address. In this embodiment, the device search module is configured with a PXI_FindDev interface. This PXI_FindDev interface is configured with a PXI_FindDev() function to search for devices (microwave source boards). In the PXI_FindDev() function, the parameter LoIndex is an array of device numbers. Here, LoIndex[0] is 1, which is the device address on slot 1; LoIndex[1] is 2, which is the device address on slot 2. The parameter dev_num is the number of devices, and the parameter g_strErrMsg is the error message.
[0122] The device matching module is used to match the target board based on the device address, and determine whether the device address of the target board obtained from the returned device information is consistent with the device address stored locally. The device matching module is configured with a check_device_exist() interface. The device matching module calls the check_device_exist() interface to detect whether the device address in the returned device information matches the content of the local device file. If the match is successful, device initialization is performed.
[0123] The device initialization module is used to call the device initialization interface of the target board, and perform device initialization on the target board through the device initialization interface, including parameter initialization of the resource address, device handle, and error information of the target board. The resource address is the device file path of the microwave source board, the device handle is the device operation parameter, and the error information is used to report errors and view error messages. In this embodiment, the device initialization module calls the initDev interface of the python driver and the DLL_PXI_initDev interface of the C library to perform device initialization operations. During the initialization process, the DLL_PXI_initDev interface calls the LOModule_Init interface configured with the LOModule_Init function to perform device initialization. In the LOModule_Init function, the parameter DataFilePath is the resource address (the data file path bound to the device number, taking device 1 as an example, it is PowCalData\1\LoCalData_14dB.txt at this time), the parameter index is the device number of the device to be initialized, the parameter LoHandle is the device control handle, and this parameter needs to be used for subsequent operations on the device. The parameter g_strErrMsg is the error information.
[0124] The device insertion module is used to create a hash item for the target board. The key value of the hash item is the board card number of the target board, and the value of the hash item is the device handle of the target board. The hash item is inserted into the hash table configured in the underlying library, and the board card number of the target board is returned to the upper-layer software. The device operation module is used to find the corresponding hash item through the underlying library based on the specified slot number sent by the upper-layer software, and obtain the corresponding device handle. Based on the device handle, device setting operations are performed on the microwave source board corresponding to the specified slot number. The device setting operations include output frequency setting and output power setting. In this embodiment, the device insertion module uses the open-source uthash C code to dynamically create a hash table item map_item using malloc, and sets the key of map_item to the board card number module_id and the value of map_item to the device handle LoHandle of the board card. Then, the newly created hash table item map_item is inserted into map_table using the HASH_ADD_INT() interface configured with the HASH_ADD_INT() function to complete the insertion of the microwave source device. And the device identifier module_id is returned to the upper layer. map_table is configured in the underlying library.
[0125] The device operation module is used to find the corresponding hash item through the underlying library based on the specified slot number sent by the upper-layer software, and obtain the corresponding device handle. Based on the device handle, device setting operations are performed on the microwave source board corresponding to the specified slot number. The device setting operations include output frequency setting and output power setting. In this embodiment, the device operation module is configured with the LOModule_SetFreq interface and the LOModule_SetPower interface. The LOModule_SetFreq interface is configured with the LOModule_SetFreq interface function. In the LOModule_SetFreq function, the parameter LoHandle is the device handle, the parameter dFreqMHz is the expected set frequency value, and the parameter g_strErrMsg is the error message. The LOModule_SetFreq interface is called to perform the output frequency setting. The LOModule_SetPower interface is configured with the LOModule_SetPower function. In the LOModule_SetPower function, the parameter LoHandle is the device handle, the parameter dPower is the expected set power value, and the parameter g_strErrMsg is the error message. The LOModule_SetPower interface is called to perform the output power setting.
[0126] The board card switching module is used to return different hash table entries based on the board card number to switch different microwave source boards for device setting operations. The board card switching module is configured with the HASH_FIND_INT() interface. When switching microwave sources in different slots, the board card switching module calls the HASH_FIND_INT() interface. Through the board card number module_id, different hash table entries map_item can be returned. When performing frequency or power setting operations on the microwave source again, at this time the device handle has been successfully updated to the desired controlled microwave source board, and thus the control of multiple microwave source boards can be successfully achieved.
[0127] The above has detailedly demonstrated and described the present invention through the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above multiple embodiments, those skilled in the art can know that the code review means in the above different embodiments can be combined to obtain more embodiments of the present invention, and these embodiments are also within the protection scope of the present invention.
Claims
1. Control method for multi-microwave source board, characterized in that it includes the following steps: Based on the specified slot number issued by the upper-layer software, open the corresponding microwave source board through the underlying library, and create a board card number based on the device identifier of the microwave source board, and the board card number serves as the identifier of the microwave source board; Based on the specified slot number issued by the upper-layer software, find the microwave source board corresponding to the specified slot number from the chassis through the underlying library as the target board, and return the device information of the chassis, where the device information includes the number of devices and the device address; Call the device initialization interface of the target board itself through the underlying library, and perform device initialization on the target board through the device initialization interface, including parameter initialization of the resource address, device handle, and error information of the target board. The resource address is the device file path of the microwave source board, the device handle is the device operation parameter, and the error information is used to report errors and display errors; Create a hash item for the target board through the underlying library, where the key value of the hash item is the board card number of the target board, the value of the hash item is the device handle of the target board, insert the hash item into the hash table configured in the underlying library, and return the board card number of the target board to the upper-layer software; Based on the specified slot number issued by the upper-layer software, find the corresponding hash item through the underlying library, and obtain the corresponding device handle, and perform device setting operations on the microwave source board corresponding to the specified slot number based on the device handle; Based on the specified slot number issued by the upper-layer software, find the corresponding hash item through the underlying library, and obtain the corresponding device handle, and perform device setting operations on the microwave source board corresponding to the specified slot number based on the device handle, including the following steps: Convert the slot number to the key value corresponding to the microwave source board through the underlying library; Find the hash item corresponding to the key value in the hash table through the HASH_FIND_INT interface of the underlying library, and obtain the corresponding device handle from the hash item; Call the LOModule_SetFreq interface through the underlying library to perform output frequency setting. The LOModule_SetFreq interface is configured with the LOModule_SetFreq function. In the LOModule_SetFreq function, the parameter LoHandle is the device handle, the parameter dFreqMHz is the expected set frequency value, and the parameter g_strErrMsg is the error information; and / or, call the LOModule_SetPower interface through the underlying library to perform output power setting. The LOModule_SetPower interface is configured with the LOModule_SetPower function. In the LOModule_SetPower function, the parameter LoHandle is the device handle, the parameter dPower is the expected set power value, and the parameter g_strErrMsg is the error information.
2. The control method for multi-microwave source board according to claim 1, characterized in that the upper-layer software issues the specified slot number and obtains the board card number of the corresponding microwave source board through the web interface.
3. The control method of the multi-microwave source board card according to claim 1, characterized in that an upper-layer interface is configured in the underlying library, the upper-layer interface is called to open the microwave source board card corresponding to the specified slot number, and a board card number is created based on the device identifier of the microwave source board card; the upper-layer interface is configured with an open_resource() function, and the parameter slot is the slot number corresponding to the microwave source board card.
4. The control method of the multi-microwave source board card according to claim 1, characterized in that an initialization interface is configured in the underlying library, and the device initialization interface is called through the initialization interface; the device initialization interface is the LOModule_Init interface configured with the LOModule_Init function, which is configured by the manufacturer of the microwave source board card itself; the initialization interface includes the initDev interface of the python driver and the DLL_PXI_initDev interface of the C library. The underlying library calls the initDev interface of the python driver and calls the DLL_PXI_initDev interface of the C library, and calls the LOModule_Init through the DLL_PXI_initDev interface; in the LOModule_Init function, the parameter DataFilePath is the resource address, the parameter index is the board card number of the target board card, the parameter LoHandle is the device handle, and the parameter g_strErrMsg is the error message.
5. The control method of the multi-microwave source board card according to claim 1, characterized in that the underlying library dynamically creates hash table entries by using the open-source uthash C code and malloc, and inserts the hash table entries into the hash table by calling the interface HASH_ADD_INT().
6. The control method of the multi-microwave source board card according to any one of claims 1-5, characterized in that based on the board card numbers of each microwave source board card, different hash table entries are returned through the HASH_FIND_INT() interface of the underlying library to switch different microwave source board cards for device setting operations.
7. The control method of the multi-microwave source board card according to any one of claims 1-5, characterized in that before the device initialization of the target board card is performed through the device initialization interface, the target board card is matched based on the device address through the check_device_exist interface of the underlying library. The check_device_exist interface is configured with a check_device_exist() function for determining whether the device address of the target board card returned by the chassis information is consistent with the device address stored locally.
8. The control system of the multi-microwave source board card, characterized in that the multi-microwave source board card is controlled by the control method of the multi-microwave source board card according to any one of claims 1-7. The control system includes: an upper-layer software, which is used to issue the slot number; Underlying library, in which a device identification module, a device search module, a device matching module, a device initialization module, a device storage module, a device operation module, and a board card switching module are configured. The device identification module is used to open the corresponding microwave source board card based on the specified slot number issued by the upper-layer software, and create a board card number based on the device identification of the microwave source board card, and the board card number is used as the identification of the microwave source board card. The device search module is used to search for the microwave source board card corresponding to the specified slot number from the chassis based on the specified slot number issued by the upper-layer software, and return the device information of the chassis. The microwave source board card corresponding to the specified slot number is used as the target board card, and the device information includes the number of devices and the device address. The device matching module is used to match the target board card based on the device address, and judge whether the device address of the target board card obtained from the returned device information is consistent with the device address stored locally. The device initialization module is used to call the device initialization interface of the target board card itself, and perform device initialization on the target board card through the device initialization interface, including parameter initialization of the resource address, device handle, and error information of the target board card. The resource address is the device file path of the microwave source board card, the device handle is the device operation parameter, and the error information is used to report errors and view error information. The device insertion module is used to create a hash item for the target board card, the key value of the hash item is the board card number of the target board card, the value of the hash item is the device handle of the target board card, insert the hash item into the hash table configured in the underlying library, and return the board card number of the target board card to the upper-layer software. The device operation module is used to search for the corresponding hash item through the underlying library based on the specified slot number issued by the upper-layer software, and obtain the corresponding device handle, and perform device setting operations on the microwave source board card corresponding to the specified slot number based on the device handle. The device setting operations include output frequency setting and output power setting. The board card switching module is used to return different hash table entries based on the board card number to switch different microwave source board cards for device setting operations. The upper-layer software interacts externally through a web interface, and is used to issue a specified slot number and obtain the corresponding board card number. The device operation module is used to perform setting operations on the microwave source board card through the following steps: Convert the slot number to the key value corresponding to the microwave source board card. Search for the hash item corresponding to the key value in the hash table through the HASH_FIND_INT interface of the underlying library, and obtain the corresponding device handle from the hash item. The output frequency is set by calling the LOModule_SetFreq interface through the underlying library. The LOModule_SetFreq interface is configured with the LOModule_SetFreq function. In the LOModule_SetFreq function, the parameter LoHandle is the device handle, the parameter dFreqMHz is the desired frequency to be set, and the parameter g_strErrMsg is the error message; and / or, the output power is set by calling the LOModule_SetPower interface through the underlying library. The LOModule_SetPower interface is configured with the LOModule_SetPower function. In the LOModule_SetPower function, the parameter LoHandle is the device handle, the parameter dPower is the desired power to be set, and the parameter g_strErrMsg is the error message.
Citation Information
Patent Citations
Control method of multiple AWG board cards
CN112100111A
Board card switching control method and device, equipment and medium
CN112416444A