CN105573927A - PXI equipment access method based on VISA (virtual instrument software architecture) - Google Patents

PXI equipment access method based on VISA (virtual instrument software architecture) Download PDF

Info

Publication number
CN105573927A
CN105573927A CN201510946782.2A CN201510946782A CN105573927A CN 105573927 A CN105573927 A CN 105573927A CN 201510946782 A CN201510946782 A CN 201510946782A CN 105573927 A CN105573927 A CN 105573927A
Authority
CN
China
Prior art keywords
pxi
equipment
visa
function
built
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510946782.2A
Other languages
Chinese (zh)
Other versions
CN105573927B (en
Inventor
刘磊
孙建
邱畅
陈庆磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CETC 41 Institute
Original Assignee
CETC 41 Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CETC 41 Institute filed Critical CETC 41 Institute
Priority to CN201510946782.2A priority Critical patent/CN105573927B/en
Publication of CN105573927A publication Critical patent/CN105573927A/en
Application granted granted Critical
Publication of CN105573927B publication Critical patent/CN105573927B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/102Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver

Abstract

The invention discloses a PXI equipment access method based on the VISA (virtual instrument software architecture) and belongs to the technical field of testing. According to the method, a VISA standard library function mechanism is used, information such as equipment manufacturer number, equipment number, sub manufacturer number, sub equipment number, identification number and the like is programmed in a PXI equipment configuration register, and resource descriptors of equipment in a system are acquired automatically by a VISA resource manager according to the information of equipment identification number and the like, so that the PXI equipment is operated and accessed. With the adoption of the method, automatic configuration of PXI equipment resources can be realized, the uniqueness and accuracy of access to the PXI equipment in the system can be guaranteed, the possibility of faulty operation in the manual configuration process is avoided, dysfunctions caused by improper configuration, physical position change and equipment ID conflicts (multiple pieces of identical equipment exist in the system) are avoided, great convenience is brought to users, and the uniqueness and accuracy of access to the PXI module are guaranteed.

Description

A kind of PXI device access method based on VISA
Technical field
The invention belongs to technical field of measurement and test, be specifically related to a kind of PXI device access method based on VISA.
Background technology
PXI is a kind of standard of opening, the index that possesses skills and cost performance is high, function is strong, flexible structure, technology innovation is fast and be easy to the advantages such as the system integration, utilizing PXI product can send desirable measurement and control instrument system by fast open in short-term, is the ideal platform that virtual instrument is built.PXI product has been widely used in the fields such as communication, space flight, military affairs and industrial automation observing and controlling.
VISA is the abbreviation of virtual instrument architecture, is the software interface set that computing machine communicates with between VXI, PXI, GPIB and serial ports instrument etc.VISA, as canonical function, has nothing to do with the I/O interface type of instrument, has nothing to do with operating system and programming language, only need very little amendment, just can from a platform transplantation to another platform.Based on the PXI device access method of VISA, be suitable for the development and application of PXI instrument system.
In PXI equipment R&D process, conventional device access method is the method based on device resource descriptor, based on the method for equipment slots number and the method based on equipment another name.Wherein, the method based on resource descriptor is the most basic method, and additive method is all the change upgradings carried out on the basis of the method for device descriptor.
Most basic method when method based on resource descriptor is device access, but due in PXI cabinet, the PXI equipment of diverse location, resource descriptor is also different, know the resource descriptor of the equipment of required access in the Help of System equipment manager needing user artificial in use or other equipment resource management device software, then directly access equipment by VISA standard library function according to the resource descriptor obtained.
Method based on equipment slots number is the upgrading based on resource descriptor method, but need user by the groove information of eye-observation equipment in use, according to the resource descriptor of the indirect equipments of data such as the configuration of groove position, system template and the initialization files classis.ini of initialization files pxisys.ini and cabinet, and rear is configured by VISA standard library function according to the resource descriptor indirect access devices obtained to cabinet, if changed cabinet or Zero greeve controller, then need to re-start the operations such as cabinet configuration.
Method based on equipment another name needs user to call for equipment adds in equipment resource management device software before first time use equipment, set up the incidence relation of resource descriptor and another name, then VISA standard library function is passed through according to another name access equipment, in fact remain in essence and with resource descriptor, equipment is conducted interviews, when changing cabinet or Zero greeve controller, still need again for equipment increases another name.Above several method, all needs user to participate in layoutprocedure in use, concerning user, not only operates inconvenience, also as easy as rolling off a logly causes the dysfunction of PXI system because of configuration error.
Summary of the invention
For the above-mentioned technical matters existed in prior art, the present invention proposes a kind of PXI device access method based on VISA, the automatic configuration of PXI device resource can be realized by the method, can the uniqueness of PXI device access and accuracy in guarantee system, avoid the dysfunction that equipment causes because of mis-arrange, physical location change and device id conflict (there is polylith identical device situation in system).
To achieve these goals, the present invention adopts following technical scheme:
Based on a PXI device access method of VISA, adopt VISA standard library function, VISA built-in function is defined as follows:
ViOpenDefaultRM (): open the VISA explorer of acquiescence and initialization VISA system, for managing the various kinds of equipment in VISA system;
ViOpen (): open the device resource of specifying according to resource descriptor;
ViClose (): close the device resource and VISA explorer of specifying;
ViFindRsrc (): according to qualified device resource in the condition query VISA system preset, and return the list of devices and number of devices that find;
ViGetAttribute (): the value of equipment specified attribute;
The described PXI device access method based on VISA carries out in accordance with the following steps:
Step 1: the manufacturer of PXI equipment number, device number, sub-manufacturer number, subset number, string programming are entered in the configuration register of PXI equipment;
Step 2: utilize VISA built-in function viOpenDefaultRM () to open VISA explorer;
Step 3: search PXI equipment, obtains the number of devices nDevNum of coupling;
Step 4: according to the lookup result of step 3, obtains the string number of PXI equipment, and automatically obtains the resource descriptor of PXI equipment;
Step 5: the PXI equipment utilizing VISA built-in function viOpen () to open resource descriptor instrDesc to specify, to conduct interviews operation to PXI equipment;
Step 6: access terminates, utilizes VISA built-in function viClose () to close PXI equipment and VISA explorer.
Preferably, in step 1, specifically comprise
Step 1.1: by the address specified in the manufacturer of PXI equipment number, device number, sub-manufacturer number, subset programming to PXI configuration register;
Step 1.2: by the address of reservation that do not use in the string programming of PXI equipment to the configuration register of PXI equipment.
Preferably, in step 3, specifically comprise
Step 3.1: utilize VISA built-in function viFindRsrc () to search PXI equipment according to the manufacturer number of PXI equipment to be visited, device number;
Step 3.2: the resource descriptor instrDesc returning PXI number of devices nDevNum and first the qualified PXI equipment matched, and judge whether the PXI number of devices nDevNum matched equals 0;
If: judged result is that PXI number of devices nDevNum equals 0, illustrates in current system do not have PXI equipment to be visited, then PXI equipment is reinserted and install drive after, then perform step 2;
Or judged result is that PXI number of devices nDevNum equals 1, illustrate in current system and match a qualified PXI equipment, utilize VISA built-in function viGetAttribute () function to obtain the resource descriptor instrDesc of PXI equipment, then perform step 5;
Or judged result is that PXI number of devices nDevNum is greater than 1, illustrate in current system and match multiple qualified PXI equipment, utilize the PXI equipment described by resource descriptor instrDesc obtained in VISA built-in function viOpen () opening steps 3.1.
Preferably, in step 4, specifically comprise
Step 4.1: the Bus number nBusNum, the device number nDevNum and function nFuncNum that obtain PXI equipment according to the resource descriptor instrDesc of PXI equipment, and the address m_CtrlAdd of control register is combined as by shifting function;
Step 4.2: utilize I/O function that configuration register address m_RegAdd and control register address m_CtrlAdd are write 0xCF8 and the 0xCFC port of Windows respectively;
Step 4.3: utilize VISA built-in function viIn32 () to obtain the string nSerialID of corresponding configuration register address m_RegAdd in PXI device configuration register;
Step 4.4: string nSerialID is carried out contrast with the string number of PXI equipment to be visited and mates, and judge that whether coupling is successful;
If: judged result is that the match is successful, returns current resource descriptor instrDesc, then performs step 5;
Or judged result is that it fails to match, utilizes VISA built-in function viFindNext () to obtain the resource descriptor instrDesc of the next PXI equipment found in step 3.2, then perform step 4.1.
The Advantageous Effects that the present invention brings:
The present invention proposes a kind of PXI device access method based on VISA, compared with prior art, a kind of PXI device access method based on VISA, the method utilizes VISA standard library function mechanism, by information such as burn writing equipment manufacturer in PXI device configuration register number, device number, sub-manufacturer number, subset number, strings number, VISA explorer is utilized to wait automatic acquisition of scientific information equipment resource descriptor in systems in which according to equipment string number, thus to PXI operate and access; The automatic configuration of PXI device resource can be realized by the method, can the uniqueness of PXI device access and accuracy in guarantee system, avoid the faulty operation possibility in manual configuration procedures, avoid the dysfunction that equipment causes because of mis-arrange, physical location change and device id conflict (there is polylith identical device situation in system), both facilitate user, in turn ensure that uniqueness and the accuracy of PXI module accesses.
Accompanying drawing explanation
Fig. 1 is the FB(flow block) of a kind of PXI device access method based on VISA of the present invention.
Embodiment
Below in conjunction with accompanying drawing and embodiment, the present invention is described in further detail:
As shown in Figure 1, a kind of PXI device access method based on VISA, this method adds the process automatically obtaining resource descriptor in based on resource descriptor method, and adopt VISA standard library function, VISA built-in function is defined as follows:
ViOpenDefaultRM (): open the VISA explorer of acquiescence and initialization VISA system, is used for managing the various kinds of equipment in VISA system;
ViOpen (): open the device resource of specifying according to resource descriptor;
ViClose (): close the device resource and VISA explorer of specifying;
ViFindRsrc (): according to qualified device resource in the condition query VISA system preset, and return the list of devices and number of devices that find;
ViGetAttribute (): the value of equipment specified attribute.
Concrete treatment scheme is as follows:
Step 1: by the manufacturer of unique PXI equipment number, device number, sub-manufacturer number, subset number, string programming in PXI device configuration register, the address wherein specified in manufacturer number, device number, sub-manufacturer number, subset programming to PXI configuration register, in the reserved address do not used in string programming to PXI configuration register, as 0xFC address, i.e. configuration register address m_RegAdd;
The configuration register of the PXI equipment that desktop shows is as follows:
Step 2: utilize VISA built-in function viOpenDefaultRM () to open VISA explorer;
Step 3: utilize VISA built-in function viFindRsrc () to search equipment according to manufacturer number, device number, and return the resource descriptor instrDesc of number of devices nDevNum and first the qualified equipment matched;
Step 4: if nDevNum equals 0, illustrates in current system do not have equipment to be visited, PXI equipment is inserted and install drive after return step 2 and operate;
Step 5: if nDevNum equals 1, illustrates in current system and matches a qualified PXI equipment, utilize the resource descriptor instrDesc of VISA built-in function viGetAttribute () function equipment, enter step 11;
Step 6: if nDevNum is greater than 1, illustrates in current system and matches multiple qualified PXI equipment, utilizes the equipment described by device resource descriptor instrDesc obtained in VISA built-in function viOpen () opening steps 3;
Step 7: obtain Bus number nBusNum, device number nDevNum and function nFuncNum according to device resource descriptor instrDesc, and be combined as the address m_CtrlAdd of control register by shifting function;
Step 8: utilize I/O function that configuration register address m_RegAdd and control register address m_CtrlAdd are write 0xCF8 and the 0xCFC port of Windows respectively;
Step 9: utilize VISA built-in function viIn32 () to obtain the string nSerialID of corresponding configuration register address m_RegAdd in PXI device configuration register;
Step 10: nSerialID is carried out contrast with the string number of equipment to be visited and mates, if the match is successful, returns current resource descriptor instrDesc, enters step 11; If it fails to match, utilize VISA built-in function viFindNext () to obtain the resource descriptor instrDesc of the next equipment found in step 3, after opening, enter step 7;
Step 11: the equipment utilizing VISA built-in function viOpen () to open resource descriptor instrDesc to specify, to conduct interviews operation to equipment;
Step 12: access terminates, and utilizes VISA built-in function viClose () closing device and VISA explorer.
A kind of PXI device access method based on VISA of the present invention, by burn writing equipment manufacturer number in PXI device configuration register, device number, sub-manufacturer number, subset number, string number etc. information, VISA built-in function is utilized to achieve the automatic configuration in systems in which of PXI device resource, avoid the faulty operation possibility in manual configuration procedures, avoid equipment because of mis-arrange, the dysfunction that physical location change and device id conflict (there is polylith identical device situation in system) cause, both user was facilitated, in turn ensure that uniqueness and the accuracy of PXI module accesses.
Certainly, above-mentioned explanation is not limitation of the present invention, and the present invention is also not limited in above-mentioned citing, and the change that those skilled in the art make in essential scope of the present invention, remodeling, interpolation or replacement also should belong to protection scope of the present invention.

Claims (4)

1., based on a PXI device access method of VISA, adopt VISA standard library function, VISA built-in function is defined as follows:
ViOpenDefaultRM (): open the VISA explorer of acquiescence and initialization VISA system, for managing the various kinds of equipment in VISA system;
ViOpen (): open the device resource of specifying according to resource descriptor;
ViClose (): close the device resource and VISA explorer of specifying;
ViFindRsrc (): according to qualified device resource in the condition query VISA system preset, and return the list of devices and number of devices that find;
ViGetAttribute (): the value of equipment specified attribute;
ViIn32 (): read 32 bit data from the address space of specifying;
It is characterized in that: the described PXI device access method based on VISA carries out in accordance with the following steps:
Step 1: the manufacturer of PXI equipment number, device number, sub-manufacturer number, subset number, string programming are entered in the configuration register of PXI equipment;
Step 2: utilize VISA built-in function viOpenDefaultRM () to open VISA explorer;
Step 3: search PXI equipment, obtains the number of devices nDevNum of coupling;
Step 4: according to the lookup result of step 3, obtains the string number of PXI equipment, and automatically obtains the resource descriptor of PXI equipment;
Step 5: the PXI equipment utilizing VISA built-in function viOpen () to open resource descriptor instrDesc to specify, to conduct interviews operation to PXI equipment;
Step 6: access terminates, utilizes VISA built-in function viClose () to close PXI equipment and VISA explorer.
2. the PXI device access method based on VISA according to claim 1, is characterized in that:
In step 1, specifically comprise
Step 1.1: by the address specified in the manufacturer of PXI equipment number, device number, sub-manufacturer number, subset programming to PXI configuration register;
Step 1.2: by the address of reservation that do not use in the string programming of PXI equipment to the configuration register of PXI equipment.
3. the PXI device access method based on VISA according to claim 1, is characterized in that:
In step 3, specifically comprise
Step 3.1: utilize VISA built-in function viFindRsrc () to search PXI equipment according to the manufacturer number of PXI equipment to be visited, device number;
Step 3.2: the resource descriptor instrDesc returning PXI number of devices nDevNum and first the qualified PXI equipment matched, and the PXI number of devices nDevNum that judgement matches;
If: judged result is that PXI number of devices nDevNum equals 0, illustrates in current system do not have PXI equipment to be visited, then PXI equipment is reinserted and install drive after, then perform step 2;
Or judged result is that PXI number of devices nDevNum equals 1, illustrate in current system and match a qualified PXI equipment, utilize VISA built-in function viGetAttribute () function to obtain the resource descriptor instrDesc of PXI equipment, then perform step 5;
Or judged result is that PXI number of devices nDevNum is greater than 1, illustrate in current system and match multiple qualified PXI equipment, utilize the PXI equipment described by resource descriptor instrDesc obtained in VISA built-in function viOpen () opening steps 3.1.
4. the PXI device access method based on VISA according to claim 1, is characterized in that:
In step 4, specifically comprise
Step 4.1: the Bus number nBusNum, the device number nDevNum and function nFuncNum that obtain PXI equipment according to the resource descriptor instrDesc of PXI equipment, and the address m_CtrlAdd of control register is combined as by shifting function;
Step 4.2: utilize I/O function that configuration register address m_RegAdd and control register address m_CtrlAdd are write 0xCF8 and the 0xCFC port of Windows respectively;
Step 4.3: utilize VISA built-in function viIn32 () to obtain the string nSerialID of corresponding configuration register address m_RegAdd in PXI device configuration register;
Step 4.4: string nSerialID is carried out contrast with the string number of PXI equipment to be visited and mates, and judge that whether coupling is successful;
If: judged result is that the match is successful, returns current resource descriptor instrDesc, then performs step 5;
Or judged result is that it fails to match, utilizes VISA built-in function viFindNext () to obtain the resource descriptor instrDesc of the next PXI equipment found in step 3.2, then perform step 4.1.
CN201510946782.2A 2015-12-17 2015-12-17 A kind of PXI device access methods based on VISA Active CN105573927B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510946782.2A CN105573927B (en) 2015-12-17 2015-12-17 A kind of PXI device access methods based on VISA

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510946782.2A CN105573927B (en) 2015-12-17 2015-12-17 A kind of PXI device access methods based on VISA

Publications (2)

Publication Number Publication Date
CN105573927A true CN105573927A (en) 2016-05-11
CN105573927B CN105573927B (en) 2018-03-13

Family

ID=55884088

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510946782.2A Active CN105573927B (en) 2015-12-17 2015-12-17 A kind of PXI device access methods based on VISA

Country Status (1)

Country Link
CN (1) CN105573927B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101944026A (en) * 2010-09-21 2011-01-12 中国人民解放军63961部队 Implementation method of universal virtual instrument interface
CN102004952A (en) * 2010-11-03 2011-04-06 北京普源精电科技有限公司 Measuring resource control system and measuring resource control method
CN102467090A (en) * 2010-11-16 2012-05-23 北京普源精电科技有限公司 Measurement resource control method and measurement resource control system
CN105159811A (en) * 2015-07-16 2015-12-16 中国电子科技集团公司第四十一研究所 Same-type PXI test module identification method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101944026A (en) * 2010-09-21 2011-01-12 中国人民解放军63961部队 Implementation method of universal virtual instrument interface
CN102004952A (en) * 2010-11-03 2011-04-06 北京普源精电科技有限公司 Measuring resource control system and measuring resource control method
CN102467090A (en) * 2010-11-16 2012-05-23 北京普源精电科技有限公司 Measurement resource control method and measurement resource control system
CN105159811A (en) * 2015-07-16 2015-12-16 中国电子科技集团公司第四十一研究所 Same-type PXI test module identification method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
MENGYI ZHAO ET.AL.: ""Network Agent based on VISA framework for Instruments"", 《APPLIED MECHANICS AND MATERIALS》 *
周勇等: ""利用VISA实现VXI设备底层访问"", 《计算机测量与控制》 *

Also Published As

Publication number Publication date
CN105573927B (en) 2018-03-13

Similar Documents

Publication Publication Date Title
CN103914324B (en) A kind of method and its system of automatic programming embedded device firmware
CN108228209A (en) Automatically update the system, method and medium of the firmware of the element of server system
CN106933508B (en) Application container migration method and device
CN102722458B (en) I/ O (input/output) remapping method and device for plurality of shared systems
CN104702588A (en) Parser, packet processing apparatus and method
CN105224459B (en) A kind of method that test b MC reads and writes BIOS configuration features by OEM orders under LINUX platforms
US20120272226A1 (en) Control panel and firmware updating method
US9213676B2 (en) Hardware device name resolution for deterministic configuration in a network appliance
CN103905231B (en) To the method and apparatus of device type unified management
US9311019B2 (en) Storage system and method for accessing logical volumes
CN104424044A (en) Server system
CN106789363A (en) A kind of method and device to virtual machine configuration network interface card
CN105717986B (en) The operating method of arithmetic element and its system and computer
CN103942088B (en) A kind of method for obtaining virtual machine USB storage device service condition
US20120215925A1 (en) Managing IPMI Sessions
US8990443B2 (en) Computer system and management server
CN105573927A (en) PXI equipment access method based on VISA (virtual instrument software architecture)
CN109474475B (en) Switching system of dual-redundancy network card under windows XPE
CN109728915B (en) Switching method of dual-redundancy network card under windows XPE
CN107153561A (en) The method of firmware, apparatus and system in a kind of renewal expansion card
CN106095459B (en) Implementation method for automatically finishing selection and specialization of embedded software library
CN106815163B (en) Have the System on Chip/SoC and its PCI-E root port controller of warm connection function
US8478580B1 (en) Model driven command language translator
US20180278472A1 (en) System and method for performing mass renaming of list of items at run-time with variable differentiation factor
CN109144491A (en) Microcomputer development platform

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant