Sie sind auf Seite 1von 69

Instrument Control

Controlling GPIB, Serial, VXI, PXI, & Compact PCI Instruments

Agenda
Description, History, Technologies, and Future of
GPIB VXI CompactPCI/PXI

About GPIB communication and configuration About LabVIEW instrument drivers How to use instrument driver VIs About Virtual Instrument Software Architecture

How to use the VISA functions


About serial port communication

What is Instrument Control ?


The term instrument control refers to the act of using software on a PC to remotely control an instrument over an instrument control bus

Integral Components of Instrument Control


1. Programmable Instrument 2. Instrument Bus 3. Instrument Control Software

Part-1 : Programmable Instrument

Types of Instruments
1.Conventional Instruments[Standalone] - Manual Control - No Communication Interface 2.Programmable Instruments - Controlled by Instrument specific commands. PC Serial - Remote controlled. Port
RS-232 Cable RS-232 Instrument

Types of Programmable Instruments


Card Based Instruments[Faceless / Naked Instrument]

Programmable Instruments with conventional Front Panel

Difference
Card Based Instruments reside inside PC/Controller cabinet. Control software is the face of the instrument Must.

Programmable Instruments with conventional Front Panel are desktop based. Control software is optional manual control is also possible.

Virtual Instrument
VI is Software face of the programmable instrument. User takes control over the underlying hardware my manipulating VI Software.

Part-2 : Instrument Bus

Instrument Bus Types


Stand alone Buses : used to communicate with rack and stack instruments Eg : RS232,GPIB etc

Modular buses : incorporate the interface bus into the instrument itself Eg : PCI,PXI,VXI

Stand alone Buses :

GPIB

The General Purpose Interface Bus (GPIB) is one of the most common I/O interfaces available in standalone instruments. Originally designed by Hewlett Packard GPIB is a digital, 8-bit parallel communications interface with data transfer rates of up to 8 Mb/s. The bus provides one system controller for up to 14 instruments, and cabling is limited to less than 20 m.

GPIB Hardware Specifications


Defined by IEEE 488.1 24 Lines Cable Specifications
DIO1 DIO2 DIO3 DIO4 EOI DAV NRFD NDAC IFC SRQ ATN SHIELD

1 13

12 24

DIO5 DIO6 DIO7 DIO8 REN GND (TW PAIR W/DAV) GND (TW PAIR W/NRFD) GND (TW PAIR W/NDAC) GND (TW PAIR W/IFC) GND (TW PAIR W/SRQ) GND (TW PAIR W/ATN) SIGNAL GROUND

Max cable length between devices = 4 m (2 m average) Max cable length = 20 m Max number of devices = 15 (2/3 powered on)

Talker/Listener/Controller System Controller/Controller in Charge

GPIB System Configurations


Linear Configuration Star Configuration

Configuring GPIB Board and Instruments

Measurement & Automation Explorer (MAX)

GPIB Configuration with MAX

OBJECTIVE

Use MAX to examine the GPIB board settings and communicate with an instrument.

RS232 Serial Interface for Instruments

Serial Communication
Popular means of communication between computer and peripheral device

Data sent one bit at a time across the cable


Used for low transfer rates or long distances Only a cable is needed since most computers have at least one available serial port
PC Serial Port RS-232 Cable RS-232 Instrument

Serial Hardware Connection


RS-232

DCE or DTE configurations


9-pin or 25-pin
Pin 1 DCD 2 RxD 3 TxD 4 DTR 5 Com 6 DSR 7 RTS 8 CTS 9 RI DTE DCE Input I O O I O I I Output O I I O I O O

RS-422
DCE or DTE 8-pin

RS-485
Multidrop

Serial Communication

Terminology Baud rate bits per second Data bits inverted logic and LSB first Parity optional error-checking bit Stop bits 1, 1.5, or 2 inverted bits at data end Flow control hardware and software handshaking options

Using the Instrument I/O Assistant with Serial


Select COMX as the instrument address Use the I/O Assistant as done with GPIB

Serial VIs and Functions


Found in Serial subpalette under Instrument I/O Based on VISA functions

Serial VIs and functions also work with parallel port communication

Serial I/O Example

Initialize the serial port settings Write commands to the device Read device response Check for errors

Exercise
Serial Write & Read VI

OBJECTIVE

To build a VI that communicates with an RS-232 device.

Part-3 : Instrument Control software

Choose Your Development Software


Instrumentation software designed for test and measurement
LabVIEW Graphical Programming Measurement Studio

General Purpose Software


Other C/C++ environments
MS Visual C/C++, Borland C/C++,

What is the Instrument I/O Assistant?


Accessed through a LabVIEW Express VI Sets up device communication and data parsing step by step through a configuration interface

Communicating with an Instrument

Exercise
Using the Instrument I/O Assistant

OBJECTIVE

Use the Instrument I/O Assistant to communicate with the NI Instrument Simulator.

VXI

www.ni.com

VXI Mechanical Specifications


Four VXIbus Module Sizes
A 3.9 x 6.3 in (VME single-height) B 9.2 x 6.3 in (VME double-height) C 9.2 x 13.4 in D 14.4 x 13.4 in
B C D

VXI Mainframes
Maximum of 13 slots Same sizes as VXI Modules (A, B, C, D) Adapt smaller modules to larger mainframes

VXI Electrical Architecture


Instrument Triggering and Timing Buses

Slot 0 Controller

VXI Instr.

VXI Instr.

Local Bus

VXI Instr.

VXI Instr.

Computer Bus Instrument Buses Slot Identification - MODID

Conclusion The Future of VXI


Well established standard
Especially in high channel count applications, but

Growth challenged by
Cost of VXI Vendor production of new instruments Need for faster test times Smaller instrument solutions Ease of multi-instrument integration New platforms such as PXI and CompactPCI

CompactPCI
PXI and CompactPCI for Measurement and Automation

Filling the Gap


VXI

Price

Desktop PC
Te mp erat ure Flow Co Pr es ntro l Pa ne su l re Alar m Co nd itio ns

Modular Instrumentation for Mainstream Users

ST

OP

Performance

PXI Starts with CompactPCI


CompactPCI puts PC technology in a small, rugged package by combining three standards:

PCI bus

CompactPCI
Eurocard packaging
Better IEC Connectors

Why use Eurocard Packaging?


Proven over decades of use in industrial applications (VME, VXI, etc.) Defined by IEEE 1101 Standard Readily available mechanical components Excellent thermal properties Modular, rugged, and compact

PXI Combines Standard Technologies

CompactPCI
bus

PCI

PXI and PC Software is Identical


Operating systems and application software run unchanged on PXI systems Configuration tools recognize PXI modules as PCI devices

Electrical Extensions
PXI timing and triggering improves performance:
Star Trigger 10 MHz CLK Star Trigger Controller System Controller Peripheral Peripheral Peripheral

Local Bus

132 Mb/s, 33 MHz, 32-bit Computer Bus Trigger Bus

PXI Leverages VXI Features

Timing and Triggering Extensions in PXI and VXI


Local Bus VXI PXI 12 lines 13 lines Triggers Clock 8 TTL, 2 ECL 8 TTL Star Bus 10 MHz ECL 10 MHz TTL D-size only 1 per slot

The CompactPCI Specification Body

PCI Industrial Computer Manufacturers Group


Governs the core CompactPCI specification Focus is on telecommunications infrastructure Online product directory contains 100s of products Over 500 company members

www.picmg.org

The PXI Specification Body

Systems Alliance
Charter of this group is to:
- Promote PXI - Ensure Interoperability - Control the PXI Specification

Focus is on end-user success in measurement and automation Over 50 company members

www.pxisa.org

PXI Systems Alliance Members


Acqiris Advanced Power Designs Advanced Test Methods Alphi Technology AMP Analogic ASCOR ARVOO Engineering ATEME A&T Engineering Tech. Ctr. B&B Technologies BittWare Research Systems Bode Enterprises BRIME C&H Technologies CHROMA ATE Data Patterns Dateppli Datum Dolch Computer Systems GenRad Gespac Goepel Electronic GDE Systems (Marconi) National Instruments Pickering Interfaces PX Instrument Tech. Racal Instruments Rohde and Schwarz Quantum Controls SBS GreenSpring Shaanxi HiTech SRC TestWare Tracewell Systems TTI Testron Vero Electronics (APW) Virginia Panel Corp. ZYNX Schroff Marek Micro ERNI Ballard Technology

GTE-ERS Innovative Integration KineticSystems LeCroy MAC Panel MEN Mikro Elektronik Talon Instruments

MXI-3 Benefits
Tem pe ratu re Flo w Con Pre ss trol Pan el ure Ala

rm

Con

ditio

ns

ST

OP

More slots for PCs and PXI/CompactPCI Very high performance serial link Easy to integrate software transparent Short and L O N G distances Low cost

PXI Modules Link to Other Standards


MXI-3
Stand-alone Instrument PXI System

VXI or VME

GPIB

MXI

CompactPCI
Modules Modules

bus

PCI Bus Performance


High Performance

Leverages computing technology 32-bit data transfers at 33 MHz (132 Mbytes/sec) Reduced measurement time

PCI/PXI Transfer Width (bits) Theoretical Peak Throughput (Mbytes/s) Relative System Price 32 132 $

GPIB 8 1 (3-w ire) 8 (HS488) $$

VXI 32 or 64 40 or 80 $$$

Conclusion The Future of PXI


Complete system specification that extends CompactPCI for Measurement and Automation PXI and CompactPCI are open specifications supported by numerous vendors Hundreds of products are available today for configuring PXI/CompactPCI systems Rapid growth due to
Low cost Faster test times Ease of multi-instrument integration Small size Adoption by other industries (telelecom)

Virtual Instrument Software Architecture


VISA

Serial

GPIB

VXI

PXI

Platform independent VISA is the backbone of the IVI and Plug & Play Instrument Drivers

Interface independent Must know SCPI command set to program directly with VISA

Sample GPIB Code

Sample VISA Code

VISA Terminology
ResourceInstrument, Serial Port, or Parallel Port

SessionConnection to a Resource
Instrument DescriptorResource location Format: Examples: Interface Type::Address::INSTR

Instrument Descriptor Syntax


Resource Name contains interface info VISA Aliases also work Interface Resource Name Grammar Serial GPIB VXI ASRL[board][::INSTR] GPIB[board]::primary address[::INSTR] VXI[board]::VXI logical address[::INSTR]

GPIB-VXI GPIB-VXI[board][::GPIB-VXI primary address]::VXI logical address[::INSTR]

VISA Resource Name


Exact name and location of the instrument Use the VISA Resource Name control (like the DAQ Channel Name control) You can specify the full resource name or the VISA Alias

VISA Functions

Exercise 3
Programming with VISA

OBJECTIVE

To build a VI that reads and writes information from the NI Instrument Simulator using VISA functions.

Instrument Drivers
More than 1200 LabVIEW Instrument drivers Programming simplified to highlevel API

Instrument Drivers
Test Program

Instrument Driver

Low-Level I/O:
- set:vert_div:0.001 Instrument - init:trig:armDriver: etc - ReadWaveform

instrument addressing command string building range checking memory storage data scaling response string parsing

IDNET - Instrument Driver Network


Learn about drivers Get help with developing drivers Submit your driver to the network Download drivers

Installing and Finding Instrument Drivers


Drivers available at ni.com/idnet Install the instrument driver VI Library into LabVIEW 7.0\instr.lib directory Access drivers from FunctionsInputInstrument Drivers subpalette

Instrument Driver Model

Instrument Driver VIs


Initialize
Configure

Action/Status
Data

Utility
Close

Instrument Drivers
Instrument drivers have a similar hierarchy

Instrument Driver VI Tree

Instrument Driver Inputs and Outputs

HP34401A Initialize.vi

Instrument Descriptor VISA Sessions


- A connection or link to a specific instrument - Created after instrument is initialized - Used throughout VI whenever you communicate with that specific instrument

Error cluster

Putting It All Together


VISA Sessions

Error Clusters

Initialize instrument Do operation(s) Close instrument Check error status

Exercise 4
Function Generator VI

OBJECTIVE

To build a VI that uses the Function Generator instrument driver VIs to Generate Output waveforms.

Instrument Drivers
Issues
Performance Inconsistent structure/quality

Additional Expectations
Instrument interchangeability Instrument simulation Simplification of instrument programming Multithreading/parallel testing

Instrument Drivers
Test Program

IVI Class Driver


IVI Specific Driver IVI Specific Driver IVI Specific Driver

Interchangeability Simulation State caching


Traditional

VISA I/O Library IVI

Summary
LabVIEW can communicate with any instrument that connects to your computer if you know the interface type Use the Measurement & Automation Explorer (MAX) to detect, configure, and test your GPIB interface and instruments An instrument driver eliminates the need for your to have detailed knowledge of the specific strings used by an instrument Instrument Library more than 1600 instruments supported Instrument driver VIs share a common hierarchy and come with an example to help you get started VISA a standard protocol for using multiple types of I/O and instrument driver development Serial library contains functions for serial communication You need to know the format of the returned data string in order to convert it to the correct values

Conclusions
GPIB is a defacto standard here to stay

VXI is limited in its general market acceptance


PXI is helping to lower the cost of production test LabVIEW and TestStand lower development time and costs National Instruments is the Leader in Computer-based Measurement and Automation solutions

Das könnte Ihnen auch gefallen