GPIB tutorial - SRM University

advertisement
GPIB By
S.Senthilmurugan
Asst.Professor/ICE
SRM University. Chennai.
Parallel interfaces in DAQ
• GPIB (tutorial according to Agilent and National Instruments sources)
• Parallel port
• Non‐standard interfaces (see lectures on multifunction plug‐in boards)
• System and computer busses – PCI, VXI, ... (see lectures on plug‐in boards)
History
• 1965 Hewlett‐Packard designsHP‐IB for instrumentation systems
• 1975 HP‐IB becomes IEEE 488standard
• 1987 IEEE 488.2 adopted; IEEE 488‐1978 becomes IEEE 488.1‐1987
• 1992 SCPI Specification introducedfor IEEE 488 instruments
• 1990 IEEE 488.2 Standard revised
• 1993 National Instruments proposes high‐speed extensions to IEEE 488.1 called HS488
Basic characteristics
• Any instrument can be used
• Each instruments (up to 15) has its unique address within range 0‐31 in basic addressing mode
• Linear or star cable configuration
– 24/25 wires
– 3 types of connectors (Amphenol CHAMP or Cinch Series 57 MICRO RIBBON type)
– Total length of cable 20m, max. 4m per instrument
• TTL levels, negative logic, drivers: 3‐state or open collector (NDAC, NRFD, SRQ)
Types of GPIB messages
• Communication is based on various “messages”:
– Device‐dependent messages related (mainly) to the instrument measuring functions
– Interface messages (command messages ≠ commands as some device dependant messages according IEEE488.2) related to the communication (interface) functions
Main communication functions
• System Controller and Active Controller – controls communication, send interface messages, e.g. monitors bus activities, addresses (enables) instruments, etc.
• Listener receives the device ‐dependent messages
• Talker sends the device ‐dependent messages
Simple system does not need controller – the device work always in the modes talk‐only and listen‐only
Interface Signals and Lines
• Data bus (8 lines) similar to any computer data bus: commands/data
• Handshaking lines = asynchronous control of transfer on DIO
• Interface management lines = control of some interface functions
Handshaking (HS) lines
• NRFD (Not Ready for Data) – Acceptor of HS
• NDAC (Not Data Accepted) – Acceptor of HS
• DAV (Data Valid) – Source of HS
Interface Management Lines
• ATN (Attention) ‐ controller drives ATN true when it uses the DIO to send commands, and false when a Talker can send data messages.
• EOI (end or identify) – two purposes:
– Talker: to mark the end of a message string, – Controller: to tell devices to identify their response in a parallel poll.
• IFC (interface clear) – The System Controller drives the IFC line to initialize the bus and become CIC.
• REN (remote enable) – The System Controller drives the REN line to place devices in remote or local program mode.
• SRQ (service request) – Any device can drive the SRQ line to asynchronously request service from the Controller.
IEEE 488.2 and SCPI
• 488.1 (1975) – missing mainly: definition of data formats, status reporting, message exchange protocol, common configuration commands, device‐
specific commands, etc.
• 488.2 (1987) arisen from 488.1 (compatible), software oriented, increases data format compatibility, status reporting and error handling
• SCPI – device‐specific commands coming from generalized instrument model
Comparison of IEEE 488.1 488.2 and SCPI
IEEE 488.2 Mandatory Controller Seq.
Description
Control Sequence
Send ATN-true commands
SEND COMMAND
Set address to send data
SEND SETUP
Send ATN-false data
SEND DATA BYTES
Send a program message
SEND
Set address to receive data
RECEIVE SETUP
Receive ATN-false data
RECEIVE RESPONSE MESSAGE
Receive a response message
RECEIVE
Pulse IFC line
SEND IFC
Place devices in DCAS
DEVICE CLEAR
Place devices in local state
ENABLE LOCAL CONTROLS
Place devices in remote state
ENABLE REMOTE
Place dev. in remote with local lockout state
SET RWLS
Place devices in local lockout state
SEND LLO
Read IEEE 488.1 status byte
READ STATUS BYTE
Send group execution trigger (GET) message TRIGGER
IEEE 488.2 Controller Protocols
Keyword
Name
Compliance
RESET
Reset System
Mandatory
FINDRQS
Find Device Requesting
Service
Optional
ALLSPOLL
Serial Poll All Devices
Mandatory
PASSCTL
Pass Control
Optional
REQUESTCTL Request Control
Optional
FINDLSTN
Find Listeners
Optional
SETADD
Set Address
Optional, but requires
FINDLSTN
TESTSYS
Self-Test System
Optional
IEEE 488.2 Instruments
• Minimal set of interface capabilities of each device:
– To send and receive data (T5, T6, TE5, TE6, L3, L4, LE3, LE4, AH1, SH1)
– To request service (SR1)
– To respond to a device clear (DC1)
+ other capabilities are optional:
RL0/RL1; PP0/PP1; DT0/DT1; E1/E2; C0/C in some version.
IEEE 488.2 Common Commands
Mnemonic
Group
Description
*IDN?
System Data
Identification query
*RST
Internal Operations
Reset
*TST?
Internal Operations
Self-test query
*OPC
Synchronization
Operation complete
*OPC?
Synchronization
Operation complete query
*WAI
Synchronization
Wait to complete
*CLS
Status and Event
Clear status
*ESE
Status and Event
Event status enable
*ESE?
Status and Event
Event status enable query
*ESR?
Status and Event
Event status register query
*SRE
Status and Event
Service request enable
*SRE?
Status and Event
Service request enable query
*STB?
Status and Event
Read status byte query
IEEE 488.2 Device Status Model
SCPI Instrument Model
Parallel port – IEEE1284
• Primary 8‐bits interface for connecting printers (Centronics)
• 1994 – the first standard IEEE 1284:
– Standard (centronics compatible) parallel port (SPP): one way data lines + 3‐wire handshaking + additional status, control lines – very simple: transfer fully controlled by software (microprocessor)
– EPP
– ECP
Enhanced parallel port
• Bidirectional data lines
• Similar to microcontroller bus communication (addressing registers in printer and in PC, then data transfer)
• Transfer rate up to 10MB/s
• Data transfer partially controlled by PC hardware
Extended capabilities parallel port
• Bidirectional data transfer fully supported by PC hardware (data and address written to the register in PC are automatically send to the printer
• Networking (daisy chain: input = host and output =pass trough connectors)
Parallel port is used for some low cost DAQ devices
Download