B&K user manual BK Precision 4071 User Manual Rev.2.2

Models: 4071

1 88
Download 88 pages 40.73 Kb
Page 81
Image 81

'------------------------------------------------------------------------------

'

Flush all Rx chars from Port 1 buffer

'------------------------------------------------------------------------------

FlushBuff1:

IF LOC(1) = 0 THEN GOTO DoTimeout1

a$ = INPUT$(LOC(1), #1) ' Get all waiting chars in Rx buffer

'Now wait for a time-out time to make sure no new stuff is coming in. DoTimeout1:

CALL Delay(.8)

' Do a 800 mS delay

IF LOC(1) <> 0 THEN GOTO FlushBuff1

' If something came in during

RETURN

 

' our time-out, flush it

 

 

'------------------------------------------------------------------------------

 

'

Wait for x mS

' Function to delay x number of mS.

 

'------------------------------------------------------------------------------

 

SUB Delay (X%) STATIC

 

 

start! = TIMER

 

' Returns no. of secs since midnight.

 

 

' Example: 65445.15

DelayLoop:

 

' Do a x mS delay

IF TIMER < start! + X% / 1000 THEN GOTO DelayLoop

END SUB

 

 

'------------------------------------------------------------------------------

 

'

Wait for a keypress

'------------------------------------------------------------------------------

 

SUB Pause STATIC

 

 

DO

 

 

LOOP UNTIL INKEY$ <> ""

' Wait for keypress to continue

END SUB

76

BK Precision 4071 User Manual Rev.2.2

Page 81
Image 81
B&K user manual BK Precision 4071 User Manual Rev.2.2