Summary of the invention
The implementation method that the purpose of this invention is to provide a kind of instrument module common port of enhancing productivity.
In order to achieve the above object, the present invention adopts following technical scheme: a kind of implementation method of instrument module common port, and the implementation method step is:
Step 1: that utilizes driving method repository in the driving method configuration layer opens function creation instrument module object instance;
In step 1, the test terminal can pass to the instrument module connection string driving method repository, the driving method repository passes to concatenation character the instrument module Management Library Driver in the instrument module administration and supervision authorities again, the instrument module Management Library Driver separates connection string and identification instrument module type according to certain protocol format, the instrument module that loads in the instrument module drive layer according to particular type drives case library again, utilize instrument module to drive then and open function creation instrument module object instance in the case library, simultaneously instrument module object instance handle is returned to the upper strata;
Step 2: the creation method function creation driving method object that utilizes the driving method repository;
Step 3: the input parameter of parameter value function configuration driven method that utilizes the method to set up of driving method repository;
Step 4: utilize the operation function of driving method repository to carry out a driving method;
Step 5: utilize the output parameter value function that obtains of driving method repository to get access to the data of returning from instrument module;
Step 6: utilize the release function of driving method repository to discharge certain driving method object memory source;
If carry out a plurality of driving methods, repeating step 2,3,4,5,6.
Driving method repository in the described driving method configuration layer adopts the design of software factory pattern, the mode of used all methods in test terminal according to standard is encapsulated, for the upper strata provides unified interface.
Instrument module Management Library Driver in the described instrument module administration and supervision authorities adopts OO design, automatically analyze and management instrument module driving case library according to the instrument module connection string, dynamic creation instrument module driven object and method support that many instruments use simultaneously.
Instrument module in the described instrument module Drive Layer drives case library and adopts OO design, supports to create a plurality of instrument module driven object, for the upper strata provides unified interface.
Driving method repository in the described driving method configuration layer is mainly configurating terminal and the test terminal provides driving method configuration and the api interface of carrying out, and the driving method repository is arranged in the driving method configuration layer.
Instrument module Management Library Driver in the described instrument module administration and supervision authorities provides instrument module general api interface for the driving method repository, manages instrument module automatically and drives case library, and the instrument module Management Library Driver is arranged in the instrument module administration and supervision authorities.
Instrument module in the described instrument module Drive Layer drives case library and provides general api interface for the instrument module Management Library Driver, and realizes that the driving code of instrument module, instrument module drive case library and be arranged in the instrument module Drive Layer.
It all is * .dll file that described driving method repository, instrument module Management Library Driver, instrument module drive case library.
Instrument module driving case library in the described instrument module Drive Layer sends and receives the SCPI instruction by viOpen, viClose, viPrintf, viscanf, viWrite, the viRead function in VISA storehouse, and the instrument module api interface function of standard externally is provided.
The present invention is directed to employed instrument module manufacturer, model, agreement difference in the radio frequency products test process, driving method interface difference, method can't be according to the defectives of test event demand dynamic-configuration, and a kind of and general-purpose interface instrument communication are provided.The driving of realization instrument general-purpose interface mainly drives case library by instrument module Management Library Driver in the driving method repository in the driving method configuration layer, the instrument module management and the instrument module in the instrument module Drive Layer and forms.Except that having the conventional ADS driving library facility, also have automatic identification instrument function, instrument Classification Management function, driving method as seen, support dynamic-configuration to carry out the standard interface of function and secondary development.
The invention has the beneficial effects as follows:
1, the difference between shielding instrument module manufacturer, model, the communications protocol is for all instrument modules provide unified interface.
2, manage instrument module automatically, reduce maintenance difficulties.
3, instrument module drives the case library independent design, reduces relevance each other, and then has improved the stability and the reliability of instrument module Driver Library, has also reduced the development time greatly simultaneously, has improved production efficiency.
4, all methods support dynamic-configuration to carry out, and build radio-frequency module test item and method of testing according to demand flexibly, the development time of the Auto-Test System that significantly reduces, enhance productivity.
5, support secondary development merit and manage the function of instrument kind automatically.
Embodiment
Disclosed all features in this instructions, or the step in disclosed all methods or the process except mutually exclusive feature and/or step, all can make up by any way.
Disclosed arbitrary feature in this instructions (comprising any accessory claim, summary and accompanying drawing) is unless special narration all can be replaced by other equivalences or the alternative features with similar purpose.That is, unless special narration, each feature is an example in a series of equivalences or the similar characteristics.
See shown in Figure 1, a kind of implementation method of instrument module common port, the implementation method step is:
Step 1: that utilizes driving method repository in the driving method configuration layer opens function creation instrument module object instance;
In step 1, the test terminal can pass to the instrument module connection string driving method repository, the driving method repository passes to concatenation character the instrument module Management Library Driver in the instrument module administration and supervision authorities again, the instrument module Management Library Driver separates connection string and identification instrument module type according to certain protocol format, the instrument module that loads in the instrument module drive layer according to particular type drives case library again, utilize instrument module to drive then and open function creation instrument module object instance in the case library, simultaneously instrument module object instance handle is returned to the upper strata;
Step 2: the creation method function creation driving method object that utilizes the driving method repository;
Step 3: the input parameter of parameter value function configuration driven method that utilizes the method to set up of driving method repository;
Step 4: utilize the operation function of driving method repository to carry out a driving method;
Step 5: utilize the output parameter value function that obtains of driving method repository to get access to the data of returning from instrument module;
Step 6: utilize the release function of driving method repository to discharge certain driving method object memory source;
If carry out a plurality of driving methods, repeating step 2,3,4,5,6.
Driving method repository in the described driving method configuration layer adopts the design of software factory pattern, the mode of used all methods in test terminal according to standard is encapsulated, for the upper strata provides unified interface.
Instrument module Management Library Driver in the described instrument module administration and supervision authorities adopts OO design, automatically analyze and management instrument module driving case library according to the instrument module connection string, dynamic creation instrument module driven object and method support that many instruments use simultaneously.
Instrument module in the described instrument module Drive Layer drives case library and adopts OO design, supports to create a plurality of instrument module driven object, for the upper strata provides unified interface.
Driving method repository in the described driving method configuration layer is mainly configurating terminal and the test terminal provides driving method configuration and the api interface of carrying out.
Instrument module Management Library Driver in the described instrument module administration and supervision authorities provides instrument module general api interface for the driving method repository, manages instrument module automatically and drives case library.
Instrument module in the described instrument module Drive Layer drives case library and provides general api interface for the instrument module Management Library Driver, and realizes the driving code of instrument module.
It all is * .dll file that described driving method repository, instrument module Management Library Driver, instrument module drive case library.
Instrument module driving case library in the described instrument module Drive Layer sends and receives the SCPI instruction by viOpen, viClose, viPrintf, viscanf, viWrite, the viRead function in VISA storehouse, and the instrument module api interface function of standard externally is provided.
As shown in Figure 2, ATML among Fig. 2 is the driving method repository, power meter Management Library Driver, acoustic meter Management Library Driver, lattice gauge Management Library Driver, frequency spectrograph Management Library Driver, signal source Management Library Driver, radio-frequency module product Management Library Driver all are the instrument module Management Library Driver, and NRT power meter Driver Library, N8974A Driver Library, E5062A Driver Library, N9010A Driver Library, FSP-7 Driver Library, FSP-3 Driver Library, N5082A Driver Library, product Driver Library all are that instrument module drives case library.
In order more to clearly demonstrate the implementation method of general-purpose interface of the present invention, be set forth in below on the general-purpose interface of instrument module of radio-frequency module product Auto-Test System and be specifically described, but the present invention not only is suitable for the used instrument module driving interface of radio-frequency module product test, also be appropriate to the driving interface of Other Instruments module, the implementation method of a kind of instrument module common port of the present invention, have in configurating terminal, test code, testing tool, the test terminal at one
A driving method repository is arranged in the driving method configuration layer, and the driving method repository is mainly configurating terminal and the test terminal provides driving method configuration and the api interface of carrying out; The instrument module Management Library Driver is arranged in the instrument module administration and supervision authorities, and the instrument module Management Library Driver provides instrument module general api interface for the driving method repository, manages instrument module automatically and drives case library; Instrument module drives case library and is arranged in the instrument module Drive Layer, for the instrument module Management Library Driver provides general api interface, and the driving code of realization instrument module; Physical layer mainly comprises testing tool and the required annex of test.
B creates test event and configuration testing step at configurating terminal statement instrument module another name variable, and in fact the configuration testing step is exactly the execution sequence of configure instrument module drive storehouse method.
C sets up the correspondence mappings relation in the test terminal with instrument module another name and actual employed instrument module.
The instrument module drive is loaded in the d test terminal, with instrument module Driver Library dynamic load in PC memory, obtain instrument module and drive dynamic base handle and instrument module driving instance handle, realize the function that instrument module drives by certain method of carrying out instrument module driving example.
In step a, it all is * .dll file that driving method repository, instrument module Management Library Driver, instrument module drive case library.
In steps d, can finish the initialization of instrument module, in the driving method repository, will generate an instrument module container, be used for the management equipment handle; In Management Library Driver, generate an instrument module Driver Library Manage Containers, be used for managing instrument module Driver Library case library and instrument module driving method entry address.
1, the driving method repository in the driving method configuration layer is in order to reach the purpose of unified instrument module driving method interface: adopt the mentality of designing of object factory, mainly comprise five parts: definition driving method base class; Definition derives the derived class (being equivalent to the product model the factory) of instrument module driving method from base class; Method factory; The method generator; The api interface function of external reference driving method.
A mainly comprises the member of the instrument module driving method base class described in the step 1;
A) function parameter is provided with structure
{
Parameter name;
Parameter type;
Number of parameters;
Parameter value;
Parameter unit;
}
B) input parameter container<function parameter is provided with structure 〉
C) output parameter container<function parameter is provided with structure 〉
D) input parameter (input parameter container) is set
E) obtain input parameter (input parameter container)
F) output parameter (output parameter container) is set
G) obtain output parameter (output parameter container)
H) operation
I) initialization
B mainly comprises at the external api interface function of the visit driving method described in the step 1;
A) open (
The instrument module style number,
The instrument module connection string,
The instrument module handle
)
B) close (instrument module style number, instrument module connection string)
C) obtain all driving method titles (method name, method number)
D) obtain a quasi-instrument module drive method title (instrument module style number, method name, method number)
E) create a method (method name, method handle)
F) discharge a method (method handle)
G) the functional description language (method handle, functional description language) of a method is set
H) obtain the functional description language (method handle, functional description language) of a method
I) obtain the input parameter number (method handle, input parameter number) of a method
J) obtain input parameter details (
The method handle,
The input parameter call number,
The input parameter title,
The input parameter type,
The input parameter number,
The input parameter value,
Input parameter unit
)
K) input parameter value (method handle, input parameter call number, input parameter value) is set
L) obtain output parameter number (method handle, output parameter number)
M) obtain output parameter details (
The method handle,
The output parameter call number,
The output parameter title,
The output parameter type,
The output parameter number,
Output parameter value,
Output parameter unit
)
N) an operation method (method handle)
Adopt the basic design of " scalable factory " in the method factory described in the step 1, when adding new " an instrument module driving method derived class " at every turn, needn't revise it code.The function division of instrument module driving method factory is clear, and each new " instrument module driving method " all must be registered factory, and " driving method sign " and " pointer of generating function " passed to it.Usually generating function has only delegation, roughly like this:
BaseClass*CreateDeviceMethod()
{
return?new?DeviceMethod
}
2, the driving method repository that is arranged in the driving method configuration layer is in order to reach the purpose that the instrument module driving method is visible, select configuration: adopt general type design, state that a Map container is used for preserving the instrument module driving method title that all were registered.
3, the instrument module Management Library Driver that is arranged in the instrument module administration and supervision authorities adopts Object-Oriented Design, instrument module connection string according to the configuration of test terminal, load libraries LoadLibrary function by the Microsoft of Microsoft loads instrument module drive case library, and register instrument module Driver Library management Map, and " Driver Library title ", " Driver Library handle " and " instrument module handle " are passed to it.
4, the instrument module driving case library that is arranged in the instrument module Drive Layer adopts Object-Oriented Design thought, adopt the SCPI development specifications, viOpen, viClose, viPrintf, viscanf, functions such as viWrite, viRead by the VISA storehouse send and receive the SCPI instruction, and the instrument module api interface function of standard externally is provided.
Adopt the structural design of this layering, the problem of can process instrumentation module model changing.As seen all Driver Library methods all are, select configuration can reduce development difficulty and raising development efficiency.
The present invention is not limited to aforesaid embodiment.The present invention expands to any new feature or any new combination that discloses in this manual, and the arbitrary new method that discloses or step or any new combination of process.