03 Interfacesmm
-
Upload
akhil-agarwal -
Category
Documents
-
view
217 -
download
0
Transcript of 03 Interfacesmm
-
7/28/2019 03 Interfacesmm
1/20
1
Ch. 3
Computer Interfacing
2
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 anddigital signals.
-
7/28/2019 03 Interfacesmm
2/20
3
Data Acquisition (DAQ)
A DAQ system
4
DAQ boards
-
7/28/2019 03 Interfacesmm
3/20
5
Transducers
Converting one physical phenomenon toan electrical signal.
E.g. thermocoupleconverts temperature
to a voltage.
6
Sensors
For data acquisition, you need to know aboutyoursensors: Nature of the produced signals. E.g. voltage and
frequency response. We need to determine what kindof signal conditioning, analog-to-digital converter(ADC), or other hardware are needed.
You need to know how to calibrate the sensorbecause the calibration may be nonlinear or it mayhave problems with repeatability, etc.
What happens if you turn off your data acquisitionequipment while the sensor still has power applied?Will there be damage to any components?
-
7/28/2019 03 Interfacesmm
4/20
7
Data acquisition
A general sensor model
8
Actuators
Converting a signal into a physical phenomenon.
Required when you need to control something
such as temperature, pressure or position.
You may often see there are feedback control
loops associated with the actuators. This isbecause most actuators produce responses in
the physical system that may be nonlinear and
sometimes unpredictable.
-
7/28/2019 03 Interfacesmm
5/20
9
Virtual Instrumentation Software
Architecture (VISA)
A standard I/O Application ProgrammingInterface (API).
Independent of the hardware protocol or
bus.
VISA can control GPIB or serial
instruments.
10
VISA
Instrument I/O control >> VISA palette.
-
7/28/2019 03 Interfacesmm
6/20
11
VISA
12
VISA
-
7/28/2019 03 Interfacesmm
7/20
13
General Purpose Interface Bus
(GPIB)
Complies with IEEE-488 standard. It is a digital, 24-conductor parallel bus.
It is the means by which computers and
instruments transfer data.
Many instruments and computers can be
connected to the same GPIB bus.
14
GPIB
-
7/28/2019 03 Interfacesmm
8/20
15
General Purpose Interface Bus
(GPIB)
A typical GPIB system
16
GPIB
Connects a maximum of 15 devices.
Consists of 16 signal lines, 7 signal ground
return, 1 main ground return.
16 signal lines8 data lines, 3 handshake
lines, and 5 interface management lines.
-
7/28/2019 03 Interfacesmm
9/20
17
GPIB
18
GPIB
Listenera device capable of receiving dataover the interface when addressed. E.g. printers,display devices.
Talkera device capable of transmitting dataover the interface when addressed. E.g.
frequency counters, digital voltmeters. Controllera device which controls the flow of
data information on the bus and can issuespecial commands for bus management. E.g. acomputer with an appropriate I/O card.
-
7/28/2019 03 Interfacesmm
10/20
19
GPIBData Lines
DIO1 through DIO8 are used for datatransfer in the form of a sequence of 8-bitcharacters (bytes).
Information transferred includes interfacecommands, addresses, and devicedependent data.
ASCII 7-bit code is generally used, with
the 8th bit as a parity check. DIO1 is LSB.
20
GPIBHandshake Lines
3 handshake lines (NRFD, NDAC, DAV) control
the transfer of message bytes among the
devices and ensure data transfer integrity.
Technique is characterized by:
Asynchronous data transfer. More than one device can accept data at the same
time.
Every byte transferred undergoes the handshake
(except for parallel poll response).
-
7/28/2019 03 Interfacesmm
11/20
21
GPIBHandshake Lines
NRFD (Not Ready For Data)used toindicate 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. on the DIO lines.
22
GPIBHandshake Lines
-
7/28/2019 03 Interfacesmm
12/20
23
GPIBInterface Management
Lines
The remaining 5 lines comprise the control bus. ATN (ATtentioN) functionthe controller alone
drives the ATN line and all devices must monitorATN at all time. When ON, ATN places the interface in the
COMMAND MODE where all devices accept data onthe Data Lines and interpret it as COMMANDS orADDRESSES.
When OFF, it places the interface in the DATA MODE
where the active talker sources device dependentDATA to all active listeners.
24
GPIBInterface ManagementLines
IFC (InterFace Clear)the line is used by theSystem Controller to halt current operations(communications) on the bus.
REN (Remote ENable)the line is used by theSystem Controller to enable devices to be
subsequently places in the remote programmingmode. When TRUE, all listeners if capable, are placed in
remote.
When FALSE, devices return to local front paneloperation.
-
7/28/2019 03 Interfacesmm
13/20
25
GPIBInterface Management
Lines
SRQ (Service ReQuest)the line is usedto indicate the need for attention, and canact as an interruption of the currentsequence of events.
EOI (End Or Identity): When ATN is TRUE, the EOI line is used by a
controller to execute a parallel poll.
When ATN is FALSE, the lines is used by anactive talker to indicate the last byte of a datamessage.
26
GPIB in LabVIEW
Instrument I/O control >> GPIB palette.
All GPIB instruments have an address,which is 0~30.
You must provide the address of the
instrument (in string format) in order tocommunicate between the GPIB VIs.
Example in LabVIEWOpen>>LABVIEW\examples\INSTR\smplgpib.llb, selecting LabVIEWGPIB.vi
-
7/28/2019 03 Interfacesmm
14/20
27
GPIB
28
Serial Communication
Another popular means of transmitting
data between computers or a peripheral
device.
It uses a transmitter to send data 1 bit at a
time in a single communication line to areceiver.
-
7/28/2019 03 Interfacesmm
15/20
29
RS-232
RS-232built-in serial port Slower and less reliable than GPIB.
No need for additional hardware.
30
RS-232
A typical serial communication system
-
7/28/2019 03 Interfacesmm
16/20
31
Universal Serial Bus (USB)
USBbuild-in serial port. More complex protocol.
Widely-used nowadays.
32
USB connected to GPIB
-
7/28/2019 03 Interfacesmm
17/20
33
GPIB
34
USB connected to RS-232
-
7/28/2019 03 Interfacesmm
18/20
35
Instrument Drivers
A collection of functions that implementthe commands necessary to perform the
instruments operations.
They receive, parse, and scale the
response strings from instruments into
scaled data.
Instrument I/O >> Instrument Drivers
36
Connectivity
Internet Connectivity
http://ni.com/labview/
Share data through the Internet, Free VIs,
LabVIEW Demo
Networking
Separate computers communicate through
LAN or the Internet.
-
7/28/2019 03 Interfacesmm
19/20
37
Connectivity
ActiveX A piece of code can be shared in different
application.
E.g. A Word document can be embedded in
LabVIEW VI.
38
Connectivity
Dynamic Link Libraries (DLLs), 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.
-
7/28/2019 03 Interfacesmm
20/20
39
Digital I/O
Porta collection of digital lines that areconfigured in the same direction and can be
used at the same time.
40
Digital I/O
Port widthno. of lines in a port.
State1 or 0.
Patterna sequence of digital states, e.g.
1001.
Least-significant bit (LSB)rightmost bit
on the pattern.
Most-significant bit (MSB)leftmost bit on
the pattern.