beautypg.com

L - buffer…… 61, L - buffer, Caution – Measurement Computing Digital488/80A User Manual

Page 67

background image

L - Buffer

SYNTAX

Ln

Clear the internal data buffer, where

n = 0

only.

L?

Returns the number of port readings in the internal data buffer (from

0

to

2000

).

DESCRIPTION

The Buffer (

L

) command is used to clear the internal data buffer or to determine the number of readings in the buffer.

It is used primarily with the Data Ready (

R

) command

R2

(data is latched and buffered on an EDR transition), although

it may be used at any time to determine the buffer status.

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

PRINT#1,"OUTPUT08;C0P0R2G3X"

Line 1: Buffer data to be sent when addressed to Talk; collect some

data.

PRINT#1,"OUTPUT08;L?X"

Line 2: Request buffer status of Channel 0.

PRINT#1,"ENTER08",

INPUT#2,COUNT$,

COUNT$ = RIGHT$(COUNT$,4),

COUNT = VAL(COUNT$),

PRINT COUNT

Line 7: Display shows:

24

(24 port readings in buffer)

DIM B(100)

Line 8: Store readings in an array.

FOR I = 1 TO COUNT

Line 9: Readings are stored as integers.

PRINT#1,"ENTER08",

INPUT#2,A$,

B(I) = VAL(RIGHT$(A$,4)),

NEXT I,

PRINT#1,"OUTPUT08;L?X"

Line 14: Request buffer status.

PRINT#1,"ENTER08",

INPUT#2,COUNT$,

PRINT COUNT$

Line 17: Display shows:

L000

(since all data has been read)

Digital488/80A User’s Manual

967695

Digital488/80A Commands 61