Ch.

3
Computer Interfacing

1

Data Acquisition (DAQ)
• Measuring a real-world signal and bringing that information into the computer. • LabVIEW can command plug-in DAQ boards to acquire (A/D conversion) or generate (D/A conversion) analog and digital signals.

2

Data Acquisition (DAQ)

• A DAQ system
3

DAQ boards

4

E. analog-to-digital converter (ADC). We need to determine what kind of signal conditioning. voltage and frequency response. you need to know about your sensors: – Nature of the produced signals. – What happens if you turn off your data acquisition equipment while the sensor still has power applied? Will there be damage to any components? 6 .g. etc. • E. or other hardware are needed. – You need to know how to calibrate the sensor because the calibration may be nonlinear or it may have problems with repeatability. thermocouple—converts temperature to a voltage.g. 5 Sensors • For data acquisition.Transducers • Converting one physical phenomenon to an electrical signal.

This is because most actuators produce responses in the physical system that may be nonlinear and sometimes unpredictable. pressure or position. 8 . • Required when you need to control something such as temperature.Data acquisition • A general sensor model 7 Actuators • Converting a signal into a physical phenomenon. • You may often see there are feedback control loops associated with the actuators.

• VISA can control GPIB or serial instruments.Virtual Instrumentation Software Architecture (VISA) • A standard I/O Application Programming Interface (API). • Independent of the hardware protocol or bus. 9 VISA • Instrument I/O control >> VISA palette. 10 .

VISA 11 VISA 12 .

• Many instruments and computers can be connected to the same GPIB bus. • It is a digital. • It is the means by which computers and instruments transfer data. 13 GPIB 14 .General Purpose Interface Bus (GPIB) • Complies with IEEE-488 standard. 24-conductor parallel bus.

7 signal ground return. 3 handshake lines.General Purpose Interface Bus (GPIB) • A typical GPIB system 15 GPIB • Connects a maximum of 15 devices. 1 main ground return. 16 . and 5 interface management lines. • Consists of 16 signal lines. • 16 signal lines—8 data lines.

frequency counters.g. a computer with an appropriate I/O card. printers. E.g. E. digital voltmeters. display devices. E. • Controller—a device which controls the flow of data information on the bus and can issue special commands for bus management. 18 . • Talker—a device capable of transmitting data over the interface when addressed.g.GPIB 17 GPIB • Listener—a device capable of receiving data over the interface when addressed.

• Technique is characterized by: – Asynchronous data transfer. – More than one device can accept data at the same time. with the 8th bit as a parity check. • DIO1 is LSB. – Every byte transferred undergoes the handshake (except for parallel poll response). NDAC. 19 GPIB—Handshake Lines • 3 handshake lines (NRFD.GPIB—Data Lines • DIO1 through DIO8 are used for data transfer in the form of a sequence of 8-bit characters (bytes). DAV) control the transfer of message bytes among the devices and ensure data transfer integrity. addresses. and device dependent data. • ASCII 7-bit code is generally used. 20 . • Information transferred includes interface commands.

21 GPIB—Handshake Lines 22 . on the DIO lines.GPIB—Handshake Lines • NRFD (Not Ready For Data)—used to indicate the condition of readiness of device to accept data. • NDAC (Not Data Accepted)—used to indicate the acceptance of data by device. • DAV (Data Valid)—used to indicate the condition of the info.

– When ON.GPIB—Interface Management Lines • The remaining 5 lines comprise the control bus. • REN (Remote ENable)—the line is used by the System Controller to enable devices to be subsequently places in the remote programming mode. are placed in remote. – When FALSE. – When OFF. 24 . • ATN (ATtentioN) function—the controller alone drives the ATN line and all devices must monitor ATN at all time. all listeners if capable. devices return to local front panel operation. it places the interface in the DATA MODE where the active talker sources device dependent DATA to all active listeners. 23 GPIB—Interface Management Lines • IFC (InterFace Clear)—the line is used by the System Controller to halt current operations (communications) on the bus. – When TRUE. ATN places the interface in the COMMAND MODE where all devices accept data on the Data Lines and interpret it as COMMANDS or ADDRESSES.

GPIB—Interface Management Lines • SRQ (Service ReQuest)—the line is used to indicate the need for attention. selecting LabVIEW<->GPIB. 25 GPIB in LabVIEW • Instrument I/O control >> GPIB palette. the lines is used by an active talker to indicate the last byte of a data message. which is 0~30. • You must provide the address of the instrument (in string format) in order to communicate between the GPIB VIs. • EOI (End Or Identity): – When ATN is TRUE. and can act as an interruption of the current sequence of events.llb. the EOI line is used by a controller to execute a parallel poll. • Example in LabVIEW— Open>>LABVIEW\examples\INSTR\smplg pib. • All GPIB instruments have an address. – When ATN is FALSE.vi 26 .

• It uses a transmitter to send data 1 bit at a time in a single communication line to a receiver. 28 .GPIB 27 Serial Communication • Another popular means of transmitting data between computers or a peripheral device.

• No need for additional hardware. 29 RS-232 • A typical serial communication system 30 .RS-232 • RS-232—built-in serial port • Slower and less reliable than GPIB.

• Widely-used nowadays. 31 USB connected to GPIB 32 .Universal Serial Bus (USB) • USB—build-in serial port. • More complex protocol.

GPIB 33 USB connected to RS-232 34 .

Instrument Drivers • A collection of functions that implement the commands necessary to perform the instrument’s operations.com/labview/ – Share data through the Internet. Free VIs. • They receive. parse. • Instrument I/O >> Instrument Drivers 35 Connectivity • Internet Connectivity – http://ni. 36 . and scale the response strings from instruments into scaled data. LabVIEW Demo… • Networking – Separate computers communicate through LAN or the Internet.

38 .Connectivity • ActiveX – A piece of code can be shared in different application. A Word document can be embedded in LabVIEW VI. 37 Connectivity • Dynamic Link Libraries (DLLs). – E. Code Interface Node (CINs) – DLL • A library of shared functions • Done at runtime – CIN • A special block diagram structure • Used to link conventional. text-based code to a VI.g.

• Most-significant bit (MSB)—leftmost bit on the pattern.g.Digital I/O • Port—a collection of digital lines that are configured in the same direction and can be used at the same time. of lines in a port. 1001. e. • Least-significant bit (LSB)—rightmost bit on the pattern. • State—1 or 0. 40 . 39 Digital I/O • Port width—no. • Pattern—a sequence of digital states.

Sign up to vote on this title
UsefulNot useful