beautypg.com

R - data ready, Caution – Measurement Computing Digital488/80A User Manual

Page 72

background image

R - Data Ready

SYNTAX

Rn

Define mode

n

of digital input port data to be latched, where

n = 0

,

1

, or

2

.

R0

(Default) Define data to be not latched, and to be read whenever the

Digital488/80A is addressd.

R1

Define data to be latched on an EDR transition.

R2

Define data to be latched and buffered on an EDR transition.

R?

Returns current Data Ready mode

n

.

Note:

EDR cannot be used to capture data in the

F5

high-speed binary format.

DESCRIPTION

The Data Ready (

R

) command enables digital input port data to be latched. When used in conjunction with the Service

Request Mask (

M

) command

M2

, the External Data Ready (EDR) line can both latch the input data and generate a

Service Request (

SRQ

) to signal the controller that new data is available.


In the default mode

R0

, data is read when the Digital488/80A is addressed to Talk.


In mode

R1

, the Digital488/80A unit waits for an EDR transition on the selected channel before latching the data and

formatting the data for output. If the unit is addressed to Talk before EDR is asserted, the bus hangs up until the EDR
pulse occurs. Once EDR is asserted, the data remains latched until the unit is addressed to Talk, and the data is read
by the controller. If EDR transitions again before the previous EDR buffered data has been read, the Digital488/80A
generates an Internal Data Buffer Overrun (

E6

) and ignores the EDR read request. The Inhibit line is asserted once

for each data read operation for all Data Format (

F

) modes, except high-speed binary mode

F5

.


In mode

R2

, successive readings (up to 2000) may be latched and stored in the internal data buffer. The number of

readings in the buffer may be found using the Buffer (

L

) command query

L?

. The EDR and Inhibit lines function in this

mode in the same manner as in mode

R1

. If an attempt is made to store more than 2000 readings in the internal

buffer, the Digital488/80A generates an Internal Data Buffer Overrun (

E6

).


The EDR signal must be at least 1.0 microsecond wide and should have a rise-and-fall time of less than 1.0
microsecond. The EDR line defaults to rising-edge sensitive, but can be changed to falling-edge sensitive with the
Invert (

I

) command

I32

. The EDR line cannot be used to capture data in the Data Format (

F

) mode

F5

.

CAUTION

Because the Configuration (C) command is used, the following programming
example(s) will not work properly if the HVCX1 option is installed with a conflicting
hardware configuration. To be safe, remove the HVCX1 board and replace it with the
jumper board to run the example(s).

EXAMPLE 1

PRINT#1,"CLEAR08"

Line 1: Reset the Digital488/80A.

PRINT#1,"OUTPUT08;R1X"

Line 2: Data is read only after a rising-edge signal is applied to the

EDR line (only one reading is stored in the buffer and must be read
before another reading can be taken).

EXAMPLE 2

PRINT#1,"CLEAR08"

Line 1: Reset the Digital488/80A.

DIM B$(100)

Line 2: Dimension an array to store buffered data.

PRINT#1,"OUTPUT08;C0P0X"

Line 3: Configure all 5 ports as inputs; select all 5 ports.

PRINT#1,"OUTPUT08;R2X"

Line 4: Data is latched and buffered on an EDR transition.

PRINT#1,"OUTPUT08;G3X"

Line 5: Buffered I/O data is sent when unit is addressed to Talk.

FOR I = 1 TO 50

Line 6: Fifty readings (one reading per EDR transition) are taken and

stored in the internal buffer.

PRINT#1,"ENTER08",

Line 7: Read the internal buffer and store the data in the array.

INPUT#2,B$(I),

NEXT I,

66 Digital488/80A Commands

967695

Digital488/80A User's Manual